maint: specify translations explicitly when pulling hints from transifex

This commit is contained in:
Yury V. Zaytsev 2023-01-05 22:02:36 +01:00
parent 168ec3307a
commit a7dcbbbdf7
2 changed files with 5 additions and 3 deletions

View File

@ -2,4 +2,4 @@
[options] --master-charset UTF-8 --localized-charset UTF-8 --keep 5 --wrap-po no [options] --master-charset UTF-8 --localized-charset UTF-8 --keep 5 --wrap-po no
[type:asciidoc] @srcdir@/doc/hints/mc.hint $lang:@srcdir@/doc/hints/l10n/mc.hint.$lang [type:asciidoc] @srcdir@/doc/hints/mc.hint @resources@

View File

@ -14,12 +14,14 @@ def init_sync_dir(root_dir: Path, resource: str) -> Path:
def create_po4a_config(sync_dir: Path, script_dir: Path, source_dir: Path, resource: str) -> Path: def create_po4a_config(sync_dir: Path, script_dir: Path, source_dir: Path, resource: str) -> Path:
translations = get_translations(sync_dir) langs = get_translations(sync_dir)
config = get_config_file(script_dir, resource, "po4a.cfg").read_text() config = get_config_file(script_dir, resource, "po4a.cfg").read_text()
config = config.replace("@translations@", " ".join(f"{lang}:var.d/$master/{lang}.po" for lang in langs))
config = config.replace("@resources@", " ".join(f"{lang}:@srcdir@/doc/hints/l10n/mc.hint.{lang}" for lang in langs))
config = config.replace("@srcdir@", str(source_dir)) config = config.replace("@srcdir@", str(source_dir))
config = config.replace("@translations@", " ".join(f"{lang}:var.d/$master/{lang}.po" for lang in translations))
config_path = sync_dir / "po4a.cfg" config_path = sync_dir / "po4a.cfg"
config_path.write_text(config) config_path.write_text(config)