summaryrefslogtreecommitdiff
path: root/ishtar_common/ooo_replace.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/ooo_replace.py')
-rw-r--r--ishtar_common/ooo_replace.py10
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()