diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-02-02 17:31:05 +0000 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-02-02 17:31:05 +0000 |
commit | 2e5e969823e4e7d5b16a4742eae4cc1d13959c09 (patch) | |
tree | 126cd30b2c134d5c5f85b9b85161510e8cc1f09e /ishtar_common/ooo_replace.py | |
parent | e6e4aed623ec61def0944ce97ac2e4d6c873f5ac (diff) | |
download | Ishtar-2e5e969823e4e7d5b16a4742eae4cc1d13959c09.tar.bz2 Ishtar-2e5e969823e4e7d5b16a4742eae4cc1d13959c09.zip |
Try ".utf8" localisation when default is not available (refs #2259)
Diffstat (limited to 'ishtar_common/ooo_replace.py')
-rw-r--r-- | ishtar_common/ooo_replace.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ishtar_common/ooo_replace.py b/ishtar_common/ooo_replace.py index 2fb01724b..08ee17b63 100644 --- a/ishtar_common/ooo_replace.py +++ b/ishtar_common/ooo_replace.py @@ -62,10 +62,12 @@ def _format_value(value, default_value): c_locale[1] = c_locale[1].upper() c_locale = "_".join(c_locale) if locale.getlocale()[0] != c_locale: - try: - locale.setlocale(locale.LC_ALL, c_locale) - except: - pass + for loc in (c_locale, c_locale+'.utf8'): + try: + locale.setlocale(locale.LC_ALL, loc) + break + except: + pass try: if settings.DATE_FORMAT: value = value.strftime(settings.DATE_FORMAT).lower() |