mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Also output interface language in debug messages
This commit is contained in:
parent
0e173abfbf
commit
469ec4d2fe
@ -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
|
||||||
|
@ -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'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user