RcGcDb/src/i18n.py

14 lines
502 B
Python
Raw Normal View History

2020-07-11 15:54:08 +00:00
import sys, logging, gettext
2020-08-09 23:57:14 +00:00
from collections import defaultdict
2020-07-11 15:54:08 +00:00
logger = logging.getLogger("rcgcdb.i18n")
2022-11-25 16:24:44 +00:00
supported_languages = ('de', 'hi', 'pl', 'pt-br', 'ru', 'zh-hans', 'zh-hant', 'es')
translated_files = ('redaction', 'misc', 'formatters')
2020-07-11 15:54:08 +00:00
2022-11-25 16:24:44 +00:00
langs = defaultdict(dict)
for lang in supported_languages:
2020-08-09 23:57:14 +00:00
for file in translated_files:
2022-11-25 16:24:44 +00:00
langs[lang][file] = gettext.translation(file, localedir='locale', languages=[lang])
for file in translated_files:
langs["en"][file] = gettext.NullTranslations()