diff options
author | Andras Timar <andras.timar@collabora.com> | 2016-05-28 18:48:13 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-05-28 18:48:13 +0200 |
commit | eaf01b2f4c7cb7a79e47943b0ff7c0935709b09a (patch) | |
tree | 6e6a040e7eb7d3eba581ff658544bedbedf41e14 /scripts | |
parent | 62abb2533dab121156c8a5eef9db6d27e25cde65 (diff) |
loleaflet: l10n of slide layouts
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/layoutsl10n.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/layoutsl10n.py b/scripts/layoutsl10n.py new file mode 100755 index 000000000..ddde8ef9a --- /dev/null +++ b/scripts/layoutsl10n.py @@ -0,0 +1,31 @@ +#!/usr/bin/python +# + +import os +import polib +import string +import sys +import codecs +UTF8Writer = codecs.getwriter('utf8') +sys.stdout = UTF8Writer(sys.stdout) + +# get the translation for word "Layout" + +po = polib.pofile("officecfg/registry/data/org/openoffice/Office/UI.po", autodetect_encoding=False, encoding="utf-8", wrapwidth=-1) +for entry in po.translated_entries(): + if entry.msgstr == '' or entry.msgstr == entry.msgid: + continue + if entry.msgid == "Layout": + print("\n#: %s\nmsgid \"%s\"\nmsgstr \"%s\"" % (entry.occurrences[0][0], entry.msgid, entry.msgstr)) + +# get the translations for slide layouts + +layouts = ['STR_AUTOLAYOUT_NONE\n', 'STR_AUTOLAYOUT_ONLY_TITLE\n', 'STR_AUTOLAYOUT_ONLY_TEXT\n', 'STR_AUTOLAYOUT_TITLE\n', 'STR_AUTOLAYOUT_CONTENT\n', 'STR_AUTOLAYOUT_2CONTENT\n', 'STR_AUTOLAYOUT_CONTENT_2CONTENT\n', 'STR_AUTOLAYOUT_2CONTENT_CONTENT\n', 'STR_AUTOLAYOUT_CONTENT_OVER_2CONTENT\n', 'STR_AUTOLAYOUT_2CONTENT_OVER_CONTENT\n', 'STR_AUTOLAYOUT_CONTENT_OVER_CONTENT\n', 'STR_AUTOLAYOUT_4CONTENT\n', 'STR_AUTOLAYOUT_6CONTENT\n', 'STR_AL_TITLE_VERT_OUTLINE\n', 'STR_AL_TITLE_VERT_OUTLINE_CLIPART\n', 'STR_AL_VERT_TITLE_TEXT_CHART\n', 'STR_AL_VERT_TITLE_VERT_OUTLINE\n'] + +po = polib.pofile("sd/source/ui/app.po", autodetect_encoding=False, encoding="utf-8", wrapwidth=-1) +for entry in po.translated_entries(): + if entry.msgstr == '' or entry.msgstr == entry.msgid: + continue + for layout in layouts: + if layout in entry.msgctxt: + print("\n#: %s\nmsgid \"%s\"\nmsgstr \"%s\"" % (entry.occurrences[0][0], entry.msgid, entry.msgstr)) |