From e1096f8c3931cb999117c3a7eab4cee9f9224a1b Mon Sep 17 00:00:00 2001 From: pierre Date: Tue, 18 Nov 2014 13:59:04 +0100 Subject: [PATCH] langage --- chemins.py | 1 + iramuteq.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/chemins.py b/chemins.py index 3217a4f..f43969c 100644 --- a/chemins.py +++ b/chemins.py @@ -159,6 +159,7 @@ def ConstructGlobalPath(AppliPath): ConfigPath = os.path.join(AppliPath, 'configuration') DictConfigPath = { 'global': os.path.join(ConfigPath, 'global.cfg'), + 'preferences': os.path.join(ConfigPath, 'iramuteq.cfg'), } return DictConfigPath diff --git a/iramuteq.py b/iramuteq.py index ccc28f8..1ce343d 100644 --- a/iramuteq.py +++ b/iramuteq.py @@ -113,6 +113,8 @@ ImagePath = os.path.join(AppliPath, 'images') DictConfigPath = ConstructGlobalPath(AppliPath) ConfigGlob = ConfigParser() ConfigGlob.read(DictConfigPath['global']) +DefaultConf = ConfigParser() +DefaultConf.read(DictConfigPath['preferences']) #repertoire de l'utilisateur if os.getenv('HOME') != None: user_home = os.getenv('HOME') @@ -191,10 +193,9 @@ class IraFrame(wx.Frame): self.preslangue = {} for langue in code_langues : self.preslangue[langue] = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=[code_langues[langue]]) - + self.setlangue() #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() @@ -525,7 +526,10 @@ vous devez signaler le chemin de l'éxecutable de R dans les préférences.""" def setlangue(self) : self.pref.read(self.ConfigPath['preferences']) - guilangue = self.pref.get('iramuteq', 'guilanguage') + try : + guilangue = self.pref.get('iramuteq', 'guilanguage') + except : + guilangue = DefaultConf.get('iramuteq', 'guilanguage') self.preslangue.get(guilangue, 'english').install() def OnVerif(self, evt) : -- 2.7.4