diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-03-03 19:01:53 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-05-06 16:04:02 +0200 |
commit | e6b2eac7d8610264bbdc94542be7d1319c9f88a1 (patch) | |
tree | 56a4153d39f462ce0273e7118f1446ab5123e9a8 /ishtar_common/ooo_replace.py | |
parent | 1eea0d98d0ddd060c7d81bd6763e8c4937f92a72 (diff) | |
download | Ishtar-e6b2eac7d8610264bbdc94542be7d1319c9f88a1.tar.bz2 Ishtar-e6b2eac7d8610264bbdc94542be7d1319c9f88a1.zip |
OOO: manage translation of keys
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}" |