From: Pierre Date: Sat, 2 Feb 2013 10:09:26 +0000 (+0100) Subject: langues X-Git-Url: http://iramuteq.org/git?a=commitdiff_plain;h=5fe741965178c0b1728560ee8787a26ce903f142;p=iramuteq langues --- diff --git a/dialog.py b/dialog.py index 56183ff..630b60f 100755 --- a/dialog.py +++ b/dialog.py @@ -410,6 +410,20 @@ nouvelle version est disponible""" self.m_radioBox2 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox2Choices, 1, wx.RA_SPECIFY_COLS ) self.m_radioBox2.SetSelection( 0 ) fgSizer1.Add( self.m_radioBox2, 0, wx.ALIGN_RIGHT|wx.ALL, 5 ) + + msg = u"""Langue de l'interface""" + self.m_staticText45 = wx.StaticText( self, wx.ID_ANY, msg, wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText45.Wrap( -1 ) + fgSizer1.Add( self.m_staticText45, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) + + self.m_staticText46 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText46.Wrap( -1 ) + fgSizer1.Add( self.m_staticText46, 0, wx.ALL, 5 ) + + self.listlangues = [ u"french", u"english" ] + self.langues = wx.Choice( self, wx.ID_ANY, (200, -1), choices = self.listlangues) + #self.langues.SetSelection( 0 ) + fgSizer1.Add( self.langues, 0, wx.ALIGN_RIGHT|wx.ALL, 5 ) msg = u"""Vérifier l'installation des bibliothèques de R""" @@ -504,6 +518,7 @@ bibliothèques de R""" if self.parent.pref.getboolean('iramuteq', 'checkupdate') : val2 = 0 else : val2 = 1 self.m_radioBox2.SetSelection(val2) + self.langues.SetSelection(self.listlangues.index(self.parent.pref.get('iramuteq', 'guilanguage'))) if sys.platform == 'win32' : if self.parent.pref.getboolean('iramuteq', 'R_mem') : self.m_checkBox1.SetValue(True) @@ -542,6 +557,7 @@ bibliothèques de R""" if self.m_radioBox2.GetSelection() == 0 : valcheck = 'true' else : valcheck = 'false' parent.pref.set('iramuteq', 'checkupdate', valcheck) + parent.pref.set('iramuteq', 'guilanguage', self.listlangues[self.langues.GetSelection()]) if sys.platform == 'win32' : if self.m_checkBox1.GetValue() : parent.pref.set('iramuteq', 'R_mem', 'true') diff --git a/iramuteq.py b/iramuteq.py index 20db754..53667d4 100644 --- a/iramuteq.py +++ b/iramuteq.py @@ -147,6 +147,10 @@ sys.stderr = writer() sys.stdout = printer() ConfigPath = ConstructConfigPath(UserConfigPath) + + +langues = {'french' : wx.LANGUAGE_FRENCH, + 'english' : wx.LANGUAGE_ENGLISH,} ##################################################################### class IraFrame(wx.Frame): @@ -169,14 +173,10 @@ class IraFrame(wx.Frame): #workaround for import problem self.SimiFromCluster = SimiFromCluster #langues - mylocale = wx.Locale(wx.LANGUAGE_FRENCH) - mylocale.AddCatalogLookupPathPrefix(os.path.join(AppliPath,'locale')) - mylocale.AddCatalog('iramuteq') - presLan_en = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=['en']) - presLan_fr = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=['fr_FR']) - presLan_fr.install() - - + gettext.install('iramuteq', os.path.join(AppliPath,'locale'), unicode=True) + self.presLan_fr = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=['fr_FR']) + self.presLan_en = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=['en']) + self.setlangue() # tell FrameManager to manage this frame #self._mgr = wx.aui.AuiManager() self._mgr = aui.AuiManager() @@ -487,6 +487,24 @@ vous devez signaler le chemin de l'éxecutable de R dans les préférences.""" dlg.Destroy() + def setlangue(self) : + try : + self.pref.read(self.ConfigPath['preferences']) + guilangue = self.pref.get('iramuteq', 'guilanguage') + if guilangue == 'french' : + self.presLan_fr.install() + else : + self.presLan_en.install() + mylocale = wx.Locale(langues[guilangue]) + mylocale.AddCatalogLookupPathPrefix(os.path.join(AppliPath,'locale')) + mylocale.AddCatalog('iramuteq') + except : + self.presLan_fr.install() + mylocale = wx.Locale(langues['french']) + mylocale.AddCatalogLookupPathPrefix(os.path.join(AppliPath,'locale')) + mylocale.AddCatalog('iramuteq') + + def OnVerif(self, evt) : pack = CheckRPackages(self) if pack : @@ -495,7 +513,6 @@ vous devez signaler le chemin de l'éxecutable de R dans les préférences.""" if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]: evt.Veto() - #FIXME marche pas sous mac ? def DisEnSaveTabAs(self, DISEN): #Disable SaveTabAs file_menu = self.mb.GetMenu(0) diff --git a/iramuteq_en.po b/iramuteq_en.po index fb7e9f9..a26e13f 100644 --- a/iramuteq_en.po +++ b/iramuteq_en.po @@ -3,47 +3,126 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: iramuteq 0.6 alpha 1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-09-16 16:27+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"POT-Creation-Date: 2013-02-01 19:26+0100\n" +"PO-Revision-Date: 2013-02-02 09:23+0100\n" +"Last-Translator: Pierre Ratinaud \n" +"Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: English\n" +"X-Poedit-Country: UNITED KINGDOM\n" -#: iramuteq.py:134 -msgid "&Open a questionnaire\tCtrl+O" -msgstr "" - -#: iramuteq.py:184 +#: iramuteq.py:268 msgid "Edition" -msgstr "" +msgstr "Edition" + +#: iramuteq.py:226 +msgid "Exit" +msgstr "Exit" -#: iramuteq.py:183 +#: iramuteq.py:214 +msgid "Extract mods" +msgstr "Extract mods" + +#: iramuteq.py:267 msgid "File" -msgstr "" +msgstr "File" -#: iramuteq.py:188 +#: iramuteq.py:272 msgid "Help" -msgstr "" +msgstr "Help" -#: iramuteq.py:134 -msgid "Open a questionnaire" -msgstr "" +#: iramuteq.py:232 +msgid "Home page" +msgstr "Home page" + +#: iramuteq.py:210 +msgid "Import from factiva" +msgstr "Import from factiva" + +#: corpus.py:1147 +msgid "No Text in corpora. Are you sure of the formatting ?" +msgstr "No Text in corpora. Are you sure of the formatting ?" + +#: iramuteq.py:190 +msgid "Open a matrix" +msgstr "Open a matrix" + +#: iramuteq.py:194 +msgid "Open a text corpora" +msgstr "Open a text corpora" + +#: iramuteq.py:198 +msgid "Open an analysis" +msgstr "Open an analysis" -#: iramuteq.py:186 +#: iramuteq.py:229 +msgid "Preferences" +msgstr "Preferences" + +#: iramuteq.py:222 +msgid "Save tab as..." +msgstr "Save tab as..." + +#: iramuteq.py:233 +msgid "Show data" +msgstr "Show data" + +#: iramuteq.py:234 +msgid "Show results" +msgstr "Show results" + +#: iramuteq.py:213 +msgid "Split from variable" +msgstr "Split from variable" + +#: iramuteq.py:270 +#: iramuteq.py:427 +#: iramuteq.py:636 +#: tableau.py:185 msgid "Spreadsheet analysis" -msgstr "" +msgstr "Spreadsheet analysis" -#: iramuteq.py:187 +#: iramuteq.py:271 +#: iramuteq.py:428 +#: iramuteq.py:635 +#: openanalyse.py:116 +#: openanalyse.py:119 +#: openanalyse.py:122 +#: openanalyse.py:125 +#: openanalyse.py:128 +#: openanalyse.py:131 +#: tableau.py:186 msgid "Text analysis" -msgstr "" +msgstr "Text analysis" -#: iramuteq.py:185 +#: iramuteq.py:219 +msgid "Tools" +msgstr "Tools" + +#: iramuteq.py:269 +#: iramuteq.py:426 +#: iramuteq.py:564 +#: iramuteq.py:634 +#: tableau.py:184 msgid "View" -msgstr "" +msgstr "View" + +#: iramuteq.py:206 +msgid "from copy/paste" +msgstr "from copy/paste" + +#: iramuteq.py:205 +msgid "from mail" +msgstr "from mail" + +#: iramuteq.py:204 +msgid "from xml" +msgstr "from xml" + diff --git a/locale/en/LC_MESSAGES/iramuteq.mo b/locale/en/LC_MESSAGES/iramuteq.mo index 8a0dc61..aea67dd 100644 Binary files a/locale/en/LC_MESSAGES/iramuteq.mo and b/locale/en/LC_MESSAGES/iramuteq.mo differ