publisher: use local translation before default translations
This commit is contained in:
parent
040afeecda
commit
7a41c6ce25
|
@ -61,6 +61,7 @@ import logging.handlers
|
|||
import logger
|
||||
import storage
|
||||
import strftime
|
||||
from . import translations
|
||||
|
||||
class ImmediateRedirectException(Exception):
|
||||
def __init__(self, location):
|
||||
|
@ -266,6 +267,11 @@ class QommonPublisher(Publisher):
|
|||
trans.add_fallback(self.translations[lang])
|
||||
else:
|
||||
trans = self.translations[lang]
|
||||
custom_translation = self.cfg.get('custom_translations', {}).get(lang, {})
|
||||
if custom_translation:
|
||||
new_trans = translations.DictionnaryTranslations(custom_translation)
|
||||
new_trans.add_fallback(trans)
|
||||
trans = new_trans
|
||||
return trans
|
||||
|
||||
def install_lang(self, lang = None):
|
||||
|
|
Loading…
Reference in New Issue