Also output interface language in debug messages

This commit is contained in:
Kovid Goyal 2017-06-19 19:38:08 +05:30
parent 0e173abfbf
commit 469ec4d2fe
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 9 additions and 0 deletions

View File

@ -181,9 +181,11 @@ def print_basic_debug_info(out=None):
import platform import platform
from calibre.constants import (__appname__, get_version, isportable, isosx, from calibre.constants import (__appname__, get_version, isportable, isosx,
isfrozen, is64bit) isfrozen, is64bit)
from calibre.utils.localization import set_translators
out(__appname__, get_version(), 'Portable' if isportable else '', out(__appname__, get_version(), 'Portable' if isportable else '',
'embedded-python:', isfrozen, 'is64bit:', is64bit) 'embedded-python:', isfrozen, 'is64bit:', is64bit)
out(platform.platform(), platform.system(), platform.architecture()) out(platform.platform(), platform.system(), platform.architecture())
out('Interface language:', type(u'')(set_translators.lang))
if iswindows and not is64bit: if iswindows and not is64bit:
try: try:
import win32process import win32process

View File

@ -218,6 +218,10 @@ def set_translators():
if t is None: if t is None:
t = NullTranslations() t = NullTranslations()
try:
set_translators.lang = t.info().get('language')
except Exception:
pass
t.install(unicode=True, names=('ngettext',)) t.install(unicode=True, names=('ngettext',))
# Now that we have installed a translator, we have to retranslate the help # Now that we have installed a translator, we have to retranslate the help
# for the global prefs object as it was instantiated in get_lang(), before # for the global prefs object as it was instantiated in get_lang(), before
@ -226,6 +230,9 @@ def set_translators():
prefs.retranslate_help() prefs.retranslate_help()
set_translators.lang = None
_iso639 = None _iso639 = None
_extra_lang_codes = { _extra_lang_codes = {
'pt_BR' : _('Brazilian Portuguese'), 'pt_BR' : _('Brazilian Portuguese'),