summaryrefslogtreecommitdiff
path: root/mat-gui
diff options
context:
space:
mode:
authorintrigeri2012-05-16 11:15:32 +0200
committerjvoisin2012-05-17 13:26:37 +0200
commitadf403ca6adc1bdbd40e35237c4d75548b3f6c74 (patch)
tree6986f1cb791bc4dc3c4fdaa8cf7ed0be5cae611c /mat-gui
parent4160c14f22e124c9fa0ed141e2409ca66de903d9 (diff)
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.
Diffstat (limited to 'mat-gui')
-rwxr-xr-xmat-gui21
1 files changed, 1 insertions, 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'))
565 self.statusbar.push(0, _('Ready')) 565 self.statusbar.push(0, _('Ready'))
566 yield False 566 yield False
567 567
568
569def translate():
570 ''''
571 Handle L10N of mat-gui
572 '''
573 # get system's language
574 current_lang, _ = locale.getdefaultlocale()
575 if current_lang:
576 langs = [current_lang]
577
578 # get the $LANG environnement's variable
579 language = os.environ.get('LANG', None)
580 if language:
581 langs += language.split(':')
582
583 return gettext.translation('MAT', 'locale', langs,
584 fallback=True).ugettext
585
586
587if __name__ == '__main__': 568if __name__ == '__main__':
588 _ = translate() 569 gettext.install('MAT', unicode=True)
589 570
590 #Main 571 #Main
591 gui = GUI() 572 gui = GUI()