diff roundup/mailgw.py @ 6672:01216187a167

Testing translations in mailgw.py, update translations, i18n improved i18n.py: translation objects get a _file which is the file that catalog was loaded from. Useful for debugging. mailgw.py: fix code to include roundup.i18n and invoke propert method. GNUMakefile: added roundup.pot target. Also building roundup.pot sets the release version and product code in roundup.pot. Release version from roundup.__init__.py. merged roundup.pot changes into all *.po files. Not sure if the version info in the headers of the .po files is supposed to be updated to match roundup.pot or not. test_mailgw.py: test cases for en and de translations tested. Not sure why I neede to set roundupdb._ and mailgw._, but followed setUp method code and it worked.
author John Rouillard <rouilj@ieee.org>
date Wed, 11 May 2022 21:20:34 -0400
parents 408fd477761f
children 567283742a5c
line wrap: on
line diff
--- a/roundup/mailgw.py	Wed May 11 01:04:53 2022 -0400
+++ b/roundup/mailgw.py	Wed May 11 21:20:34 2022 -0400
@@ -109,6 +109,7 @@
 from roundup import configuration, hyperdb, date, password, exceptions
 from roundup.mailer import Mailer
 from roundup.i18n import _
+from roundup import i18n
 from roundup.hyperdb import iter_roles
 from roundup.anypy.strings import StringIO, b2s, u2s
 import roundup.anypy.random_ as random_
@@ -1604,7 +1605,8 @@
         self.db = self.instance.open('admin')
 
         language = self.instance.config["MAILGW_LANGUAGE"] or self.instance.config["TRACKER_LANGUAGE"]
-        self.db.i18n = i18n.get_language (language)
+        self.db.i18n = i18n.get_translation(language,
+                          tracker_home=self.instance.config["TRACKER_HOME"])
 
         global _
         _ = self.db.i18n.gettext

Roundup Issue Tracker: http://roundup-tracker.org/