From adf403ca6adc1bdbd40e35237c4d75548b3f6c74 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 16 May 2012 11:15:32 +0200 Subject: Have gettext find translations where they are, and don't duplicate its work. Without running gettext.install, the gettext module did not find .mo files where they live. So, let's add an incantation thereof. Once this is done, Python's gettext defines a "_" function all by itself, so we can get rid of the hand-crafted one that's now obsolete. --- mat-gui | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/mat-gui b/mat-gui index 1095e30..3942689 100755 --- a/mat-gui +++ b/mat-gui @@ -565,27 +565,8 @@ non-anonymised) file to output archive')) self.statusbar.push(0, _('Ready')) yield False - -def translate(): - '''' - Handle L10N of mat-gui - ''' - # get system's language - current_lang, _ = locale.getdefaultlocale() - if current_lang: - langs = [current_lang] - - # get the $LANG environnement's variable - language = os.environ.get('LANG', None) - if language: - langs += language.split(':') - - return gettext.translation('MAT', 'locale', langs, - fallback=True).ugettext - - if __name__ == '__main__': - _ = translate() + gettext.install('MAT', unicode=True) #Main gui = GUI() -- cgit v1.3