diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2018-08-24 20:52:28 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-24 20:52:28 -0400 |
| commit | 1de8487849a3f8f55d126e2687d690226e657fde (patch) | |
| tree | 1bd891b97f8447cb3f513d073d20cea5d4534461 /lib/i18n.py | |
| parent | b3bb975401fe4971170239eea9b928ee13161398 (diff) | |
| parent | 91eb98cc33602f19dddc186c034aed968e048404 (diff) | |
Merge pull request #288 from inkstitch/lexelby/style
fix coding style and enforce style checks in build
Diffstat (limited to 'lib/i18n.py')
| -rw-r--r-- | lib/i18n.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/i18n.py b/lib/i18n.py index 419c03dc..045fa1b2 100644 --- a/lib/i18n.py +++ b/lib/i18n.py @@ -9,8 +9,11 @@ locale_dir = None # Use N_ to mark a string for translation but _not_ immediately translate it. # reference: https://docs.python.org/3/library/gettext.html#deferred-translations # Makefile configures pybabel to treat N_() the same as _() + + def N_(message): return message + def _set_locale_dir(): global locale_dir @@ -22,11 +25,13 @@ def _set_locale_dir(): locale_dir = os.path.join(locale_dir, 'locales') + def localize(languages=None): global translation, _ translation = gettext.translation("inkstitch", locale_dir, fallback=True) _ = translation.gettext + _set_locale_dir() localize() |
