diff options
| author | 2014-02-28 08:49:41 -0300 | |
|---|---|---|
| committer | 2014-02-28 08:49:41 -0300 | |
| commit | 0f1e24f7888ba16fe5629c57fd00f0deacb63e5e (patch) | |
| tree | 7153a3a11b766f375b1d1c0a7adc599e0a9f9c55 /scripts/import_po.py | |
| parent | 04fc43563d3d5d4218004690b5e14c19c67bdcbc (diff) | |
| parent | 2828399ba5cbb14502b023d4de1ba02f13dd5055 (diff) | |
Merge tag 'upstream/6.3.0'
Upstream version 6.3.0
Diffstat (limited to 'scripts/import_po.py')
| -rwxr-xr-x | scripts/import_po.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/import_po.py b/scripts/import_po.py index 89e1089..224826c 100755 --- a/scripts/import_po.py +++ b/scripts/import_po.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- """Download translations from transifex and regenerate files.""" from __future__ import unicode_literals, print_function @@ -22,6 +23,22 @@ MESSAGES = {""".splitlines() lines2 = [] for entry in po: lines2.append(' "{0}": "{1}",'. format(entry.msgid, entry.msgstr)) + ### BACKWARDS COMPATIBILITY PATCH START + ### TODO: remove in v7 + if entry.msgid in ["Posted:", "Also available in:"]: + fid = entry.msgid + fid = fid.replace(':', '') + fstr = entry.msgstr + fstr = fstr.replace(':', '').replace(':', '') + lines2.append(' "{0}": "{1}",'. format(fid, fstr)) + elif entry.msgid == 'More posts about %s': + fid = entry.msgid + fid = fid.replace(' %s', '') + fstr = entry.msgstr + fstr = fstr.replace(' %s', '').replace('%s', '') + lines2.append(' "{0}": "{1}",'. format(fid, fstr)) + ### BACKWARDS COMPATIBILITY PATCH END + ### TODO: remove in v7 lines.extend(sorted(lines2)) lines.append("}\n") print("Generating:", outf) |
