Skip to content

Commit

Permalink
Update config.toml only for generated languages
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Tsisyk <[email protected]>
  • Loading branch information
rtsisyk committed Jan 28, 2023
1 parent 30e0399 commit ade4d17
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/update-zola-translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
# Merge changes from .po files into config.yaml
languages = config['languages']
sources = config['translations']
for po_path in glob('po/content.*.po'):
lang = po_path.removeprefix('po/content.').removesuffix('.po')
for index_path in glob('content/_index.*.md'):
lang = index_path.removeprefix('content/_index.').removesuffix('.md')
po_path = f"po/content.{lang}.po"
if not os.path.exists(po_path):
continue

# Add a new section to TOML if needed
if lang not in languages:
Expand Down

0 comments on commit ade4d17

Please sign in to comment.