From b35a471b75d4ae8ba72758a3ab669ae5668977b1 Mon Sep 17 00:00:00 2001 From: Emanuele Date: Fri, 10 Apr 2020 12:19:34 +0200 Subject: [PATCH] aggiornati script anche per tradurre messaggi python --- .../UserInterface/compiledUI/mainwindow.py | 2 +- bananaSPLIT/UserInterface/mainwindow.ui | 2 +- .../UserInterface/resources/resources.qrc | 9 + .../resources/translations/guimain_en.qm | 1 + .../resources/translations/guimain_en.ts | 161 ++++++++++++++++++ .../resources/translations/libconfload_en.qm | 1 + .../resources/translations/libconfload_en.ts | 67 ++++++++ .../resources/translations/libsplit_en.qm | 1 + .../resources/translations/libsplit_en.ts | 156 +++++++++++++++++ .../resources/translations/mainwindow_en.ts | 2 +- bananaSPLIT/scripts/releaseLanguages.py | 1 - bananaSPLIT/scripts/updateLanguages.py | 4 + 12 files changed, 403 insertions(+), 4 deletions(-) create mode 100644 bananaSPLIT/UserInterface/resources/translations/guimain_en.qm create mode 100644 bananaSPLIT/UserInterface/resources/translations/guimain_en.ts create mode 100644 bananaSPLIT/UserInterface/resources/translations/libconfload_en.qm create mode 100644 bananaSPLIT/UserInterface/resources/translations/libconfload_en.ts create mode 100644 bananaSPLIT/UserInterface/resources/translations/libsplit_en.qm create mode 100644 bananaSPLIT/UserInterface/resources/translations/libsplit_en.ts diff --git a/bananaSPLIT/UserInterface/compiledUI/mainwindow.py b/bananaSPLIT/UserInterface/compiledUI/mainwindow.py index 2f7fea9..cfc3758 100644 --- a/bananaSPLIT/UserInterface/compiledUI/mainwindow.py +++ b/bananaSPLIT/UserInterface/compiledUI/mainwindow.py @@ -285,7 +285,7 @@ class Ui_mainwin(object): self.txt_log.setHtml(_translate("mainwin", "\n" "\n" +"\n" "


")) self.btn_cartellasorg.setText(_translate("mainwin", "-> ")) self.btn_cartelladest.setText(_translate("mainwin", "-> ")) diff --git a/bananaSPLIT/UserInterface/mainwindow.ui b/bananaSPLIT/UserInterface/mainwindow.ui index ef2ba74..5fa4c44 100644 --- a/bananaSPLIT/UserInterface/mainwindow.ui +++ b/bananaSPLIT/UserInterface/mainwindow.ui @@ -149,7 +149,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:6.6pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:7.8pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:7pt;"><br /></p></body></html> diff --git a/bananaSPLIT/UserInterface/resources/resources.qrc b/bananaSPLIT/UserInterface/resources/resources.qrc index 85ce64a..d0efe2b 100644 --- a/bananaSPLIT/UserInterface/resources/resources.qrc +++ b/bananaSPLIT/UserInterface/resources/resources.qrc @@ -19,5 +19,14 @@ translations/mainwindow_en.qm + translations/about_en.qm + translations/advopt_en.qm + translations/avanzatetitolo_en.qm + translations/avanzatetitolo2_en.qm + translations/avanzatetitolo3_en.qm + translations/guimain.qm + translations/mainwindow_en.qm + translations/selezout_en.qm + translations/titolow_en.qm diff --git a/bananaSPLIT/UserInterface/resources/translations/guimain_en.qm b/bananaSPLIT/UserInterface/resources/translations/guimain_en.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/bananaSPLIT/UserInterface/resources/translations/guimain_en.qm @@ -0,0 +1 @@ +<¸dÊÍ!¿`¡½Ý \ No newline at end of file diff --git a/bananaSPLIT/UserInterface/resources/translations/guimain_en.ts b/bananaSPLIT/UserInterface/resources/translations/guimain_en.ts new file mode 100644 index 0000000..3285190 --- /dev/null +++ b/bananaSPLIT/UserInterface/resources/translations/guimain_en.ts @@ -0,0 +1,161 @@ + + + + @default + + + Impostazioni Titolo + + + + + Selezione Output + + + + + MainWindow: Configurazione non accettata + + + + + Prossima Tab + + + + + Tab Precedente + + + + + Apri Carica Preset + + + + + Carica Preset + + + + + Riempio tutte le tab + + + + + Apri Salva Preset + + + + + Apri Opzioni Avanzate + + + + + Apri Opzioni Lingua + + + + + Apri Finestra About + + + + + Seleziona Cartella Sorgente + + + + + Selezionata Cartella Sorgente: {} + + + + + Seleziona Cartella Destinazione + + + + + Selezionata Cartella Destinazione: {} + + + + + Apro in directory: {} + + + + + Titolo: Configurazione non accettata + + + + + Mostro la finestra avanzate titolo + + + + + Applico impostazioni Titolo + + + + + AvanzateTitolo: Configurazione non accettata + + + + + Avanzate Titolo Accettate + + + + + Avanzate Titolo Rifiutate + + + + + SelezUscita: Configurazione non accettata + + + + + Applico Impostazioni File Uscita + + + + + Sto SPLITTANDO, attendi.. + + + + + Sto Splittando.. + + + + + FINITO! + + + + + AdvancedOptions: Configurazione non accettata + + + + + Avanzate Globali + + + + + Parametri inseriti validi, configurazione accettata + + + + diff --git a/bananaSPLIT/UserInterface/resources/translations/libconfload_en.qm b/bananaSPLIT/UserInterface/resources/translations/libconfload_en.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/bananaSPLIT/UserInterface/resources/translations/libconfload_en.qm @@ -0,0 +1 @@ +<¸dÊÍ!¿`¡½Ý \ No newline at end of file diff --git a/bananaSPLIT/UserInterface/resources/translations/libconfload_en.ts b/bananaSPLIT/UserInterface/resources/translations/libconfload_en.ts new file mode 100644 index 0000000..1098b28 --- /dev/null +++ b/bananaSPLIT/UserInterface/resources/translations/libconfload_en.ts @@ -0,0 +1,67 @@ + + + + @default + + + Cerco le configurazioni in: [{}] + + + + + Non mi e' stata fornita una directory per i file di configurazione + + + + + Carico i file di configurazione + + + + + Caricato correttamente: {} + + + + + Impossibile leggere la configurazione:{} + Controlla il file a riga: {} e colonna:{} + + + + + Impossibile aprire il file: {} + + + + + Eccezione inaspettata: {} + + + + + Non ho trovato alcun file di configurazione! + + + + + Salvo la configurazione: {} + + + + + Impossibile salvare il file: {} - [{}] + + + + + Errore imprevisto nella scrittura del file: {} + + + + + Parametro di configurazione non valido! [{}] + + + + diff --git a/bananaSPLIT/UserInterface/resources/translations/libsplit_en.qm b/bananaSPLIT/UserInterface/resources/translations/libsplit_en.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/bananaSPLIT/UserInterface/resources/translations/libsplit_en.qm @@ -0,0 +1 @@ +<¸dÊÍ!¿`¡½Ý \ No newline at end of file diff --git a/bananaSPLIT/UserInterface/resources/translations/libsplit_en.ts b/bananaSPLIT/UserInterface/resources/translations/libsplit_en.ts new file mode 100644 index 0000000..db62e4b --- /dev/null +++ b/bananaSPLIT/UserInterface/resources/translations/libsplit_en.ts @@ -0,0 +1,156 @@ + + + + @default + + + Sto operando sul file: {}.. + + + + + Non e' stato fornito il nome di alcun file da splittare! + + + + + Nuovo SPLITTER su file: {} + + + + + Controllo se ci sono dei duplicati.. + + + + + Salto il controllo dei duplicati.. + + + + + Non posso sovrascrivere i vecchi file, eliminali manualmente! + + + + + L'elaborazione del file ha richiesto {:4.2f} sec + + + + + Il file [{}] contiene caratteri non compatibili con la codifica scelta! [{}] + + + + + Carico il contenuto.. + + + + + Impossibile aprire il file: {}! [{}] + + + + + Elimino righe vuote e caratteri inutili.. + + + + + Errore inaspettato durante l'eliminazione delle righe vuote! + + + + + Individuo il contenuto.. + + + + + Ho trovato una riga ambigua.. potrebbe essere una data ma non so: [{}] + + + + + E' successo qualcosa mentre stavo cercando il nome della pubblicazione,controlla i file di uscita! [{}] + + + + + Errore inaspettato, contatta il tuo sviluppatore di fiducia! + + + + + Ho individuato una separatore valido prima che si chiusesse l'articolo precedente, controlla i tuoi file in uscita! +L'errore dovrebbe essere intorno all'articolo {} ma non sono sicuro! +[{}] + + + + + Stato Interno Sconosciuto + + + + + Nel file ho trovato {0} articoli.. + + + + + Attentione, LexisNexis ne ha saltati {} !!! + + + + + Il conto dei documenti non torna! LexisNexis ne ha saltato qualcuno! + Precedente:{0}-Attuale:{1} + + + + + Ho individuato una separatore valido prima che si chiusesse l'articolo precedente, controlla i tuoi file in uscita! +L'errore dovrebbe essere intorno all'articolo {} ma non sono sicuro! +[{}] + + + + + Duplicato: {} + + + + + Ho rimosso {} duplicati di {} articoli.. + + + + + Salvo gli articoli in file separati... + + + + + Persorso: {0} + + + + + Qualcosa e' andato storto, non riesco a scrivere il file: {} + + + + + Ho salvato meno file rispetto a quelli trovati! + + + + + Salvo gli articoli in un singolo file vicino agli originali... + + + + diff --git a/bananaSPLIT/UserInterface/resources/translations/mainwindow_en.ts b/bananaSPLIT/UserInterface/resources/translations/mainwindow_en.ts index fd10b12..5f7596f 100644 --- a/bananaSPLIT/UserInterface/resources/translations/mainwindow_en.ts +++ b/bananaSPLIT/UserInterface/resources/translations/mainwindow_en.ts @@ -30,7 +30,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:6.6pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:7.8pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:7pt;"><br /></p></body></html> diff --git a/bananaSPLIT/scripts/releaseLanguages.py b/bananaSPLIT/scripts/releaseLanguages.py index 643870e..ac66f34 100644 --- a/bananaSPLIT/scripts/releaseLanguages.py +++ b/bananaSPLIT/scripts/releaseLanguages.py @@ -5,7 +5,6 @@ Created on 10 apr 2020 ''' import os,glob import subprocess -langs = ["en"] if __name__ == '__main__': tsfiles = glob.glob("..\\UserInterface\\resources\\translations\\*.ts") diff --git a/bananaSPLIT/scripts/updateLanguages.py b/bananaSPLIT/scripts/updateLanguages.py index d6b6b1d..b882e7e 100644 --- a/bananaSPLIT/scripts/updateLanguages.py +++ b/bananaSPLIT/scripts/updateLanguages.py @@ -9,8 +9,12 @@ langs = ["en"] if __name__ == '__main__': uifiles = glob.glob("..\\*\\*.ui", recursive=True) + pyfiles = ['..\\guimain.py','..\\libbananasplit\\libsplit.py','..\\libbananasplit\\libconfload.py'] for l in langs: for ui in uifiles: uio = "..\\UserInterface\\resources\\translations\\"+os.path.splitext((os.path.split(ui)[1]))[0]+f"_{l}.ts" subprocess.run(f'lupdate.exe {ui} -ts {uio}') + for py in pyfiles: + pyo = "..\\UserInterface\\resources\\translations\\"+os.path.splitext((os.path.split(py)[1]))[0]+f"_{l}.ts" + print(subprocess.run(f'pylupdate5.exe {py} -ts {pyo}')) pass \ No newline at end of file