mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-25 14:05:57 +00:00
Add a Brazilian Portuguese catalog for the installer window and the launcher
The installer had English and Russian. installer/text/pt-BR.json covers every id with the same placeholders; the window offers PT-BR beside EN and RU and picks it when the Windows display language is Portuguese (Brazil), LANGID 0x0416; Portugal's Portuguese stays English. make_release.py writes LAUNCHER_*_PT_BR into launcher_text.h and the launcher shows it on the same LANGID. The catalog tests check every window language against English.
This commit is contained in:
1 parent
adf9c768c3
commit
1e32d605ce
7 files changed
+217
-29
No files matched your search
@@ -390,12 +390,14 @@ def c_wide(text):
|
||||
|
||||
|
||||
def launcher_header(path):
|
||||
"""launcher_text.h: the launcher's two messages in English and Russian, taken from the installer's catalog."""
|
||||
lines = ['/* generated by tools/make_release.py from installer/text/{en,ru}.json */']
|
||||
for lang in ('en', 'ru'):
|
||||
"""launcher_text.h: the launcher's two messages in English, Russian and Brazilian Portuguese, taken from the
|
||||
installer's catalog (LAUNCHER_TITLE_PT_BR for pt-BR.json)."""
|
||||
lines = ['/* generated by tools/make_release.py from installer/text/{en,ru,pt-BR}.json */']
|
||||
for lang in ('en', 'ru', 'pt-BR'):
|
||||
texts = json.loads((ROOT / 'installer' / 'text' / f'{lang}.json').read_text(encoding='utf-8'))
|
||||
for key in ('title', 'python_missing'):
|
||||
lines.append(f'#define LAUNCHER_{key.upper()}_{lang.upper()} {c_wide(texts["launcher." + key])}')
|
||||
macro = f'LAUNCHER_{key.upper()}_{lang.upper().replace("-", "_")}'
|
||||
lines.append(f'#define {macro} {c_wide(texts["launcher." + key])}')
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_text('\n'.join(lines) + '\n', encoding='ascii')
|
||||
|
||||
|
||||
Reference in new issue
Block a user