Skip to content

Commit

Permalink
maint: specify translations explicitly when pulling hints from transifex
Browse files Browse the repository at this point in the history
  • Loading branch information
zyv committed Jan 5, 2023
1 parent 168ec33 commit a7dcbbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion maint/utils/sync-transifex/config.d/mc.hint/po4a.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

[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@
6 changes: 4 additions & 2 deletions maint/utils/sync-transifex/translation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
translations = get_translations(sync_dir)
langs = get_translations(sync_dir)

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("@translations@", " ".join(f"{lang}:var.d/$master/{lang}.po" for lang in translations))

config_path = sync_dir / "po4a.cfg"
config_path.write_text(config)
Expand Down

0 comments on commit a7dcbbb

Please sign in to comment.