Skip to content

Commit ade4d17

Browse files
committed
Update config.toml only for generated languages
Signed-off-by: Roman Tsisyk <roman@tsisyk.com>
1 parent 30e0399 commit ade4d17

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tools/update-zola-translations.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@
2121
# Merge changes from .po files into config.yaml
2222
languages = config['languages']
2323
sources = config['translations']
24-
for po_path in glob('po/content.*.po'):
25-
lang = po_path.removeprefix('po/content.').removesuffix('.po')
24+
for index_path in glob('content/_index.*.md'):
25+
lang = index_path.removeprefix('content/_index.').removesuffix('.md')
26+
po_path = f"po/content.{lang}.po"
27+
if not os.path.exists(po_path):
28+
continue
2629

2730
# Add a new section to TOML if needed
2831
if lang not in languages:

0 commit comments

Comments
 (0)