diff options
| author | Barry Warsaw | 2009-11-24 20:43:11 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-11-24 20:43:11 -0500 |
| commit | 79d9e36a0b824548a0f2bc83cb948fc5ce668151 (patch) | |
| tree | bad1f9da24b61e7afda4017066c4f39177cce29d /src/mailman/core/i18n.py | |
| parent | 755dc1f981b56e4c2663b5596c95590c948ef4ad (diff) | |
| download | mailman-79d9e36a0b824548a0f2bc83cb948fc5ce668151.tar.gz mailman-79d9e36a0b824548a0f2bc83cb948fc5ce668151.tar.zst mailman-79d9e36a0b824548a0f2bc83cb948fc5ce668151.zip | |
Diffstat (limited to 'src/mailman/core/i18n.py')
| -rw-r--r-- | src/mailman/core/i18n.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mailman/core/i18n.py b/src/mailman/core/i18n.py index 8083fd987..6a9482b80 100644 --- a/src/mailman/core/i18n.py +++ b/src/mailman/core/i18n.py @@ -38,11 +38,18 @@ _ = None -def initialize(): - """Initialize the i18n subsystem.""" +def initialize(application=None): + """Initialize the i18n subsystem. + + :param application: An optional `flufl.i18n.Application` instance to use + as the translation context. This primarily exists to support the + testing environment. + :type application: `flufl.i18n.Application` + """ global _ - strategy = PackageStrategy('mailman', mailman.messages) - application = registry.register(strategy) + if application is None: + strategy = PackageStrategy('mailman', mailman.messages) + application = registry.register(strategy) _ = application._ |
