summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-11-06 11:44:24 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-11-06 11:44:24 +0200
commit218000e5558db83514cb041de80d2f1af006f6c5 (patch)
treef8f38fda23c74a3a1f3806bb8cd0f471ea2db018
parent86b425073ef545c8a99f985a75584ac31af6e122 (diff)
Updated language strings
Cleaned up output of the string compilation script.
-rwxr-xr-xpo/compile.py13
-rw-r--r--res/lang/ru.binbin43872 -> 43848 bytes
-rw-r--r--res/lang/tok.binbin26592 -> 26584 bytes
3 files changed, 11 insertions, 2 deletions
diff --git a/po/compile.py b/po/compile.py
index af0e422b..adf5a403 100755
--- a/po/compile.py
+++ b/po/compile.py
@@ -35,6 +35,9 @@ ESCAPES = {
35 't': '\t', 35 't': '\t',
36 'v': '\v', 36 'v': '\v',
37} 37}
38missing_count = {}
39for lang in BUILD_LANGS:
40 missing_count[lang] = 0
38 41
39if '--new' in sys.argv: 42if '--new' in sys.argv:
40 MODE = 'new' 43 MODE = 'new'
@@ -122,6 +125,7 @@ if MODE == 'compile':
122 for src in os.listdir('.'): 125 for src in os.listdir('.'):
123 if src.endswith('.po') and src.split('.')[0] in BUILD_LANGS: 126 if src.endswith('.po') and src.split('.')[0] in BUILD_LANGS:
124 # Make a binary blob with strings sorted by ID. 127 # Make a binary blob with strings sorted by ID.
128 lang_id = src[:-3]
125 have_ids = set() 129 have_ids = set()
126 compiled = bytes() 130 compiled = bytes()
127 lang = parse_po(src) 131 lang = parse_po(src)
@@ -130,11 +134,16 @@ if MODE == 'compile':
130 # Take missing strings from the base language. 134 # Take missing strings from the base language.
131 for msg_id in BASE_STRINGS: 135 for msg_id in BASE_STRINGS:
132 if msg_id not in have_ids and not msg_id[:-2] in PLURALS: 136 if msg_id not in have_ids and not msg_id[:-2] in PLURALS:
133 print('%10s' % src, 'missing:', msg_id) 137 #print('%10s' % src, 'missing:', msg_id)
138 missing_count[lang_id] += 1
134 lang.append((msg_id, BASE_STRINGS[msg_id])) 139 lang.append((msg_id, BASE_STRINGS[msg_id]))
135 for msg_id, msg_str in sorted(lang): 140 for msg_id, msg_str in sorted(lang):
136 compiled += compile_string(msg_id, msg_str) 141 compiled += compile_string(msg_id, msg_str)
137 open(f'../res/lang/{src[:-3]}.bin', 'wb').write(compiled) 142 open(f'../res/lang/{lang_id}.bin', 'wb').write(compiled)
143 # Show statistics.
144 for lang_id in missing_count:
145 if missing_count[lang_id] > 0:
146 print('%7s: %4d missing' % (lang_id, missing_count[lang_id]))
138 147
139elif MODE == 'new': 148elif MODE == 'new':
140 messages = parse_po('en.po') 149 messages = parse_po('en.po')
diff --git a/res/lang/ru.bin b/res/lang/ru.bin
index ae868a8b..4febb613 100644
--- a/res/lang/ru.bin
+++ b/res/lang/ru.bin
Binary files differ
diff --git a/res/lang/tok.bin b/res/lang/tok.bin
index 3e511a6f..9e36f8b0 100644
--- a/res/lang/tok.bin
+++ b/res/lang/tok.bin
Binary files differ