inizio lavoro per traduzione interfacce e messaggi di debug
cosa lunghissima
This commit is contained in:
52
bananaSPLIT/UserInterface/resources/translations/guimain.ts
Normal file
52
bananaSPLIT/UserInterface/resources/translations/guimain.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en" sourcelanguage="it_IT">
|
||||
<context>
|
||||
<name>@default</name>
|
||||
<message>
|
||||
<location filename="../../../guimain.py" line="41"/>
|
||||
<source>Impostazioni Titolo</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../guimain.py" line="42"/>
|
||||
<source>Selezione Output</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../guimain.py" line="87"/>
|
||||
<source>MainWindow: Configurazione non accettata</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../guimain.py" line="107"/>
|
||||
<source>Prossima Tab</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../guimain.py" line="112"/>
|
||||
<source>Tab Precedente</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../guimain.py" line="116"/>
|
||||
<source>Apri Carica Preset</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../guimain.py" line="117"/>
|
||||
<source>Carica Preset</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../guimain.py" line="126"/>
|
||||
<source>Riempio tutte le tab</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../guimain.py" line="131"/>
|
||||
<source>Apri Salva Preset</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "v1.3",
|
||||
"version": "v1.4",
|
||||
"paths": {
|
||||
"lastUsed": "defaults.json",
|
||||
"configurationPath": "./conf/",
|
||||
@@ -36,6 +36,7 @@
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"uiLang": "it",
|
||||
"winW": 800,
|
||||
"winH": 700,
|
||||
"encoding": "windows-1252",
|
||||
|
||||
@@ -38,8 +38,8 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
||||
|
||||
|
||||
#popola le tab con le finestre giuste
|
||||
self.ui.wgt_main.addTab(self.titolo, "Impostazioni Titolo")
|
||||
self.ui.wgt_main.addTab(self.selezout, "Selezione Output")
|
||||
self.ui.wgt_main.addTab(self.titolo, tr("Impostazioni Titolo"))
|
||||
self.ui.wgt_main.addTab(self.selezout, tr("Selezione Output"))
|
||||
|
||||
# connetti bottoni avanti
|
||||
self.ui.btn_avanti.clicked.connect(self.nextTab)
|
||||
@@ -84,7 +84,7 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
||||
self.ui.rad_fileOld.setChecked(not self.conf.getParam('docStruct', 'fileVersNew'))
|
||||
self.fillFileList()
|
||||
except:
|
||||
self.log.critical("MainWindow: Configurazione non accettata")
|
||||
self.log.critical(tr("MainWindow: Configurazione non accettata"))
|
||||
|
||||
def fillAllInterfaces(self):
|
||||
self.fillInterface()
|
||||
@@ -104,32 +104,31 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
||||
|
||||
def nextTab(self):
|
||||
self.ui.wgt_main.setCurrentIndex(self.ui.wgt_main.currentIndex()+1)
|
||||
self.logger.debug("Prossima Tab")
|
||||
self.logger.debug(tr("Prossima Tab"))
|
||||
pass
|
||||
|
||||
def prevTab(self):
|
||||
self.ui.wgt_main.setCurrentIndex(self.ui.wgt_main.currentIndex()-1)
|
||||
self.logger.debug("Tab Precedente")
|
||||
self.logger.debug(tr("Tab Precedente"))
|
||||
pass
|
||||
|
||||
def openLoadPreset(self):
|
||||
self.logger.debug("Apri Carica Preset")
|
||||
lf = PyQt5.QtWidgets.QFileDialog(self,"Carica Preset",self.conf.getParam('paths', 'configurationPath'))
|
||||
self.logger.debug(tr("Apri Carica Preset"))
|
||||
lf = PyQt5.QtWidgets.QFileDialog(self,tr("Carica Preset"),self.conf.getParam('paths', 'configurationPath'))
|
||||
lf.setAcceptMode(PyQt5.QtWidgets.QFileDialog.AcceptOpen)
|
||||
lf.setFileMode(PyQt5.QtWidgets.QFileDialog.ExistingFile)
|
||||
lf.setNameFilter("bananaCONF (*.json)")
|
||||
if lf.exec():
|
||||
cf = str(lf.selectedFiles()[0].split('/')[-1])
|
||||
self.logger.info("Apro la configurazione: {}".format(cf))
|
||||
self.logger.info(tr(f"Apro la configurazione: {cf}"))
|
||||
self.conf.open()
|
||||
self.conf.use(cf)
|
||||
self.logger.debug("Riempio tutte le tab")
|
||||
self.logger.debug(tr("Riempio tutte le tab"))
|
||||
self.fillAllInterfaces()
|
||||
pass
|
||||
|
||||
def openSavePreset(self):
|
||||
self.logger.debug("Apri Salva Preset")
|
||||
self.logger.debug("Forzo applica a tutte le tab")
|
||||
self.logger.debug(tr("Apri Salva Preset"))
|
||||
self.applicaTutto()
|
||||
sf = PyQt5.QtWidgets.QFileDialog(self,"Salva Preset",self.conf.getParam('paths', 'configurationPath'))
|
||||
sf.setAcceptMode(PyQt5.QtWidgets.QFileDialog.AcceptSave)
|
||||
@@ -144,7 +143,7 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
||||
self.conf.save(fName="defaults.json")
|
||||
self.conf.use(prev)
|
||||
##
|
||||
self.logger.debug("Scrivo la configurazione: {}".format(rv))
|
||||
self.logger.debug(tr(f"Scrivo la configurazione: {rv}"))
|
||||
self.conf.save(fName=rv)
|
||||
pass
|
||||
|
||||
@@ -569,7 +568,6 @@ if __name__ == '__main__':
|
||||
app = PyQt5.QtWidgets.QApplication(sys.argv)
|
||||
sys.excepthook = except_hook
|
||||
|
||||
|
||||
try:
|
||||
LOGGER = fancyLogger(filepath=r"./conf/loggerconf.json",fileLog=False)
|
||||
conf = bananaCONF(workdir=r"./conf", logger=LOGGER)
|
||||
@@ -577,9 +575,11 @@ if __name__ == '__main__':
|
||||
conf.use("defaults.json")
|
||||
conf.use(conf.getParam('paths', 'lastUsed'))
|
||||
|
||||
#t = QTranslator()
|
||||
#t.load(":/translations/mainwindow.qm")
|
||||
#app.installTranslator(t)
|
||||
iflan = conf.getParam('settings','uiLang')
|
||||
if iflan != 'it':
|
||||
t = QTranslator()
|
||||
t.load(f":/tr/translations/mainwindow_{iflan}.qm")
|
||||
app.installTranslator(t)
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
Reference in New Issue
Block a user