Changeset 4473


Ignore:
Timestamp:
Apr 26, 2017, 6:20:40 PM (2 years ago)
Author:
Juanma
Message:

WIP on locale

Location:
lliurex-remote-installer/trunk/fuentes
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • lliurex-remote-installer/trunk/fuentes/lliurex-po/generate_po.sh

    r4465 r4473  
    44UI_FILES="../lliurex-remote-installer-gui.install/usr/share/lliurex-remote-installer/lliurex-remote-installer.ui"
    55
    6 mkdir -p lliurex-remote-installer/
     6mkdir -p lliurex-remote-installer-gui/
    77
    8 xgettext $UI_FILES $PYTHON_FILES -o lliurex-remote-installer/lliurex-remote-installer.pot
     8xgettext $UI_FILES $PYTHON_FILES -o lliurex-remote-installer-gui/lliurex-remote-installer-gui.pot
    99
    1010
  • lliurex-remote-installer/trunk/fuentes/lliurex-remote-installer-gui.install/usr/share/lliurex-remote-installer/AptBox.py

    r4050 r4473  
    1212import sys
    1313
     14gettext.textdomain('lliurex-remote-installer-gui')
    1415_=gettext.gettext
    1516
     
    2728               
    2829                builder=Gtk.Builder()
     30                builder.set_translation_domain('lliurex-remote-installer-gui')
    2931                ui_path=RSRC + "lliurex-remote-installer.ui"
    3032
     
    411413               
    412414                main_window=self.core.lri.main_window
    413                 dialog=Dialog.ApplyingChangesDialog(main_window,"Lliurex Remote installer","Updating repositories and testing packages...")
     415                dialog=Dialog.ApplyingChangesDialog(main_window,"Lliurex Remote installer",_(u"Updating repositories and testing packages..."))
    414416                dialog.show()
    415417                GLib.timeout_add(500,self.check_apply_thread,dialog)
     
    432434                        self.core.var=copy.deepcopy(self.core.current_var)
    433435                        self.test_apt=self.core.n4d.test_apt_list(self.core.var)
    434                         self.thread_ret={"status":True,"msg":"SE HA ROTO"}
     436                        self.thread_ret={"status":True,"msg":"BROKEN"}
    435437       
    436438                        # store return value here
     
    466468                        self.core.dprint("Done")
    467469                else:
    468                         self.core.dprint("Error en el test, no se guarda la variable")
     470                        self.core.dprint("Test Error: variable remains unset")
    469471               
    470472               
     
    480482                if not self.thread_ret["status"]:
    481483                        mw=self.core.lri.main_window
    482                         d=Dialog.ErrorDialog(mw,"asdasd",self.thread_ret["msg"])
     484                        d=Dialog.ErrorDialog(mw,"",self.thread_ret["msg"])
    483485                        d.run()
    484486                        d.destroy()
     
    499501                main_window=self.core.lri.main_window
    500502               
    501                 dialog=Dialog.QuestionDialog(main_window,"Delete apt list","Do you want to delete '%s' packages list?"%pkg_name)
     503                dialog=Dialog.QuestionDialog(main_window,_(u"Delete apt list"),_(u"Do you want to delete '%s' packages list?")%pkg_name)
    502504                response=dialog.run()
    503505                dialog.destroy()
     
    514516                main_window=self.core.lri.main_window
    515517                pkg_name='\n'.join(pkg_name_orig)
    516                 dialog=Dialog.QuestionDialog(main_window,"Delete apt list","This pakage list is unavaiable from your repos:\n%s\nDo you want delete it?"%pkg_name)
     518                dialog=Dialog.QuestionDialog(main_window,_(u"Delete apt list"),_(u"This pakage list is unavaiable from your repos:\n%s\nDo you want delete it?")%pkg_name)
    517519                response=dialog.run()
    518520                dialog.destroy()
     
    528530               
    529531                main_window=self.core.lri.main_window
    530                 dialog=Dialog.QuestionDialog(main_window,"Delete package","Do you want to delete '%s'?"%pkg_name)
     532                dialog=Dialog.QuestionDialog(main_window,_(u"Delete package"),_(u"Do you want to delete '%s'?")%pkg_name)
    531533                response=dialog.run()
    532534                dialog.destroy()
     
    543545                main_window=self.core.lri.main_window
    544546               
    545                 dialog=Dialog.QuestionDialog(main_window,"Changes detected","There are unsaved changes. Do you want to discard them?")
     547                dialog=Dialog.QuestionDialog(main_window,_(u"Changes detected"),_(u"There are unsaved changes. Do you want to discard them?"))
    546548                response=dialog.run()
    547549                dialog.destroy()
  • lliurex-remote-installer/trunk/fuentes/lliurex-remote-installer-gui.install/usr/share/lliurex-remote-installer/DebBox.py

    r4058 r4473  
    1313import os
    1414
     15gettext.textdomain('lliurex-remote-installer-gui')
    1516_=gettext.gettext
    1617
     
    2930               
    3031                builder=Gtk.Builder()
     32                builder.set_translation_domain('lliurex-remote-installer-gui')
    3133                ui_path=RSRC + "lliurex-remote-installer.ui"
    3234                builder.add_from_file(ui_path)
     
    136138                path=self.check_user_desktop()
    137139                #print path
    138                 fcb=Dialog.FileDialog(self.core.lri.main_window,"Please choose a file", path)
     140                fcb=Dialog.FileDialog(self.core.lri.main_window,_(u"Please choose a file"), path)
    139141                response=fcb.run()
    140142               
     
    252254                                       
    253255                                        main_window=self.core.lri.main_window
    254                                         dialog=Dialog.ApplyingChangesDialog(main_window,title="Lliurex Remote Installer",msg="Deleting files.......")
     256                                        dialog=Dialog.ApplyingChangesDialog(main_window,title="Lliurex Remote Installer",msg=_(u"Deleting files......."))
    255257                                        dialog.show()
    256258                                        GLib.timeout_add(500,self.check_delete_thread,dialog)
     
    269271                        self.deleted=self.core.n4d.remove_file(url_dest)
    270272                        if not self.deleted[0]:
    271                                 comment="The file %s cannot be deleted"%pkg
     273                                comment=_(u"The file %s cannot be deleted")%pkg
    272274                                self.remove_file_info_dialog(comment)
    273275                               
    274                         self.thread_ret={"status":True,"msg":"SE HA ROTO"}
     276                        self.thread_ret={"status":True,"msg":"BROKEN"}
    275277                       
    276278                except Exception as e:
     
    309311               
    310312                #Se crea el mensaje de Apply segun si sse suben ficheros o no.
    311                 self.msg1="Applying changes......."
     313                self.msg1=_(u"Applying changes.......")
    312314                if  self.new_debs not in [None,"",[]]:
    313                         self.msg1="Updating files and applying changes......."
     315                        self.msg1=_(u"Updating files and applying changes.......")
    314316                else:
    315                         self.msg1="Applying changes......."
     317                        self.msg1=_(u"Applying changes.......")
    316318               
    317319                main_window=self.core.lri.main_window
     
    345347                        self.core.var=copy.deepcopy(self.core.current_var)
    346348                        self.test_deb=self.core.n4d.test_deb_list(self.core.var)
    347                         self.thread_ret={"status":True,"msg":"SE HA ROTO"}
     349                        self.thread_ret={"status":True,"msg":"BROKEN"}
    348350
    349351                       
     
    384386                if not self.thread_ret["status"]:
    385387                        mw=self.core.lri.main_window
    386                         d=Dialog.ErrorDialog(mw,"asdasd",self.thread_ret["msg"])
     388                        d=Dialog.ErrorDialog(mw,"",self.thread_ret["msg"])
    387389                        d.run()
    388390                        d.destroy()
     
    402404               
    403405                main_window=self.core.lri.main_window
    404                 dialog=Dialog.ErrorDialog(main_window,"Error in Extension","This %s package has not the extension required.\nPlease only DEB packages in this list."%pkg_name)
     406                dialog=Dialog.ErrorDialog(main_window,_(u"Error in Extension"),_(u"This %s package has not the extension required.\nPlease only DEB packages in this list.")%pkg_name)
    405407                response=dialog.run()
    406408                dialog.destroy()
     
    415417               
    416418                main_window=self.core.lri.main_window
    417                 dialog=Dialog.QuestionDialog(main_window,"Delete package","Do you want to delete '%s'?"%pkg_name)
     419                dialog=Dialog.QuestionDialog(main_window,_(u"Delete package"),_(u"Do you want to delete '%s'?")%pkg_name)
    418420                response=dialog.run()
    419421                dialog.destroy()
     
    429431               
    430432                main_window=self.core.lri.main_window
    431                 dialog=Dialog.QuestionDialog(main_window,"Delete package","IMPORTANT\nDo you want to delete this DEB from your server?\n'%s'"%pkg_name)
     433                dialog=Dialog.QuestionDialog(main_window,_(u"Delete package"),_(u"IMPORTANT\nDo you want to delete this DEB from your server?\n'%s'")%pkg_name)
    432434                response=dialog.run()
    433435                dialog.destroy()
     
    443445               
    444446                main_window=self.core.lri.main_window
    445                 dialog=Dialog.ErrorDialog(main_window,"Delete package",comment)
     447                dialog=Dialog.ErrorDialog(main_window,_(u"Delete package"),comment)
    446448                response=dialog.run()
    447449                dialog.destroy()
     
    454456               
    455457                main_window=self.core.lri.main_window
    456                 dialog=Dialog.QuestionDialog(main_window,"DEB not in Server","Do you want to send to the server this DEB '%s' ?"%pkg_name)
     458                dialog=Dialog.QuestionDialog(main_window,_(u"DEB not in Server"),_(u"Do you want to send to the server this DEB '%s' ?")%pkg_name)
    457459                response=dialog.run()
    458460                dialog.destroy()
     
    468470                main_window=self.core.lri.main_window
    469471                pkg_name='\n'.join(pkg_name_orig)
    470                 dialog=Dialog.QuestionDialog(main_window,"DEB not in Server","Do you want to send to the server this DEB list?\n%s\n"%pkg_name)
     472                dialog=Dialog.QuestionDialog(main_window,_(u"DEB not in Server"),_(u"Do you want to send to the server this DEB list?\n%s\n")%pkg_name)
    471473                response=dialog.run()
    472474                dialog.destroy()
     
    484486                main_window=self.core.lri.main_window
    485487               
    486                 dialog=Dialog.QuestionDialog(main_window,"Changes detected","There are unsaved changes. Do you want to discard them?")
     488                dialog=Dialog.QuestionDialog(main_window,_(u"Changes detected"),_(u"There are unsaved changes. Do you want to discard them?"))
    487489                response=dialog.run()
    488490                dialog.destroy()
     
    504506                main_window=self.core.lri.main_window
    505507                pkg_name='\n'.join(pkg_name_orig)
    506                 dialog=Dialog.QuestionDialog(main_window,"Delete deb list","This DEB list is unavaiable from your server:\n%s\nDo you want delete it?"%pkg_name)
     508                dialog=Dialog.QuestionDialog(main_window,_(u"Delete deb list"),_(u"This DEB list is unavaiable from your server:\n%s\nDo you want delete it?")%pkg_name)
    507509                response=dialog.run()
    508510                dialog.destroy()
  • lliurex-remote-installer/trunk/fuentes/lliurex-remote-installer-gui.install/usr/share/lliurex-remote-installer/Dialog.py

    r4058 r4473  
    22gi.require_version('Gtk', '3.0')
    33from gi.repository import Gtk, Pango, GdkPixbuf, Gdk, Gio, GObject,GLib
     4
     5import gettext
     6gettext.textdomain('lliurex-remote-installer-gui')
     7_=gettext.gettext
    48
    59class QuestionDialog(Gtk.Dialog):
     
    6670class ApplyingChangesDialog(Gtk.Dialog):
    6771       
    68         def __init__(self, parent,title="Lliurex Remote Installer",msg="Applying changes..."):
     72        def __init__(self, parent,title="Lliurex Remote Installer",msg=_(u"Applying changes...")):
    6973               
    7074                Gtk.Dialog.__init__(self, title, parent, 0, ())
     
    9599       
    96100       
    97         def __init__(self,parent,title="Please choose a file", path="/home"):
     101        def __init__(self,parent,title=_(u"Please choose a file"), path="/home"):
    98102               
    99103
  • lliurex-remote-installer/trunk/fuentes/lliurex-remote-installer-gui.install/usr/share/lliurex-remote-installer/ExecBox.py

    r4058 r4473  
    1515
    1616_=gettext.gettext
    17 
     17gettext.textdomain('lliurex-remote-installer-gui')
    1818
    1919RSRC="./"
     
    3030               
    3131                builder=Gtk.Builder()
     32                builder.set_translation_domain('lliurex-remote-installer-gui')
    3233                ui_path=RSRC + "lliurex-remote-installer.ui"
    3334                builder.add_from_file(ui_path)
     
    136137                path=self.check_user_desktop()
    137138               
    138                 fcb=Dialog.FileDialog(self.core.lri.main_window,"Please choose a file", path)
     139                fcb=Dialog.FileDialog(self.core.lri.main_window,_(u"Please choose a file"), path)
    139140                response=fcb.run()
    140141                #Creo las listas de ayuda para anyadir paquetes si no existen antes
     
    264265                                       
    265266                                        main_window=self.core.lri.main_window
    266                                         dialog=Dialog.ApplyingChangesDialog(main_window,title="Lliurex Remote Installer",msg="Deleting files.......")
     267                                        dialog=Dialog.ApplyingChangesDialog(main_window,title="Lliurex Remote Installer",msg=_(u"Deleting files......."))
    267268                                        dialog.show()
    268269                                        GLib.timeout_add(500,self.check_delete_thread,dialog)
     
    283284                        self.deleted=self.core.n4d.remove_file(url_dest)
    284285                        if not self.deleted[0]:
    285                                 comment="The file %s cannot be deleted"%pkg
     286                                comment=_(u"The file %s cannot be deleted")%pkg
    286287                                self.remove_file_info_dialog(comment)
    287288                               
     
    321322               
    322323                #Se crea el mensaje de Apply segun si sse suben ficheros o no.
    323                 self.msg1="Applying changes......."
     324                self.msg1=_(u"Applying changes.......")
    324325                if  self.new_execs not in [None,"",[]]:
    325                         self.msg1="Updating files and applying changes......."
     326                        self.msg1=_(u"Updating files and applying changes.......")
    326327                else:
    327                         self.msg1="Applying changes......."
     328                        self.msg1=_(u"Applying changes.......")
    328329               
    329330                main_window=self.core.lri.main_window
     
    407408                if not self.thread_ret["status"]:
    408409                        mw=self.core.lri.main_window
    409                         d=Dialog.ErrorDialog(mw,"asdasd",self.thread_ret["msg"])
     410                        d=Dialog.ErrorDialog(mw,"",self.thread_ret["msg"])
    410411                        d.run()
    411412                        d.destroy()
     
    427428               
    428429                main_window=self.core.lri.main_window
    429                 dialog=Dialog.ErrorDialog(main_window,"Sending Package Error","This list %s cannot be sended to server\nPlease review your share directory\n\n/var/www/llx-remote"%pkg_name)
     430                dialog=Dialog.ErrorDialog(main_window,_(u"Sending Package Error"),_(u"This list %s cannot be sended to server\nPlease review your share directory\n\n/var/www/llx-remote")%pkg_name)
    430431                response=dialog.run()
    431432                dialog.destroy()
     
    441442               
    442443                main_window=self.core.lri.main_window
    443                 dialog=Dialog.QuestionDialog(main_window,"Delete package","Do you want to delete '%s'?"%pkg_name)
     444                dialog=Dialog.QuestionDialog(main_window,_(u"Delete package"),_(u"Do you want to delete '%s'?")%pkg_name)
    444445                response=dialog.run()
    445446                dialog.destroy()
     
    455456               
    456457                main_window=self.core.lri.main_window
    457                 dialog=Dialog.QuestionDialog(main_window,"Delete package","IMPORTANT\nDo you want to delete this Executable from your server?\n'%s'"%pkg_name)
     458                dialog=Dialog.QuestionDialog(main_window,_(u"Delete package"),_(u"IMPORTANT\nDo you want to delete this Executable from your server?\n'%s'")%pkg_name)
    458459                response=dialog.run()
    459460                dialog.destroy()
     
    469470               
    470471                main_window=self.core.lri.main_window
    471                 dialog=Dialog.ErrorDialog(main_window,"Delete package",comment)
     472                dialog=Dialog.ErrorDialog(main_window,_(u"Delete package"),comment)
    472473                response=dialog.run()
    473474                dialog.destroy()
     
    480481               
    481482                main_window=self.core.lri.main_window
    482                 dialog=Dialog.QuestionDialog(main_window,"Executable not in Server","Do you want to send to the server this Executable '%s' ?"%pkg_name)
     483                dialog=Dialog.QuestionDialog(main_window,_(u"Executable not in Server"),_(u"Do you want to send to the server this Executable '%s' ?")%pkg_name)
    483484                response=dialog.run()
    484485                dialog.destroy()
     
    494495                main_window=self.core.lri.main_window
    495496                pkg_name='\n'.join(pkg_name_orig)
    496                 dialog=Dialog.QuestionDialog(main_window,"Executable not in Server","Do you want to send to the server this Executable list?\n%s\n"%pkg_name)
     497                dialog=Dialog.QuestionDialog(main_window,_(u"Executable not in Server"),_(u"Do you want to send to the server this Executable list?\n%s\n")%pkg_name)
    497498                response=dialog.run()
    498499                dialog.destroy()
     
    510511                main_window=self.core.lri.main_window
    511512               
    512                 dialog=Dialog.QuestionDialog(main_window,"Changes detected","There are unsaved changes. Do you want to discard them?")
     513                dialog=Dialog.QuestionDialog(main_window,_(u"Changes detected"),_(u"There are unsaved changes. Do you want to discard them?"))
    513514                response=dialog.run()
    514515                dialog.destroy()
     
    533534                        lista.append(pkg_name_orig)
    534535                pkg_name='\n'.join(lista)
    535                 dialog=Dialog.QuestionDialog(main_window,"Delete Executable list","This Executable list is unavaiable from your server:\n%s\nDo you want delete it?"%pkg_name)
     536                dialog=Dialog.QuestionDialog(main_window,_(u"Delete Executable list"),_(u"This Executable list is unavaiable from your server:\n%s\nDo you want delete it?")%pkg_name)
    536537                response=dialog.run()
    537538                dialog.destroy()
Note: See TracChangeset for help on using the changeset viewer.