Mercurial > libervia-backend
diff frontends/wix/profile_manager.py @ 70:8f2ed279784b
i18n
- gettext support added in frontends
- first draft of frontends french translation
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 05 Mar 2010 20:33:10 +1100 |
parents | 9b842086d915 |
children | f271fff3a713 |
line wrap: on
line diff
--- a/frontends/wix/profile_manager.py Wed Mar 03 17:12:23 2010 +1100 +++ b/frontends/wix/profile_manager.py Fri Mar 05 20:33:10 2010 +1100 @@ -44,30 +44,30 @@ self.panel_id = wx self.sizer.Add(wx.Window(self, -1), 1) - self.sizer.Add(wx.StaticText(self, -1, "Profile:"), 0, flag=wx.ALIGN_CENTER) + self.sizer.Add(wx.StaticText(self, -1, _("Profile:")), 0, flag=wx.ALIGN_CENTER) self.sizer.Add(self.profile_name, 0, flag=wx.ALIGN_CENTER) button_panel = wx.Panel(self) button_panel.sizer = wx.BoxSizer(wx.HORIZONTAL) button_panel.SetSizer(button_panel.sizer) - button_new = wx.Button(button_panel, -1, "New") - button_del = wx.Button(button_panel, -1, "Delete") + button_new = wx.Button(button_panel, -1, _("New")) + button_del = wx.Button(button_panel, -1, _("Delete")) button_panel.sizer.Add(button_new) button_panel.sizer.Add(button_del) self.sizer.Add(button_panel, flag=wx.CENTER) self.Bind(wx.EVT_BUTTON, self.onNewProfile, button_new) self.Bind(wx.EVT_BUTTON, self.onDeleteProfile, button_del) - login_box = wx.StaticBox(self, -1, "Login") + login_box = wx.StaticBox(self, -1, _("Login")) self.login_sizer = wx.StaticBoxSizer(login_box, wx.VERTICAL) self.sizer.Add(self.login_sizer, 1, wx.EXPAND | wx.ALL) self.login_jid = wx.TextCtrl(self, -1) self.login_sizer.Add(wx.StaticText(self, -1, "JID:"), 0, flag=wx.ALIGN_CENTER) self.login_sizer.Add(self.login_jid, flag=wx.EXPAND) self.login_pass = wx.TextCtrl(self, -1, style = wx.TE_PASSWORD) - self.login_sizer.Add(wx.StaticText(self, -1, "Password:"), 0, flag=wx.ALIGN_CENTER) + self.login_sizer.Add(wx.StaticText(self, -1, _("Password:")), 0, flag=wx.ALIGN_CENTER) self.login_sizer.Add(self.login_pass, flag=wx.EXPAND) - loggin_button = wx.Button(self, -1, "Connect") + loggin_button = wx.Button(self, -1, _("Connect")) self.Bind(wx.EVT_BUTTON, self.onConnectButton, loggin_button) self.login_sizer.Add(loggin_button, flag=wx.ALIGN_CENTER) @@ -93,12 +93,12 @@ def onNewProfile(self, event): - dlg = wx.TextEntryDialog(self, "Please enter the new profile name", "New profile", style = wx.OK | wx.CANCEL) + dlg = wx.TextEntryDialog(self, _("Please enter the new profile name"), _("New profile"), style = wx.OK | wx.CANCEL) if dlg.ShowModal() == wx.ID_OK: name = dlg.GetValue() if name: if name[0]=='@': - wx.MessageDialog(self, "A profile name can't start with a @", "Bad profile name", wx.ICON_ERROR).ShowModal() + wx.MessageDialog(self, _("A profile name can't start with a @"), _("Bad profile name"), wx.ICON_ERROR).ShowModal() else: profile = self.host.bridge.createProfile(name) self.__refillProfiles() @@ -109,7 +109,7 @@ name = self.profile_name.GetValue() if not name: return - dlg = wx.MessageDialog(self, "Are you sure to delete the profile [%s]" % name, "Confirmation", wx.ICON_QUESTION | wx.YES_NO) + dlg = wx.MessageDialog(self, _("Are you sure to delete the profile [%s]") % name, _("Confirmation"), wx.ICON_QUESTION | wx.YES_NO) if dlg.ShowModal() == wx.ID_YES: self.host.bridge.deleteProfile(name) self.__refillProfiles() @@ -127,24 +127,24 @@ """Called when the Connect button is pressed""" name = self.profile_name.GetValue() if not name: - wx.MessageDialog(self, "You must select a profile a create a new one before connecting", "No profile selected", wx.ICON_ERROR).ShowModal() + wx.MessageDialog(self, _("You must select a profile or create a new one before connecting"), _("No profile selected"), wx.ICON_ERROR).ShowModal() return if name[0]=='@': - wx.MessageDialog(self, "A profile name can't start with a @", "Bad profile name", wx.ICON_ERROR).ShowModal() + wx.MessageDialog(self, _("A profile name can't start with a @"), _("Bad profile name"), wx.ICON_ERROR).ShowModal() return profile = None # gof profile = self.host.bridge.getProfileName(name) if not profile: - debug("The profile is new, we create it") + debug(_("The profile is new, we create it")) old_jid = self.host.bridge.getParamA("JabberID", "Connection", profile_key=profile) old_pass = self.host.bridge.getParamA("Password", "Connection", profile_key=profile) new_jid = self.login_jid.GetValue() new_pass = self.login_pass.GetValue() if old_jid != new_jid: - debug('Saving new JID') + debug(_('Saving new JID')) self.host.bridge.setParam("JabberID", new_jid, "Connection", profile) if old_pass != new_pass: - debug('Saving new password') + debug(_('Saving new password')) self.host.bridge.setParam("JabberID", new_pass, "Connection", profile) self.host.plug_profile(name)