Ignore:
Timestamp:
04/27/12 18:29:22 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Internationalized the automatic update window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/update.py

    r105 r115  
    66
    77from mlx.update import update
     8from mlx.i18n import xstr
    89
    910import mlx.const as const
     
    3940
    4041        Updater._progressWindow = window = gtk.Window()
    41         window.set_title(WINDOW_TITLE_BASE + " Update")
     42        window.set_title(WINDOW_TITLE_BASE + " " + xstr("update_title"))
    4243        window.set_transient_for(parentWindow)
    4344        #win.set_icon_from_file(os.path.join(iconDirectory, "logo.ico"))
     
    7273
    7374        Updater._sudoDialog = sudoDialog = \
    74             gtk.Dialog(WINDOW_TITLE_BASE + " Update",
     75            gtk.Dialog(WINDOW_TITLE_BASE + " " + xstr("update_title"),
    7576                       parentWindow,
    7677                       gtk.DialogFlags.MODAL if pygobject else gtk.DIALOG_MODAL,
     
    8283                                       padding_left = 16, padding_right = 16)
    8384
    84         infoLabel = gtk.Label("There is an update available, but the program cannot write\n"
    85                               "its directory due to insufficient privileges.\n\n"
    86                               "Click OK, if you want to run a helper program\n"
    87                               "with administrator privileges "
    88                               "to complete the update,\n"
    89                               "Cancel otherwise.")
     85        infoLabel = gtk.Label(xstr("update_needsudo"))
    9086        infoLabel.set_justify(gtk.Justification.CENTER if pygobject
    9187                              else gtk.JUSTIFY_CENTER)
     
    128124    def _downloadingManifest(self):
    129125        """Called when the downloading of the manifest has started."""
    130         self._progressLabel.set_text("Downloading manifest...")
     126        self._progressLabel.set_text(xstr("update_manifest_progress"))
    131127        self._progressBar.set_fraction(0)
    132128
     
    137133    def _downloadedManifest(self):
    138134        """Called when the downloading of the manifest has finished."""
    139         self._progressLabel.set_text("Downloaded manifest...")
     135        self._progressLabel.set_text(xstr("update_manifest_done"))
    140136        self._progressBar.set_fraction(0.05)
    141137
     
    178174    def _startDownload(self):
    179175        """Called when the download has started."""
    180         self._progressLabel.set_text("Downloading files...")
     176        self._progressLabel.set_text(xstr("update_files_progress"))
    181177
    182178    def setDownloaded(self, downloaded):
     
    187183    def _setDownloaded(self, downloaded):
    188184        """Called when a certain number of bytes are downloaded."""
    189         self._progressLabel.set_text("Downloaded %d of %d" % \
     185        self._progressLabel.set_text(xstr("update_files_bytes") % \
    190186                                     (downloaded, self._totalSize))
    191187        self._setProgress()
     
    197193    def _startRenaming(self):
    198194        """Called when the renaming of files has started."""
    199         self._progressLabel.set_text("Renaming downloaded files...")
     195        self._progressLabel.set_text(xstr("update_renaming"))
    200196
    201197    def renamed(self, path, count):
     
    206202    def _renamed(self, path, count):
    207203        """Called when a file has been renamed."""
    208         self._progressLabel.set_text("Renamed %s" % (path,))
     204        self._progressLabel.set_text(xstr("update_renamed") % (path,))
    209205        self._setProgress()
    210206
     
    215211    def _startRemoving(self):
    216212        """Called when the removing of files has started."""
    217         self._progressLabel.set_text("Removing files...")
     213        self._progressLabel.set_text(xstr("update_removing"))
    218214
    219215    def removed(self, path, count):
     
    224220    def _removed(self, path, count):
    225221        """Called when a file has been removed."""
    226         self._progressLabel.set_text("Removed %s" % (path,))
     222        self._progressLabel.set_text(xstr("update_removed") % (path,))
    227223        self._setProgress()
    228224
     
    233229    def _writingManifest(self):
    234230        """Called when the writing of the new manifest file has started."""
    235         self._progressLabel.set_text("Writing the new manifest")
     231        self._progressLabel.set_text(xstr("update_writing_manifest"))
    236232       
    237233    def done(self):
     
    244240        self._progressBar.set_fraction(1)
    245241        if self._totalProgress>0:
    246             self._progressLabel.set_text("Finished updating. Press OK to restart the program.")
     242            self._progressLabel.set_text(xstr("update_finished"))
    247243            self._progressOKButton.set_sensitive(True)
    248244        else:
    249             self._progressLabel.set_text("There was nothing to update")
     245            self._progressLabel.set_text(xstr("update_nothing"))
    250246       
    251247    def _setProgress(self):
     
    264260    def _failed(self, what):
    265261        """Called when the downloading has failed."""       
    266         self._progressLabel.set_text("Failed, see the debug log for details.")
     262        self._progressLabel.set_text(xstr("update_failed"))
    267263        self._progressBar.set_fraction(1)
    268264        self._progressOKButton.set_sensitive(True)
Note: See TracChangeset for help on using the changeset viewer.