Added
Link Here
|
1 |
Backported from fixes contained in http://trac.edgewall.org/ticket/11345 |
2 |
|
3 |
--- trac/util/translation.py.orig |
4 |
+++ trac/util/translation.py |
5 |
@@ -150,6 +150,6 @@ |
6 |
t = self._null_translations |
7 |
else: |
8 |
- t.add(Translations.load(locale_dir, locale or 'en_US', |
9 |
- 'tracini')) |
10 |
+ self._add(t, Translations.load(locale_dir, locale or 'en_US', |
11 |
+ 'tracini')) |
12 |
if env_path: |
13 |
with self._plugin_domains_lock: |
14 |
@@ -157,5 +157,6 @@ |
15 |
domains = domains.items() |
16 |
for domain, dirname in domains: |
17 |
- t.add(Translations.load(dirname, locale, domain)) |
18 |
+ self._add(t, Translations.load(dirname, locale, |
19 |
+ domain)) |
20 |
self._current.translations = t |
21 |
self._activate_failed = False |
22 |
@@ -184,4 +185,10 @@ |
23 |
return self._current.translations is not None \ |
24 |
or self._activate_failed |
25 |
+ |
26 |
+ # Internal methods |
27 |
+ |
28 |
+ def _add(self, t, translations): |
29 |
+ if isinstance(translations, Translations): |
30 |
+ t.add(translations) |
31 |
|
32 |
# Delegated methods |