diff options
Diffstat (limited to 'ishtar_common/ooo_replace.py')
-rw-r--r-- | ishtar_common/ooo_replace.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ishtar_common/ooo_replace.py b/ishtar_common/ooo_replace.py index 1f770fc2b..54ecfced4 100644 --- a/ishtar_common/ooo_replace.py +++ b/ishtar_common/ooo_replace.py @@ -23,6 +23,18 @@ from cStringIO import StringIO from xml.etree.cElementTree import ElementTree, fromstring from django.conf import settings +from ooo_translation import ooo_translation + +def translate_context(context, locale): + if locale not in ooo_translation: + return context + new_context = {} + for k in context: + new_key = k + if k in ooo_translation[locale]: + new_key = ooo_translation[locale][k] + new_context[new_key] = context[k] + return new_context OOO_NS = "{urn:oasis:names:tc:opendocument:xmlns:text:1.0}" |