Added italian translation

This commit is contained in:
Filippo Bedendo Bordon 2011-11-07 17:33:46 +01:00
parent 4a4b4f2205
commit 3de8c4ba76
2 changed files with 27 additions and 25 deletions

View File

@ -3,6 +3,8 @@
from gui import * # Importa la parte grafica
import gettext
from subprocess import Popen
# La parte di dbus
import gobject
@ -11,7 +13,8 @@ import dbus.service
from dbus.mainloop.glib import DBusGMainLoop
if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
import dbus.glib
gettext.install('usbinstall', '/usr/share/locale', unicode=1)
# Variabili globali
passo = 1
@ -43,7 +46,7 @@ def avanti():
if passo == 1:
if path_Boot == "":
msg_warn("E' necessario scegliere un file per il boot")
msg_warn(_("A file .cpio is required"))
return
else:
passo += 1
@ -51,7 +54,7 @@ def avanti():
elif passo == 2:
if path_Iso == "":
msg_warn("E' necessario scegliere un file immagine di openmamba")
msg_warn(_("An openmamba's iso is required"))
return
else:
passo += 1
@ -59,10 +62,10 @@ def avanti():
elif passo == 3:
if sel_usb_file == "":
msg_warn("E' necessario scegliere una chiavetta per l'installazione")
msg_warn(_("You must choose a usb key"))
return
else:
msg = QtGui.QMessageBox.question(None, "Attenzione", "Tutti i dati presenti nella chiavetta " + sel_usb_nome + " saranno persi.\n"+"Sei sicuro di voler continuare?",
msg = QtGui.QMessageBox.question(None, _("Attention"), _("All data on the key ") + sel_usb_nome + _(" will be lost. \n")+_("Are you sure to continue?"),
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes)
# Continua solo se l'utente preme il bottone Yes
if msg == QtGui.QMessageBox.Yes:
@ -80,7 +83,7 @@ def indietro():
if passo == 0:
app.exit(1)
print "Applicazione terminata premendo il bottone annulla"
print _("Application terminated by pressing \"cancel\" button")
elif passo == 1:
passo1()
@ -98,12 +101,12 @@ def apri_file():
global path_Boot, path_Iso, ext
if ext == "boot":
fileType = QtCore.QString("cpio *.cpio.gz")
nfileName = QtGui.QFileDialog.getOpenFileName(None, "Scegli il file di boot da usare nell'installazione", "~", "File .cpio.gz (*.cpio.gz)", fileType)
nfileName = QtGui.QFileDialog.getOpenFileName(None, _("Choose the boot file"), "~", "File .cpio.gz (*.cpio.gz)", fileType)
path_Boot = nfileName
ui.t_file.setText(QtGui.QApplication.translate("Dialog", nfileName, None, QtGui.QApplication.UnicodeUTF8))
elif ext == "iso":
fileType = QtCore.QString("iso *.iso")
nfileName = QtGui.QFileDialog.getOpenFileName(None, "Scegli l'iso da usare nell'installazione", "~", "File .iso (*.iso)", fileType) #26/10 path_Boot -> "~"
nfileName = QtGui.QFileDialog.getOpenFileName(None, _("Choose the iso file"), "~", "File .iso (*.iso)", fileType) #26/10 path_Boot -> "~"
path_Iso = nfileName
ui.t_file.setText(QtGui.QApplication.translate("Dialog", nfileName, None, QtGui.QApplication.UnicodeUTF8))
@ -113,11 +116,12 @@ def gestisci_nuvola():
global passo
# Aiuto in base al passo corrente
if passo == 1:
aiuto = "Questo archivio ha lo scopo di rendere la chiavetta bootabile." " Il file in questione è reperibile <a style=\"color: green; \"href=\"http://www.openmamba.org/distribution/media/bootusb.html?lang=it\">qui</a>"
aiuto = _("This archive is designed to make the usb bootable.") + _(" You can find this file <a style=\"color: green; \"href=\"http://www.openmamba.org/distribution/media/bootusb.html?lang=en\">here</a>")
# Cambiata anche la lingua della pagina (lang=en)
elif passo == 2:
aiuto = "L'iso è il file contente il sistema operativo. E' possibile scaricarlo da <a style=\"color: green; \"href=\"http://www.openmamba.org/distribution/download.html\">questo</a> indirizzo"
aiuto = _("The file .iso contains the operating system. You can download it from <a style=\"color: green; \"href=\"http://www.openmamba.org/distribution/download.html?lang=en\">here</a>")
elif passo == 3:
aiuto = "Selezionare la chiavetta in cui verrà installato openmamba. <span style=\"color:red;\">Tutti i dati contenuti nella chiavetta andranno persi</span>"
aiuto = _("Choose an usb key for the installation. <span style=\"color:red;\">All data will be lost</span>")
ui.n_testo.setText(QtGui.QApplication.translate("Dialog", aiuto, None, QtGui.QApplication.UnicodeUTF8))
ui.n_img.show() # Immagine della nuvola
ui.n_testo.show() # Testo della nuvola
@ -160,12 +164,12 @@ def lista_usb():
if len(usb_file) != 0:
seleziona_usb(0)
else:
print "Nessuna chiavetta usb disponibile"
print _("No usb available > 1 Gb")
## Abbreviazione di un warning
def msg_warn(testo):
msg = QtGui.QMessageBox.warning(None, "Attenzione", testo)
msg = QtGui.QMessageBox.warning(None, _("Attention"), testo)
## Aggiorna gli oggetti al cambio del passo
def aggiorna_oggetti(immagine, titolo, descrizione):
@ -192,7 +196,7 @@ def aggiorna_oggetti(immagine, titolo, descrizione):
if passo == 1:
ext = "boot"
path_Boot = ""
ui.b_indietro.setText(QtGui.QApplication.translate("Dialog", "Annulla", None, QtGui.QApplication.UnicodeUTF8))
ui.b_indietro.setText(QtGui.QApplication.translate("Dialog", _("Cancel"), None, QtGui.QApplication.UnicodeUTF8))
# Visualizzo gli oggetti del passo 1
visualizza_scegli_file()
# Chiudi la nuovola dell'help al cambio di passo
@ -200,7 +204,7 @@ def aggiorna_oggetti(immagine, titolo, descrizione):
elif passo == 2:
ext = "iso"
path_Iso = ""
ui.b_indietro.setText(QtGui.QApplication.translate("Dialog", "Indietro", None, QtGui.QApplication.UnicodeUTF8))
ui.b_indietro.setText(QtGui.QApplication.translate("Dialog", _("Go back"), None, QtGui.QApplication.UnicodeUTF8))
visualizza_scegli_file()
# Chiudi la nuovola dell'help al cambio di passo
chiudi_nuvola()
@ -230,19 +234,19 @@ def seleziona_usb(i):
def passo1():
aggiorna_oggetti("img/back1.png", "Passo 1/4 - scelta del file di boot", "Scegli l\'archivio .cpio per il boot")
aggiorna_oggetti("img/back1.png", _("Step 1/4 - choice the boot file"), _("Choose the .cpio file"))
def passo2():
aggiorna_oggetti("img/back2.png", "Passo 2/4 - scelta del file iso", "Scegli il file iso di openmamba")
aggiorna_oggetti("img/back2.png", _("Step 2/4 - choice the iso file"), _("Choose the openmamba .iso file"))
def passo3():
aggiorna_oggetti("img/back3.png", "Passo 3/4 - scelta della chiavetta", "Scegli la chiavetta usb")
aggiorna_oggetti("img/back3.png", _("Step 3/4 - choice of usb key"), _("Choose the usb key"))
def passo4():
global p
aggiorna_oggetti("img/back4.png", "Passo 4/4 - installazione di openmamba su usb", "Installazione in corso...")
aggiorna_oggetti("img/back4.png", _("Step 4/4 - installation of openmamba to usb"), _("Installation in progress..."))
# Nasconde gli oggetti superflui:
ui.b_help.hide()
@ -253,7 +257,7 @@ def passo4():
ui.p_installazione.show()
init_ascolto()
p = Popen(["./usbinstall.sh", "start", sel_usb_file, path_Boot, path_Iso])
print "Processo di installazione avviato"
print _("Installation process started")
def init_ascolto():
@ -292,8 +296,7 @@ def closeEvent(form, event):
def installazione_terminata():
global p
print "Installazione terminata"
msg = QtGui.QMessageBox.information(None, "Informazione", "Installazione terminata correttamente")
msg = QtGui.QMessageBox.information(None, _("Information"), _("Installation process completed"))
p.terminate()
mainloop.quit()
app.exit(0)
@ -308,7 +311,7 @@ mainloop = gobject.MainLoop()
def run():
assegna_eventi()
passo1()
ui.b_avanti.setText(QtGui.QApplication.translate("Dialog", _("Go on"), None, QtGui.QApplication.UnicodeUTF8))
Dialog.show() # Mostra il dialog precedentemente creato
return app.exec_()

View File

@ -73,8 +73,7 @@ inst_dir_umount()
# So it attend up to umount return without errors
while [ 1 ] ; do
sleep 1
sudo umount ${1}1
sudo umount ${1}
if [ $? != 1 ]; then
break
fi