Patch level : 2.0 nopatch

Files correlati     : cg2.exe
Ricompilazione Demo : [ ]
Commento            :
Aggiunte traduzioni a cg2


git-svn-id: svn://10.65.10.50/trunk@11006 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-04-14 07:42:12 +00:00
parent 8c7feb9848
commit 85fdfecfac
8 changed files with 203 additions and 224 deletions

View File

@ -331,15 +331,15 @@ bool TPrimanota_application::read_caus(const char* cod, int year)
}
int err = 0;
if (tc.descrizione() == "Sconosciuto")
if (tc.descrizione() == TR("Sconosciuto"))
err = 1; else
if (tc.sospeso())
err = 2;
if (err)
{
error_box("Il conto della riga %d della causale e' %s",
i, err == 1 ? "sconosciuto" : "sospeso");
error_box(FR("Il conto della riga %d della causale e' %s"),
i, err == 1 ? TR("sconosciuto") : TR("sospeso"));
}
const char sezione = rcaus->get_char(RCA_SEZIONE);
@ -705,9 +705,9 @@ void TPrimanota_application::init_modify_mode(TMask& m)
m.show(F_ADJUST_PRORATA);
m.set_handler(F_ADJUST_PRORATA, prorata_handler);
warning_box("Questo movimento e' stato registrato con una percentuale\n"
warning_box(TR("Questo movimento e' stato registrato con una percentuale\n"
"prorata non compatibile con quella corrente:\n"
"Premere il bottone di correzione automatica delle righe.");
"Premere il bottone di correzione automatica delle righe."));
}
else
{
@ -830,8 +830,8 @@ int TPrimanota_application::read(TMask& m)
if (to_swap) imposta = -imposta;
if (imponibile.sign() * imposta.sign() < 0)
{
error_box("Registrazione con imponibile e imposta con segni discordi:\n"
"assegnato il segno dell'imponibile");
error_box(TR("Registrazione con imponibile e imposta con segni discordi:\n"
"assegnato il segno dell'imponibile"));
imposta = -imposta;
}
riga.add(imposta.string()); // Imposta 104
@ -977,7 +977,7 @@ void TPrimanota_application::mask2rel(const TMask& m)
if (err == NOERR)
rec.put("OCFPI", om.get(O_CODICE));
else
error_box("Errore di scrittura sul file dei clienti/fornitori occasionali: %d", err);
error_box(FR("Errore di scrittura sul file dei clienti/fornitori occasionali: %d"), err);
}
else
rec.zero("OCFPI");
@ -1047,9 +1047,9 @@ void TPrimanota_application::check_saldi()
{
const TConto* c = _saldi.find(conto, anno);
if (c && !c->saldo_finale().is_zero() && c->saldo_finale().sezione() != sez)
warning_box("Il conto della riga %i ha un saldo finale in %s, "
"contrariamente a quanto indicato sul piano dei conti",
i+1, sez == 'A' ? "dare" : "avere");
warning_box(FR("Il conto della riga %i ha un saldo finale in %s, "
"contrariamente a quanto indicato sul piano dei conti"),
i+1, sez == 'A' ? TR("dare") : TR("avere"));
}
}
}
@ -1806,18 +1806,18 @@ bool TPrimanota_application::protected_record(TRectype& mov)
{
if (mov.get_bool(MOV_STAMPATO))
{
ok = yesno_box("Il movimento %ld e' gia' stato stampato sul libro giornale:\n"
"si desidera eliminarlo ugualmente?", numreg);
ok = yesno_box(FR("Il movimento %ld e' gia' stato stampato sul libro giornale:\n"
"si desidera eliminarlo ugualmente?"), numreg);
}
if (ok && mov.get_bool(MOV_REGST))
{
ok = yesno_box("Il movimento %ld e' gia' stato stampato sul bollato:\n"
"si desidera eliminarlo ugualmente?", numreg);
ok = yesno_box(FR("Il movimento %ld e' gia' stato stampato sul bollato:\n"
"si desidera eliminarlo ugualmente?"), numreg);
}
if (ok && mov.get_bool(MOV_INVIATO))
{
ok = yesno_box("Il movimento %ld e' stato inviato ad un'altra contabilita':\n"
"si desidera eliminarlo ugualmente?", numreg);
ok = yesno_box(FR("Il movimento %ld e' stato inviato ad un'altra contabilita':\n"
"si desidera eliminarlo ugualmente?"), numreg);
}
if (ok)
last_checked_numreg = numreg;
@ -1829,7 +1829,7 @@ bool TPrimanota_application::protected_record(TRectype& mov)
int cg2100 (int argc, char** argv)
{
TPrimanota_application* a = new TPrimanota_application;
a->run(argc, argv, "Prima nota");
a->run(argc, argv, TR("Prima nota"));
delete a;
return 0;
}

View File

@ -1,5 +1,6 @@
#include <stdlib.h>
#include <diction.h>
#include <tabutil.h>
#include <prefix.h>
@ -108,8 +109,8 @@ char TMovimentoPN::frequenza_versamenti(int year) const
if (last_freq != 'M' && last_freq != 'T')
{
error_box("La frequenza versamenti IVA per la ditta %ld\n"
"non e' valida: la si considera mensile.", firm);
error_box(FR("La frequenza versamenti IVA per la ditta %ld\n"
"non e' valida: la si considera mensile."), firm);
last_freq = 'M';
}

View File

@ -50,7 +50,7 @@ char TPrimanota_application::row_type(const TToken_string& s)
TipoIVA TPrimanota_application::cau2IVA(const char* cod, int annoiva)
{
if (!read_caus(cod, annoiva))
error_box("Causale errata: '%s'", cod);
error_box(FR("Causale errata: '%s'"), cod);
return causale().iva();
}
@ -136,7 +136,7 @@ bool TPrimanota_application::suspended_handler(TMask_field& f, KEY k)
if (suspended)
{
sf = f.get();
return f.error_box("Il codice '%s' e' sospeso e non puo' essere utilizzato", sf);
return f.error_box(TR("Il codice '%s' e' sospeso e non puo' essere utilizzato"), sf);
}
}
return TRUE;
@ -638,23 +638,22 @@ HIDDEN bool imptot_error(const TImporto& imptot, const TImporto& impsal, bool va
TCurrency euro(imptot.valore(), codval);
TString msg(255);
msg << "Il totale documento ";
if (codval.not_empty())
msg << "in valuta " << codval;
msg << TR("Il totale documento in valuta") << codval;
else
msg << "inserito";
msg << " e' " << euro.string(TRUE) << ' ' << imptot.sezione() << ",\n";
msg << TR("Il totale documento inserito");
msg << TR(" e' ") << euro.string(TRUE) << ' ' << imptot.sezione() << ",\n";
euro.set_num(cassa.valore());
msg << "i pagamenti e le spese ammontano a "
msg << TR("i pagamenti e le spese ammontano a ")
<< euro.string(TRUE) << ' ' << cassa.sezione() << ",\n";
euro.set_num(residuo.valore());
msg << "per cui il residuo e' " << euro.string(TRUE);
msg << TR("per cui il residuo e' ") << euro.string(TRUE);
if (m.edit_mode() && impsal.is_zero())
{
msg << "\nSi desidera registrare ugualmente?";
msg << TR("\nSi desidera registrare ugualmente?");
ok = a.cgs().yesno_box(msg);
}
else
@ -678,9 +677,9 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
const char* ss = saldo.string(TRUE);
if (*ss == '-') ss++;
const TRectype & rec = cache().get("%VAL", TCurrency::get_firm_val());
const char * name = rec.empty() ? "Lire" : (const char *) rec.get("S0");
return f.error_box("Il movimento e' sbilanciato di %s %s.", ss, name);
const TRectype& rec = cache().get("%VAL", TCurrency::get_firm_val());
const char* name = rec.get("S0");
return f.error_box(FR("Il movimento e' sbilanciato di %s %s."), ss, name);
}
TMask& m = f.mask();
@ -704,14 +703,14 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
{
const TBill c(r, 2, 0x1);
if (!c.ok())
return f.error_box("Il conto della riga %d non e' completo", i+1);
return f.error_box(FR("Il conto della riga %d non e' completo"), i+1);
if (m.insert_mode() && c.sospeso())
return f.error_box("Il conto della riga %d e' sospeso", i+1);
return f.error_box(FR("Il conto della riga %d e' sospeso"), i+1);
const TBill co(r, 10, 0x0);
if (!co.empty() && !co.ok())
{
const bool ok = f.yesno_box("La contropartita della riga %d non e' completa:\n"
"Si desidera continuare ugualmente?", i+1);
const bool ok = f.yesno_box(FR("La contropartita della riga %d non e' completa:\n"
"Si desidera continuare ugualmente?"), i+1);
if (!ok) return FALSE;
}
@ -733,7 +732,8 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
const int annorif = m.get_int(F_ANNORIF);
const TString& numrif = m.get(F_NUMRIF);
if (annorif > 0 && !numrif.blank() &&
yesno_box("Si desidera generare automaticamente la partita %d %s?", annorif, (const char*)numrif))
yesno_box(FR("Si desidera generare automaticamente la partita %d %s?"),
annorif, (const char*)numrif))
{
const TBill bill(r, 2, 0x1);
errato = !a.crea_partita(bill, annorif, numrif, currig, importo);
@ -744,15 +744,14 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
{
TString msg(128);
const TCurrency euro(speso.valore());
msg << "L'importo sul saldaconto della riga " << currig << " e' "
<< euro.string(TRUE);
msg.format("L'importo sul saldaconto della riga %d e' %s", currig, (const char*)euro.string(TRUE));
if (!speso.is_zero())
msg << (speso.sezione() == 'A' ? " Avere" : " Dare");
msg << (speso.sezione() == 'A' ? TR(" Avere") : TR(" Dare"));
bool ok = FALSE;
if (m.edit_mode() && speso.is_zero())
{
msg << "\nSi desidera registrare ugualmente?";
msg << TR("\nSi desidera registrare ugualmente?");
ok = f.yesno_box(msg);
}
else
@ -788,7 +787,7 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
if (pc.get_bool(PCN_CMSNEEDED))
{
k.replace('|', ' ');
return f.error_box("Il codice commessa è obbligatorio per il conto %s della riga %d",
return f.error_box(FR("Il codice commessa è obbligatorio per il conto %s della riga %d"),
(const char*)k, i+1);
}
}
@ -796,7 +795,7 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
}
if (empty)
return f.error_box("Il movimento non ha nessuna riga contabile con un importo");
return f.error_box(TR("Il movimento non ha nessuna riga contabile con un importo"));
if ((paga || nota) && !a._as400)
{
@ -819,12 +818,12 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
TBill contocf;
if (a.cerca_conto_cf(contocf) < 0)
{
TString msg(80); msg = "Non esiste una riga contabile riferita al ";
msg << (contocf.tipo() == 'C' ? "cliente" : "fornitore") << ' ';
TString msg(80); msg = TR("Non esiste una riga contabile riferita al ");
msg << (contocf.tipo() == 'C' ? TR("cliente") : TR("fornitore")) << ' ';
msg << contocf.codclifo() << ":\n";
if (m.edit_mode())
{
msg << "Si desidera eliminare il saldaconto?";
msg << TR("Si desidera eliminare il saldaconto?");
const bool kill = f.yesno_box(msg);
if (kill)
{
@ -843,7 +842,7 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
}
else
{
msg << "Impossibile registrare il saldaconto!";
msg << TR("Impossibile registrare il saldaconto!");
return f.error_box(msg);
}
}
@ -1135,7 +1134,7 @@ bool TPrimanota_application::descr_handler(TMask_field& f, KEY k)
if (k == K_ENTER && f.get().empty())
{
if (f.mask().get(F_CODCAUS).empty())
return f.error_box("La descrizione del documento e' necessaria in assenza della causale");
return f.error_box(TR("La descrizione del documento e' necessaria in assenza della causale"));
}
return TRUE;
}
@ -1195,7 +1194,7 @@ bool TPrimanota_application::fase_handler(TMask_field& f, KEY k)
{
const TEdit_field& cms_fld = f.mask().efield(f.dlg()-1);
if (cms_fld.empty())
ok = f.error_box("E' necessario specificare anche la commessa");
ok = f.error_box(TR("E' necessario specificare anche la commessa"));
}
return ok;
}
@ -1311,7 +1310,7 @@ bool TPrimanota_application::codiva_handler(TMask_field& f, KEY key)
if (key == K_ENTER)
{
if (f.get().empty() && f.mask().get(101).not_empty())
return f.error_box("Codice IVA obbligatorio");
return f.error_box(TR("Codice IVA obbligatorio"));
}
}
return TRUE;
@ -1358,7 +1357,7 @@ bool TPrimanota_application::imposta_handler(TMask_field& f, KEY key)
if (val != imposta)
{
const TCurrency euro(imposta);
f.warning_box("L'imposta dovrebbe essere %s", euro.string(TRUE));
f.warning_box(FR("L'imposta dovrebbe essere %s"), euro.string(TRUE));
}
} else
if (key == K_F8)
@ -1373,7 +1372,7 @@ bool TPrimanota_application::imposta_handler(TMask_field& f, KEY key)
f.set(imposta.string());
}
else
f.warning_box("Cancellare l'imposta (tasto F2) prima di effettuare lo scorporo");
f.warning_box(TR("Cancellare l'imposta (tasto F2) prima di effettuare lo scorporo"));
}
return TRUE;
@ -1684,8 +1683,8 @@ bool TPrimanota_application::iva_handler(TMask_field& f, KEY k)
{
const TString t(tot.string(TRUE));
const TString i(imp.string(TRUE));
return error_box("La somma del totale documento e delle ritenute (%s) e' diverso dalla "
"somma degli imponibili e delle imposte (%s)",
return error_box(FR("La somma del totale documento e delle ritenute (%s) e' diverso dalla "
"somma degli imponibili e delle imposte (%s)"),
(const char*)t, (const char*)i);
}
@ -1698,11 +1697,11 @@ bool TPrimanota_application::iva_handler(TMask_field& f, KEY k)
{
const TFixed_string codiva = row.get(1);
if (codiva.blank())
return error_box("Il codice IVA della riga %d e' obbligatorio", i+1);
return error_box(FR("Il codice IVA della riga %d e' obbligatorio"), i+1);
TBill c(row, 5, 0x1);
if (!c.ok() || !c.find())
return error_box("Il conto della riga iva %d e' errato o incompleto", i+1);
return error_box(FR("Il conto della riga iva %d e' errato o incompleto"), i+1);
}
}
}
@ -1771,8 +1770,8 @@ bool TPrimanota_application::cg_conto_handler(TMask_field& f, KEY key)
if (cf < ' ') cf = ' '; // Tipo conto della riga
if (cf != tipo) // Incongruenza!
{
const char* d = tipo == 'C' ? "clienti" : "fornitori";
ok = f.error_box("La riga totale richiede un conto %s.", d);
const char* d = tipo == 'C' ? TR("clienti") : TR("fornitori");
ok = f.error_box(FR("La riga totale richiede un conto %s."), d);
}
}
}
@ -1829,7 +1828,7 @@ bool TPrimanota_application::iva_sottoconto_handler(TMask_field& f, KEY key)
if (key == K_ENTER && cdc.empty() && pc.get_bool(PCN_CMSNEEDED))
{
k.replace(k.separator(), ' ');
return cdc.error_box("Il conto %s richiede che sia specificato il codice CDC/Commessa",
return cdc.error_box(FR("Il conto %s richiede che sia specificato il codice CDC/Commessa"),
(const char*)k);
}
}
@ -1861,7 +1860,7 @@ bool TPrimanota_application::cg_sottoconto_handler(TMask_field& f, KEY k)
if (k == K_ENTER && cdc.empty() && pc.get_bool(PCN_CMSNEEDED))
{
key.replace(key.separator(), ' ');
return cdc.error_box("Il conto %s richiede che sia specificato il codice CDC/Commessa",
return cdc.error_box(FR("Il conto %s richiede che sia specificato il codice CDC/Commessa"),
(const char*)key);
}
}
@ -1929,22 +1928,22 @@ bool TPrimanota_application::num_handler(TMask_field& f, KEY key)
if (mov.get_bool(MOV_STAMPATO))
{
ok = f.yesno_box("Il movimento e' gia' stato stampato sul libro giornale:\n"
"si desidera continuare ugualmente?");
ok = f.yesno_box(TR("Il movimento e' gia' stato stampato sul libro giornale:\n"
"si desidera continuare ugualmente?"));
a._skip_giornale_check = ok;
}
if (ok && mov.get_bool(MOV_REGST))
{
ok = f.yesno_box("Il movimento e' gia' stato stampato sul bollato:\n"
"si desidera continuare ugualmente?");
ok = f.yesno_box(TR("Il movimento e' gia' stato stampato sul bollato:\n"
"si desidera continuare ugualmente?"));
a._skip_bollato_check = ok;
}
if (ok && mov.get_bool(MOV_INVIATO))
{
ok = f.yesno_box("Il movimento e' stato inviato ad un'altra contabilita':\n"
"si desidera continuare ugualmente?");
ok = f.yesno_box(TR("Il movimento e' stato inviato ad un'altra contabilita':\n"
"si desidera continuare ugualmente?"));
}
if (ok)
@ -1987,7 +1986,7 @@ bool TPrimanota_application::caus_query_handler(TMask_field& f, KEY key)
if (i != iva_errata)
return suspended_handler(f, key); // Controlla sospensione
else
return error_box("Causale non presente in archivio");
return error_box(TR("Causale non presente in archivio"));
}
return TRUE;
@ -2033,13 +2032,13 @@ bool TPrimanota_application::datareg_handler(TMask_field& f, KEY key)
{
const TDate dr(f.get()); // Data dell'operazione
if (dr > TDate(TODAY))
return f.error_box("La data dell'operazione e' superiore quella di sistema");
return f.error_box(TR("La data dell'operazione e' superiore quella di sistema"));
TPrimanota_application& a = app();
const int ae = a._esercizi.date2esc(dr); // Codice esercizio
if (ae <= 0)
return f.error_box("La data dell'operazione non appartiene a nessun esercizio");
return f.error_box(TR("La data dell'operazione non appartiene a nessun esercizio"));
TLibro_giornale& gio = a.giornale();
const int ar = dr.year(); // Anno per registri
@ -2047,7 +2046,7 @@ bool TPrimanota_application::datareg_handler(TMask_field& f, KEY key)
{
ok = gio.read(ar);
if (!ok)
return f.error_box("Non esiste il libro giornale del %d", ar);
return f.error_box(FR("Non esiste il libro giornale del %d"), ar);
}
else
ok = TRUE;
@ -2061,14 +2060,14 @@ bool TPrimanota_application::datareg_handler(TMask_field& f, KEY key)
{
if (dr < gio.last_print())
{
f.error_box("La data dell'operazione e' antecedente al %s,\n"
"ultima stampa del libro giornale del %d",
f.error_box(FR("La data dell'operazione e' antecedente al %s,\n"
"ultima stampa del libro giornale del %d"),
gio.last_print().string(), ar);
if (error) return FALSE;
}
if (key == K_TAB && dr < gio.last_reg())
f.warning_box("La data dell'operazione e' antecedente al %s,\n"
"ultima registrazione sul libro giornale del %d",
f.warning_box(FR("La data dell'operazione e' antecedente al %s,\n"
"ultima registrazione sul libro giornale del %d"),
gio.last_reg().string(), ar);
}
@ -2092,21 +2091,21 @@ bool TPrimanota_application::datareg_handler(TMask_field& f, KEY key)
{
if (dr < reg.last_print())
{
f.error_box("La data dell'operazione e' antecedente al %s,\n"
"ultima stampa del registro '%s' del %d",
f.error_box(FR("La data dell'operazione e' antecedente al %s,\n"
"ultima stampa del registro '%s' del %d"),
reg.last_print().string(), (const char*)codreg, ar);
if (error) return FALSE;
}
if (f.dirty() && dr < reg.last_reg())
f.warning_box("La data dell'operazione e' antecedente al %s,\n"
"ultima registrazione sul registro '%s' del %d",
f.warning_box(FR("La data dell'operazione e' antecedente al %s,\n"
"ultima registrazione sul registro '%s' del %d"),
reg.last_reg().string(), (const char*)codreg, ar);
}
if (reg.iva() != nessuna_iva && a._rel->controlla_liquidazione(dr, reg) == TRUE)
{
const char* const mese = itom(dr.month());
f.warning_box("La liquidazione IVA relativa al mese di %s e' gia' stata calcolata", mese);
f.warning_box(FR("La liquidazione IVA relativa al mese di %s e' gia' stata calcolata"), mese);
}
}
}
@ -2136,11 +2135,11 @@ bool TPrimanota_application::datacomp_handler(TMask_field& f, KEY key)
TEsercizi_contabili& esc = app()._esercizi;
const int ae = esc.date2esc(dc); // Esercizio corrispondente
const char* data = "del 74/ter";
const char* data = TR("La data del 74/ter");
if (f.dlg() == F_DATACOMP)
{
m.set(F_ANNOES, ae, TRUE); // Aggiorna anno esercizio in entrambe le pagine
data = "di competenza";
data = TR("La data di competenza");
if (dc > dr)
{
@ -2165,15 +2164,15 @@ bool TPrimanota_application::datacomp_handler(TMask_field& f, KEY key)
if (ae != ar && ae != pr)
{
TString e(80);
e << "La data " << data << " deve appartenere all'esercizio " << ar;
if (pr > 0) e << " o al " << pr;
e.format(FR("%s deve appartenere all'esercizio %d"), data, ar);
if (pr > 0) e << TR(" o all'esercizio ") << pr;
return f.error_box(e);
}
}
else
{
if (m.is_running())
return f.error_box("La data %s non appartiene a nessun esercizio", data);
return f.error_box(FR("%s non appartiene a nessun esercizio"), data);
}
}
@ -2193,17 +2192,17 @@ bool TPrimanota_application::data74ter_handler(TMask_field& f, KEY key)
return TRUE;
if (d74.year() < dr.year()-1)
return error_box("La data 74/ter non puo' essere antecedente all'anno %d", dr.year()-1);
return error_box(FR("La data 74/ter non puo' essere antecedente all'anno %d"), dr.year()-1);
const TLibro_giornale g(d74.year());
if (!g.ok())
return error_box("La data 74/ter non appartiene ad un esercizio valido");
return error_box(TR("La data 74/ter non appartiene ad un esercizio valido"));
if (d74 < g.last_print())
{
const char* lp = g.last_print().string();
return f.error_box("La data 74/ter e' antecedente al %s,\n"
"data di stampa del libro giornale del %d", lp, g.year());
return f.error_box(FR("La data 74/ter e' antecedente al %s,\n"
"data di stampa del libro giornale del %d"), lp, g.year());
}
return TRUE;
}
@ -2389,7 +2388,7 @@ bool TPrimanota_application::clifo_handler(TMask_field& f, KEY key)
const TPartita* game = p.first();
if (game != NULL && atol(f.get()) != game->conto().codclifo())
{
const bool del = f.yesno_box("Si desidera cancellare i pagamenti effettuati?");
const bool del = f.yesno_box(TR("Si desidera cancellare i pagamenti effettuati?"));
if (!del) // Ripristina codice copiandolo dalla prima partita
{
TString cod; cod << game->conto().codclifo();
@ -2429,7 +2428,7 @@ bool TPrimanota_application::clifo_handler(TMask_field& f, KEY key)
{
if (a._conto_ricavo.sospeso())
{
f.error_box("Il conto di ricavo e' sospeso");
f.error_box(TR("Il conto di ricavo e' sospeso"));
a._conto_ricavo.set(0,0,0);
}
}
@ -2506,7 +2505,7 @@ bool TPrimanota_application::clifo_handler(TMask_field& f, KEY key)
if (occas && a.is_fattura() && a.partite().first() != NULL)
{
f.warning_box("Attenzione, il saldaconto verra' eliminato!");
f.warning_box(TR("Attenzione, il saldaconto verra' eliminato!"));
f.set_dirty(); // warning_box cleans the field!
}
a.activate_numrif(m, TRUE);
@ -2665,7 +2664,7 @@ bool TPrimanota_application::totdoc_handler(TMask_field& f, KEY key)
{
const TCurrency totale(real(f.get()));
if (totale.get_num().is_zero())
ok = yesno_box("Totale documento nullo: continuare ugualmente?");
ok = yesno_box(TR("Totale documento nullo: continuare ugualmente?"));
if (ok)
{
@ -2675,7 +2674,7 @@ bool TPrimanota_application::totdoc_handler(TMask_field& f, KEY key)
const real totval(m.get(SK_TOTDOCVAL));
const TCurrency totlit(cambio.val2lit(totval));
if (totale != totlit)
ok = f.yesno_box("Il totale documento dovrebbe essere %s: continuare ugualmente?",
ok = f.yesno_box(FR("Il totale documento dovrebbe essere %s: continuare ugualmente?"),
totlit.string(TRUE));
}
}
@ -2748,7 +2747,7 @@ bool TPrimanota_application::protiva_handler(TMask_field& f, KEY key)
const long protiva = atol(f.get());
const long protocol = app().causale().reg().protocol() + 1;
if (protiva != protocol)
ok = f.yesno_box("Accettare il protocollo IVA fuori sequenza: %ld invece di %ld",
ok = f.yesno_box(FR("Accettare il protocollo IVA fuori sequenza: %ld invece di %ld"),
protiva, protocol);
}
@ -2849,8 +2848,8 @@ bool TPrimanota_application::corrlire_handler(TMask_field& f, KEY key)
if (im != cl)
{
const TRectype& rec = cache().get("%VAL", TCurrency::get_firm_val());
const char* name = rec.empty() ? "Lire" : (const char*)rec.get("S0");
warning_box("Il corrispettivo in %s e' diverso dal totale degli imponibili", name);
const char* name = (const char*)rec.get("S0");
warning_box(FR("Il corrispettivo in %s e' diverso dal totale degli imponibili"), name);
}
}
@ -2966,7 +2965,7 @@ bool TPrimanota_application::solaiva_handler(TMask_field& f, KEY key)
{
bool del = TRUE;
if (game != NULL)
del = f.yesno_box("Si desidera cancellare il saldaconto?");
del = f.yesno_box(TR("Si desidera cancellare il saldaconto?"));
if (!del)
{
f.reset();
@ -2985,7 +2984,7 @@ bool TPrimanota_application::solaiva_handler(TMask_field& f, KEY key)
{
TSheet_field& iva = a.ivas();
const int righe = iva.items();
TProgind pi(righe, "Generazione righe contabilita'", FALSE, TRUE, 16);
TProgind pi(righe, TR("Generazione righe contabilita'"), FALSE, TRUE);
TSheet_field& cg = a.cgs();
cg.reset();

View File

@ -1,5 +1,6 @@
#include <stdlib.h>
#include <diction.h>
#include <prefix.h>
#include <recarray.h>
#include <tabutil.h>
@ -56,7 +57,7 @@ bool TCausale::read(const char* cod, int year)
const TString16 codreg(_rec.get(CAU_REG));
const bool ok = _reg.read(codreg, year); // Read register
if (!ok && codreg.not_empty())
return error_box("Non esiste il registro '%s' del %d",
return error_box(FR("Non esiste il registro '%s' del %d"),
(const char*)codreg, year);
calcIVA();
}
@ -205,12 +206,12 @@ void TCausale::calcIVA()
i = ri;
if (i != ri)
{
error_box("Tipo documento '%s' incompatibile con tipo registro", (const char*)td);
error_box(FR("Tipo documento '%s' incompatibile con tipo registro"), (const char*)td);
i = iva_errata;
}
c = tpd.get_bool("B0"); // B0 flag corrispettivi
}
else error_box("Tipo documento sconosciuto: '%s'", (const char*)td);
else error_box(FR("Tipo documento sconosciuto: '%s'"), (const char*)td);
}
_iva = i;
_corrisp = c;
@ -219,16 +220,16 @@ void TCausale::calcIVA()
bool TCausale::similar(const TCausale& c) const
{
const char* err = "";
if (sezionale() != c.sezionale()) err = "il segnale di sezionale";
if (intra() != c.intra()) err = "la gestione dei movimenti intra";
if (valuta() != c.valuta()) err = "la gestione valuta";
if (valintra() != c.valintra()) err = "la gestione valuta intracomunitaria";
if (corrispettivi() != c.corrispettivi()) err = "la gestione dei corrispettivi";
if (iva() != c.iva()) err = "il tipo di IVA";
if (tipomov() != c.tipomov()) err = "il tipo di movimento";
if (sezionale() != c.sezionale()) err = TR("il segnale di sezionale");
if (intra() != c.intra()) err = TR("la gestione dei movimenti intra");
if (valuta() != c.valuta()) err = TR("la gestione valuta");
if (valintra() != c.valintra()) err = TR("la gestione valuta intracomunitaria");
if (corrispettivi() != c.corrispettivi()) err = TR("la gestione dei corrispettivi");
if (iva() != c.iva()) err = TR("il tipo di IVA");
if (tipomov() != c.tipomov()) err = TR("il tipo di movimento");
if (*err)
error_box("La causale e' diversa per %s", err);
error_box(FR("La causale e' diversa per %s"), err);
return *err ? FALSE : TRUE;
}

View File

@ -255,13 +255,13 @@ bool TPrimanota_application::pag_sheet_handler(TMask_field& f, KEY key)
if (imp != tot)
{
TCurrency curr(imp, in_valuta ? (const char*)codval : "_FIRM");
TCurrency curr(imp, in_valuta ? (const char*)codval : "");
const TString is = curr.string(TRUE);
curr.set_num(tot);
const TString ts = curr.string(TRUE);
ok = yesno_box("Il totale delle rate e' %s mentre\n"
ok = yesno_box(FR("Il totale delle rate e' %s mentre\n"
"il totale del documento e' %s.\n"
"Si desidera registrare ugualmente?",
"Si desidera registrare ugualmente?"),
(const char*)is, (const char*)ts);
}
}
@ -277,16 +277,16 @@ bool TPrimanota_application::pag_sheet_handler(TMask_field& f, KEY key)
if (imp != totlit)
{
TCurrency curr(imp, "_FIRM");
TCurrency curr(imp);
const TString is = curr.string(TRUE);
curr.set_num(totlit);
const TString ts = curr.string(TRUE);
const TRectype & rec = cache().get("%VAL", TCurrency::get_firm_val());
const char * name = rec.empty() ? "Lire" : (const char *) rec.get("S0");
const char * name = (const char *) rec.get("S0");
ok = yesno_box("Il totale in %s delle rate e' %s mentre\n"
ok = yesno_box(FR("Il totale in %s delle rate e' %s mentre\n"
"il totale del documento e' %s.\n"
"Si desidera registrare ugualmente?",
"Si desidera registrare ugualmente?"),
name, (const char*)is, (const char*)ts);
}
}
@ -327,7 +327,7 @@ bool TPrimanota_application::codpag_handler(TMask_field& f, KEY key)
{
if (set_scad && f.get().empty())
{
f.error_box("Il codice di pagamento e' obbligatorio!");
f.error_box(TR("Il codice di pagamento e' obbligatorio!"));
const char typ = a.clifo();
const long cod = m.get_long(typ == 'C' ? F_CLIENTE : F_FORNITORE);
@ -364,7 +364,7 @@ bool TPrimanota_application::annorif_handler(TMask_field& f, KEY key)
{
const TString& anno = m.get(F_DATADOC).right(4);
f.set(anno);
ok = error_box("L'anno di riferimento partita e' obbligatorio!");
ok = error_box(TR("L'anno di riferimento partita e' obbligatorio!"));
}
}
return ok;
@ -399,7 +399,7 @@ bool TPrimanota_application::numrif_handler(TMask_field& f, KEY key)
f.set(m.get(a._npart_is_prot ? F_PROTIVA : F_NUMDOC));
key = K_TAB; // Forza la successiva activate_numrif
ok = f.error_box("Il numero di riferimento partita e' obbligatorio!");
ok = f.error_box(TR("Il numero di riferimento partita e' obbligatorio!"));
}
if (key == K_TAB && a.is_fattura())
@ -410,8 +410,8 @@ bool TPrimanota_application::numrif_handler(TMask_field& f, KEY key)
const TPartita* old = a.partite().first();
if (old && old->ok() && f.get().blank()) // Se esisteva una partita ma ora non piu'
{
const KEY k = yesnocancel_box("Attenzione la fattura della partita %d %s verra' eliminata.\n"
"Premere SI per cancellarla, NO per ripristinarla, ANNULLA per modificarla",
const KEY k = yesnocancel_box(FR("Attenzione la fattura della partita %d %s verra' eliminata.\n"
"Premere SI per cancellarla, NO per ripristinarla, ANNULLA per modificarla"),
old->anno(), (const char*)old->numero());
switch (k)
{
@ -560,19 +560,19 @@ bool TPrimanota_application::recalc_handler(TMask_field& f, KEY key)
if (pag.in_valuta()) yak |= (pag.tval_rata(0) != pag.importo_da_non_dividere(TRUE));
if (yak)
{
if (yesno_box("L'importo della prima rata e' stato modificato. "
if (yesno_box(TR("L'importo della prima rata e' stato modificato. "
"Con il ricalcolo automatico esso non sara' piu'"
" modificabile. Si desidera "
"riportare le rate alle condizioni iniziali?"))
"riportare le rate alle condizioni iniziali?")))
{
pag.set_tipo_prima_rata(pag.tipo_prima_rata() + 3);
m.set(FS_TIPOPR, pag.desc_tpr());
a.reset_pagamento();
a.set_scadenze(m);
}
else warning_box("Il tipo prima rata e' stato modificato in \"%s\" per "
else warning_box(FR("Il tipo prima rata e' stato modificato in \"%s\" per "
"poter mantenere la rateazione scelta e la possibilita' di "
"ricalcolo automatico",
"ricalcolo automatico"),
pag.desc_tpr());
}
else
@ -824,7 +824,7 @@ bool TPrimanota_application::read_scadenze(TMask& m)
const TCurrency totdoc_s(partita.importo(in_valuta).valore(), m.get(SK_VALUTA));
const TString i1 = totdoc_c.string(TRUE);
const TString i2 = totdoc_s.string(TRUE);
warning_box("Il totale documento (%s) non corrisponde a quello del saldaconto (%s).",
warning_box(FR("Il totale documento (%s) non corrisponde a quello del saldaconto (%s)."),
(const char*)i1, (const char*)i2);
}
if (m.get_real(F_IMPOSTE) != partita.get_real(PART_IMPOSTA))
@ -833,7 +833,7 @@ bool TPrimanota_application::read_scadenze(TMask& m)
const TCurrency imposte_s(partita.get_real(PART_IMPOSTA));
const TString i1 = imposte_c.string(TRUE);
const TString i2 = imposte_s.string(TRUE);
warning_box("Il totale delle imposte (%s) non corrisponde a quello del saldaconto (%s).",
warning_box(FR("Il totale delle imposte (%s) non corrisponde a quello del saldaconto (%s)."),
(const char*)i1, (const char*)i2);
}
@ -1015,8 +1015,8 @@ void TPrimanota_application::write_scadenze(const TMask& m)
{
sposta = (oldgame->conto().sottoconto() == newgame->conto().sottoconto());
if (sposta)
sposta = yesno_box("Si desidera spostare la fattura e gli eventuali\n"
"pagamenti relativi nella partita %d %s?", anno, (const char*)numpart);
sposta = yesno_box(FR("Si desidera spostare la fattura e gli eventuali\n"
"pagamenti relativi nella partita %d %s?"), anno, (const char*)numpart);
}
if (sposta)
{
@ -1086,11 +1086,10 @@ bool TPrimanota_application::showpartite_handler(TMask_field& f, KEY k)
if (importo != speso)
{
TString msg(128);
const TCurrency curr(speso.valore(), "_FIRM");
msg << "L'importo sul saldaconto della riga " << (riga+1) << " e' "
<< curr.string(TRUE);
const TCurrency curr(speso.valore());
msg.format(FR("L'importo sul saldaconto della riga %d e' %s"), (riga+1), (const char*)curr.string(TRUE));
if (!speso.is_zero())
msg << (speso.sezione() == 'A' ? " Avere" : " Dare");
msg << (speso.sezione() == 'A' ? TR(" Avere") : TR(" Dare"));
return f.error_box(msg);
}
f.set_focus();

View File

@ -150,7 +150,7 @@ void TPay_mask::init(const TGame_mask* parent, int mod)
enable(DLG_DELREC, edit_mode());
#ifdef __EXTRA__
xvt_statbar_set(mod == MODE_MOD ? "Modifica" : "Inserimento", TRUE);
xvt_statbar_set(mod == MODE_MOD ? TR("Modifica") : TR("Inserimento"), TRUE);
hide(E_CODPAG); hide(E_DESPAG);
set_handler(E_DATAREG, datareg_handler);
@ -242,19 +242,19 @@ void TPay_mask::set_pag(const TRectype& oldpag, const TRiga_scadenze& scad,
const TBill& k = p.conto();
switch (k.tipo())
{
case 'C': prompt << "Cliente"; break;
case 'F': prompt << "Fornitore"; break;
default : prompt << "Conto " << k.gruppo() << ' ' << k.conto(); break;
case 'C': prompt << TR("Cliente"); break;
case 'F': prompt << TR("Fornitore"); break;
default : prompt << TR("Conto ") << k.gruppo() << ' ' << k.conto(); break;
}
prompt << ' ' << k.sottoconto() << ' ';
prompt << "Partita:" << p.anno() << ' ' << p.numero()
<< " Riga:" << oldpag.get_int(PAGSCA_NRIGA)
<< " Rata:" << oldpag.get_int(PAGSCA_NRATA);
prompt << TR("Partita:") << p.anno() << ' ' << p.numero()
<< TR(" Riga:") << oldpag.get_int(PAGSCA_NRIGA)
<< TR(" Rata:") << oldpag.get_int(PAGSCA_NRATA);
if (assigned())
prompt << " del " << scad.get_date(SCAD_DATASCAD).string();
prompt << TR(" del ") << scad.get_date(SCAD_DATASCAD).string();
#ifndef __EXTRA__
else
prompt << " del " << sum.get_date(PART_DATAPAG).string();
prompt << TR(" del ") << sum.get_date(PART_DATAPAG).string();
#endif
group.set_prompt(prompt);
@ -519,7 +519,7 @@ bool TPay_mask::datapag_handler(TMask_field& f, KEY k)
const TDate datapag(f.get());
TPay_mask& m = (TPay_mask&)f.mask();
if (datapag < m._datadoc)
return f.error_box("La data del pagamento e' inferiore alla data del documento %s",
return f.error_box(FR("La data del pagamento e' inferiore alla data del documento %s"),
m._datadoc.string());
}
return TRUE;
@ -563,7 +563,7 @@ bool TNew_mask::tipomov_handler(TMask_field& f, KEY k)
{
TNew_mask& m = (TNew_mask&)f.mask();
if (!m._allow_fatt && f.get() == "1")
return f.error_box("Non e' possibile utilizzare una fattura come pagamento");
return f.error_box(TR("Non e' possibile utilizzare una fattura come pagamento"));
}
return TRUE;
@ -579,7 +579,7 @@ void TNew_mask::init(char tipocf, bool fatt, bool edit)
tipomov.enable();
tipomov.set(_allow_fatt ? "1" : "3");
if (!_allow_fatt)
set_caption("Nuovo pagamento");
set_caption(TR("Nuovo pagamento"));
reset(P_NUMERO);
#else
tipomov.disable();
@ -608,11 +608,11 @@ void TGame_mask::append_conto(TString& s) const
switch (conto().tipo())
{
case 'C':
s << "Cliente"; break;
s << TR("Cliente"); break;
case 'F':
s << "Fornitore"; break;
s << TR("Fornitore"); break;
default:
s << "Conto " << conto().gruppo() << ' ' << conto().conto(); break;
s << TR("Conto ") << conto().gruppo() << ' ' << conto().conto(); break;
}
s << ' ' << conto().sottoconto();
}
@ -629,7 +629,7 @@ void TGame_mask::init(const TBill& bill, long numreg, int riga)
set(P_DESCR, descr);
#ifdef __EXTRA__
xvt_statbar_set("Estratto conto", TRUE);
xvt_statbar_set(TR("Estratto conto"), TRUE);
disable(-3); // Disabilita gestione valuta
hide(P_RESIDUO);
@ -744,7 +744,7 @@ bool TGame_mask::cambio_handler(TMask_field& f, KEY k)
{
TGame_mask& gm = (TGame_mask&)f.mask();
const bool needed = app().partite().mov2rig(gm._numreg, gm._numrig) > 0;
if (needed && yesno_box("Aggiornare il cambio di tutti i pagamenti effettuati in questa registrazione?"))
if (needed && yesno_box(TR("Aggiornare il cambio di tutti i pagamenti effettuati in questa registrazione?")))
{
const TValuta val(gm, P_VALUTA, P_DATACAMBIO, P_CAMBIO, P_CONTROEURO);
gm.aggiorna_valuta(val);
@ -972,7 +972,7 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
if (!rit.is_zero())
{
TToken_string& rrit = gm.add_colored_row(sheet, 'R');
rrit.add("Ritenute professionali", 4);
rrit.add(TR("Ritenute professionali"), 4);
gm.add_importo(rrit, rit, FALSE);
rrit.add(sum.get(PART_TIPOMOV), 11);
}
@ -986,8 +986,7 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
{
const char tipo_abb = pag.get_char(PAGSCA_PASSATT);
TToken_string& rabb = gm.add_colored_row(sheet, tipo_abb);
rabb.add("Abbuoni ", 4);
rabb << (tipo_abb == 'A' ? "attivi" : "passivi");
rabb.add(tipo_abb == 'A' ? TR("Abbuoni attivi") : TR("Abbuoni passivi"), 4);
if (in_valuta)
{
TImporto abb_lit = abb;
@ -1010,7 +1009,7 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
if (!diff.is_zero())
{
TToken_string& rdiff = gm.add_colored_row(sheet, 'C');
rdiff.add("Differenza cambio", 4);
rdiff.add(TR("Differenza cambio"), 4);
gm.add_importo(rdiff, diff);
rdiff.add(sum.get(PART_TIPOMOV), 11);
}
@ -1020,7 +1019,7 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
} // Fine ciclo sui pagamenti della rata
TToken_string& rsal = gm.add_colored_row(sheet, 'S');
rsal.add("Saldo rata ", 4); rsal << ra;
rsal.add(TR("Saldo rata "), 4); rsal << ra;
if (!scad.chiusa())
{
TImporto sl = scad.residuo(FALSE);
@ -1079,7 +1078,7 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
if (!rit.is_zero())
{
TToken_string& row = gm.add_colored_row(sheet, 'R');
row.add("Ritenute professionali", 4);
row.add(TR("Ritenute professionali"), 4);
gm.add_importo(row, rit, FALSE);
row.add(sum.get(PART_TIPOMOV), 11);
tot_lit += rit;
@ -1089,7 +1088,7 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
if (lastrow > 0)
{
TToken_string& sp = gm.add_colored_row(sheet, 'T');
sp.add("Saldo partita", 4);
sp.add(TR("Saldo partita"), 4);
if (prima_valuta.in_valuta())
sp << ' ' << prima_valuta.codice();
#ifdef __EXTRA__
@ -1110,14 +1109,14 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
}
TString80 header;
header = "Importo in "; header << TCurrency::get_firm_val();
header = TR("Importo in "); header << TCurrency::get_firm_val();
sheet.set_column_header(106, header);
header = "Importo in ";
header = TR("Importo in ");
if (prima_valuta.in_valuta())
header << prima_valuta.codice();
else
header << "valuta";
header << TR("valuta");
sheet.set_column_header(107, header);
sheet.force_update();
@ -1329,7 +1328,7 @@ bool TGame_mask::edit_scadenza_handler(TMask_field& f, KEY k)
if (m.get_bool(114))
{
if (was == NULL) giochi.destroy(game);
return f.error_box("La rata %d e' bloccata.", nrata);
return f.error_box(FR("La rata %d e' bloccata."), nrata);
}
#ifndef __EXTRA__
@ -1341,7 +1340,7 @@ bool TGame_mask::edit_scadenza_handler(TMask_field& f, KEY k)
if (c.empty()) c = TCurrency::get_firm_val();
if (was == NULL) giochi.destroy(game);
return f.error_box("La fattura deve essere pagata in %s.", (const char*)c);
return f.error_box(FR("La fattura deve essere pagata in %s."), (const char*)c);
}
#endif
@ -1389,7 +1388,7 @@ bool TGame_mask::edit_scadenza_handler(TMask_field& f, KEY k)
if (m.is_running()) m.set_focus();
#else
if (was == NULL) giochi.destroy(game);
return f.error_box("Modificare il movimento %ld", nreg);
return f.error_box(FR("Modificare il movimento %ld"), nreg);
#endif
}
}
@ -1407,9 +1406,9 @@ bool TGame_mask::edit_scadenza_handler(TMask_field& f, KEY k)
if (nreg != gm._numreg || nrata == 0)
{
if (nreg == 0)
f.error_box("Utilizzare la gestione extra-contabile");
f.error_box(TR("Utilizzare la gestione extra-contabile"));
else
f.error_box("Modificare il movimento %ld", nreg);
f.error_box(FR("Modificare il movimento %ld"), nreg);
if (was == NULL) giochi.destroy(game);
return FALSE;
}
@ -1837,7 +1836,7 @@ bool TGame_mask::edit_pagamento(TPartita& p, int nriga, int nrata, int nrigp) co
if (key == K_DEL)
{
const bool truly = yesno_box("Confermare l'eliminazione");
const bool truly = yesno_box(TR("Confermare l'eliminazione"));
if (!truly) key = K_ESC;
}
@ -1874,7 +1873,7 @@ bool TGame_mask::edit_pagamento(TPartita& p, int nriga, int nrata, int nrigp) co
// delete pm; pm = NULL; // commentata in quanto statica
#ifdef __EXTRA__
xvt_statbar_set("Estratto conto", TRUE);
xvt_statbar_set(TR("Estratto conto"), TRUE);
#endif
return key != K_ESC;
@ -1900,7 +1899,7 @@ bool TPrimanota_application::edit_partite(const TMask& m, int riga)
// Esci se il conto della riga cliente non e' valido
if (!b.ok() || !b.find())
return m.field(CG_SOTTOCONTO).error_box("Conto assente");
return m.field(CG_SOTTOCONTO).error_box(TR("Conto assente"));
// Aggiorna conto sulla riga contabile
b.add_to(cgs().row(riga), 3, 0x0);

View File

@ -122,7 +122,7 @@ bool TColor_mask::color_handler(TMask_field& f, KEY k)
bool TColor_mask::reset_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE && f.yesno_box("Si desidera azzerare tutti i colori?"))
if (k == K_SPACE && f.yesno_box(TR("Si desidera azzerare tutti i colori?")))
{
app().reset_colors();
TSheet_field& s = f.mask().sfield(101);
@ -148,20 +148,20 @@ TColor_mask::TColor_mask()
const char* const tipi = "TFSIDNAPRCGLKX";
const char* const desc[] =
{
"Tot. doc./sdo partite",
"Ritenute fiscali",
"Ritenute sociali",
"Generata (Imponibile)",
"IVA detraibile",
"IVA non detraibile",
"Abbuoni attivi",
"Abbuoni passivi",
"Ritenute professionali",
"Differenza cambi",
"Spese",
"Contropartita spese",
"Riga Cliente/Fornitore",
"Riga Collegata",
TR("Tot. doc./sdo partite"),
TR("Ritenute fiscali"),
TR("Ritenute sociali"),
TR("Generata (Imponibile)"),
TR("IVA detraibile"),
TR("IVA non detraibile"),
TR("Abbuoni attivi"),
TR("Abbuoni passivi"),
TR("Ritenute professionali"),
TR("Differenza cambi"),
TR("Spese"),
TR("Contropartita spese"),
TR("Riga Cliente/Fornitore"),
TR("Riga Collegata")
};
TPrimanota_application& a = app();
@ -173,7 +173,7 @@ TColor_mask::TColor_mask()
COLOR back, fore;
a.type2colors(*c, back, fore);
TToken_string& riga = s.row(-1);
riga << "Riga " << *c << " - " << desc[d];
riga << TR("Riga ") << *c << " - " << desc[d];
s.set_back_and_fore_color(back, fore, row++);
}
}

View File

@ -12,29 +12,6 @@
#include <causali.h>
TString& add_plural(TString& s, long num, const char* name)
{
const TFixed_string n(name);
const char last = n[n.len()-1];
if (num < 1)
{
s << "nessun";
if (toupper(last) == 'A' || toupper(n[0]) == 'Z' ||
toupper(n[0]) == 'S' && strchr("aeiouAEIOU", n[1]) == NULL)
s << tolower(last);
s << ' ' << name;
}
else
{
s << num << ' ' << name;
if (num > 1)
s[s.len()-1] = (last == 'a') ? 'e' : 'i';
}
return s;
}
class TProvvisori_msk : public TAutomask
{
char _provv; // Tipo provvisori da cancellare
@ -197,7 +174,7 @@ bool TProvvisori_msk::on_field_event(TOperable_field& o, TField_event e, long jo
{
// Non è carino lasciare vuote le date se non si seleziona nulla esplicitamente
if (get(F_TODATE).empty() && get(F_FROMDATE).empty() && get_long(F_SELECTED) == 0L)
return error_box("E' necessario specificare almeno una data");
return error_box(TR("E' necessario specificare almeno una data"));
}
break;
case DLG_SELECT:
@ -208,7 +185,7 @@ bool TProvvisori_msk::on_field_event(TOperable_field& o, TField_event e, long jo
TBrowse* br = efield(F_FROMREG).browse(); // Copia intestazione dal campo della maschera!
TToken_string head = br->head(); head.insert("@1|"); // Aggiunge prima colonna di selezione
TToken_string flds = br->items(); flds.insert(" |"); // Aggiunge prima colonna vuota
_sheet = new TCursor_sheet(&get_cursor(), flds, "Selezione", head, 0, 1);
_sheet = new TCursor_sheet(&get_cursor(), flds, TR("Selezione"), head, 0, 1);
}
if (_update_cursor) // Aggiorna filtri cursore se necessario
update_cursor();
@ -362,7 +339,7 @@ bool TProvvisori_app::confirm_provv(TCursor& cur, TProgind& pi, TCursor_sheet* s
}
if (err != NOERR)
return error_box("Errore nella conferma del movimento %ld", numreg);
return error_box(FR("Errore nella conferma del movimento %ld"), numreg);
}
return TRUE;
@ -390,7 +367,7 @@ bool TProvvisori_app::delete_provv(TCursor& cur, TProgind& pi, TCursor_sheet* sh
mov.put(MOV_NUMREG, numreg);
int err = mov.read(_isequal, _lock);
if (err != NOERR)
return error_box("Errore %d nel bloccare il record %ld", err, numreg);
return error_box(FR("Errore %d nel bloccare il record %ld"), err, numreg);
inizia_saldi(mov.curr());
@ -403,7 +380,7 @@ bool TProvvisori_app::delete_provv(TCursor& cur, TProgind& pi, TCursor_sheet* sh
aggiungi_saldi(rmov.curr(), TRUE);
err = rmov.remove();
if (err != NOERR)
error.format("riga contabile %d", rig);
error.format(FR("riga contabile %d"), rig);
}
for (rig = 1; err == NOERR; rig++)
{
@ -412,14 +389,14 @@ bool TProvvisori_app::delete_provv(TCursor& cur, TProgind& pi, TCursor_sheet* sh
if (rmoviva.read(_isequal, _lock) != NOERR) break;
err = rmov.remove();
if (err != NOERR)
error.format("riga IVA %d", rig);
error.format(FR("riga IVA %d"), rig);
}
if (err == NOERR)
{
err = mov.remove();
if (err != NOERR)
error = "testata";
error = TR("testata");
}
if (err == NOERR)
@ -427,10 +404,10 @@ bool TProvvisori_app::delete_provv(TCursor& cur, TProgind& pi, TCursor_sheet* sh
aggiorna_saldi();
pi.addstatus(1);
if (pi.iscancelled())
return warning_box("Procedura interrotta dall'utente");
return warning_box(TR("Procedura interrotta dall'utente"));
}
else
return error_box("Errore %d nella cancellazione della %s del movimento %ld",
return error_box(FR("Errore %d nella cancellazione della %s del movimento %ld"),
err, (const char*)error, numreg);
}
@ -440,7 +417,7 @@ bool TProvvisori_app::delete_provv(TCursor& cur, TProgind& pi, TCursor_sheet* sh
void TProvvisori_app::auto_delete(TCursor& cur)
{
const long total = cur.items();
TProgind pi(total, "Cancellazione movimenti provvisori", TRUE, TRUE);
TProgind pi(total, TR("Cancellazione movimenti provvisori"), TRUE, TRUE);
delete_provv(cur, pi);
}
@ -471,8 +448,8 @@ void TProvvisori_app::main_loop()
if (da < lp)
{
from_d = lp.string();
error_box("Il libro giornale e stato stampato il %s:\n"
"La data inizio elaborazione deve essere almeno il %s",
error_box(FR("Il libro giornale e stato stampato il %s:\n"
"La data inizio elaborazione deve essere almeno il %s"),
(const char*)from_d, (const char*)from_d);
m.set(F_FROMDATE, from_d);
continue;
@ -484,15 +461,18 @@ void TProvvisori_app::main_loop()
const long total = m.get_long(F_SELECTED);
if (total <= 0)
{
warning_box("Nessun movimento selezionato");
warning_box(TR("Nessun movimento selezionato"));
continue;
}
TString action(key == K_ENTER ? "conferma" : "cancellazione");
action << " di "; add_plural(action, total, "movimento");
TString action;
if (key == K_ENTER)
action.format(FR("Conferma di %ld movimenti."), total);
else
action.format(FR("Cancellazione di %ld movimenti."), total);
TString caption;
caption << "E' stata richiesta la " << action << ".\nSi desidera continuare?";
caption << action << TR("\nSi desidera continuare?");
if (!yesno_box(caption))
continue;
@ -509,6 +489,6 @@ void TProvvisori_app::main_loop()
int cg2200(int argc, char** argv)
{
TProvvisori_app a;
a.run(argc, argv, "Gestione provvisori");
a.run(argc, argv, TR("Gestione provvisori"));
return 0;
}