Skip to content

Commit

Permalink
* Fix used fontdef in 'System default' mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisOelmueller committed Apr 21, 2012
1 parent e607f54 commit 55a21a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions horizons/i18n/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,16 @@ def change_language(language=None):
else:
# default locale
if platform.system() == "Windows": # win doesn't set the language variable by default
os.environ[ 'LANGUAGE' ] = locale.getdefaultlocale()[0]
language = locale.getdefaultlocale()[0]
os.environ['LANGUAGE'] = language
gettext.install('unknown-horizons', 'content/lang', unicode=True, names=['ngettext',])

# expose the plural-aware translate function as builtin N_ (gettext does the same to _)
import __builtin__
__builtin__.__dict__['N_'] = __builtin__.__dict__['ngettext']

# update fonts
fontdef = get_fontdef_for_locale(language)
fontdef = get_fontdef_for_locale(language or horizons.main.fife.get_locale())
horizons.main.fife.pychan.loadFonts(fontdef)

# dynamically reset all translations of active widgets
Expand Down

0 comments on commit 55a21a0

Please sign in to comment.