Skip to content

Comments

ci(port,i18n): pull translations from Transifex directly#7833

Draft
scarf005 wants to merge 5 commits intocataclysmbn:mainfrom
scarf005:build/i18n-ci/pull-translations-in-ci
Draft

ci(port,i18n): pull translations from Transifex directly#7833
scarf005 wants to merge 5 commits intocataclysmbn:mainfrom
scarf005:build/i18n-ci/pull-translations-in-ci

Conversation

@scarf005
Copy link
Member

@scarf005 scarf005 commented Jan 8, 2026

Purpose of change (The Why)

Similar to CleverRaven/Cataclysm-DDA#84375. Currently, translation files are committed to the repository and updated daily via automated workflow. This causes:

  • Repository bloat from daily translation update commits
  • Translation lag (releases only get translations from last daily pull, not latest)
  • Unnecessary git history noise

Describe the solution (The How)

Port DDA's approach: pull translations from Transifex during CI builds instead of daily commits.

New workflow (.github/workflows/build-translations.yml)

  • Pulls translations from Transifex during CI builds
  • Validates .po files and generates statistics
  • Uploads translations as artifacts

Updated workflows

  • release.yml - Added build-translations as dependency
  • build.yml - Downloads translation artifacts before building (with continue-on-error for forks)

How 2 Translation

  • lang/update_stats.sh - Generates translation statistics
  • lang/discard_invalid_po.sh - Validates .po files from Transifex
  • lang/po/placeholder.po - Minimal .po file for builds without Transifex access
  • lang/CMakeLists.txt - Updated to skip placeholder.po

Documentation

  • Added guide in building docs explaining how to build with translations locally

Describe alternatives you've considered

  • Keep current system: repo bloat noooooooooooo
  • Store translations separately: could work but it's easier to just tx pull

Testing

tested on https://github.com/scarf005/Cataclysm-BN/actions/runs/21029703506

verified artifact contains:

  • lang/po/ with 25 translation files (ar, da, de, el, es_AR, es_ES, fr, hu, id, is, it_IT, ja, ko, nb, nl, pl_PL, pt_BR, ru_RU, sr, tr, uk, uk_UA, zh_CN, zh_TW)
  • src/lang_stats.inc with translation statistics

Checklist

Mandatory

Optional

  • This PR ports commits from DDA or other cataclysm forks.
    • I have added port scope to the PR title.
    • I have attributed original authors in the commit messages adding Co-Authored-By in the commit message.
    • I have linked the URL of original PR(s) in the description.
  • This is a PR that modifies build process or code organization.
    • Please document the changes in the appropriate location in the docs/ folder.
    • If documentation for this feature or process does not exist, please write it.
    • If the change alters versions of software required to build or work with the game, please document it.

@github-actions github-actions bot added docs PRs releated to docs page translation labels Jan 8, 2026
…commits

- Create build-translations workflow to pull from Transifex during builds
- Update release workflow to build translations before main builds
- Update build workflow to download translation artifacts
- Add placeholder.po for builds without Transifex access
- Add lang/update_stats.sh to generate translation statistics
- Add lang/discard_invalid_po.sh to validate .po files
- Update lang/CMakeLists.txt to skip placeholder.po
- Document how to build with translations locally

This reduces repository size and ensures translations are always current
in releases without daily commit noise from automated translation pulls.

Co-authored-by: harakka <harakka@users.noreply.github.com>
@scarf005 scarf005 force-pushed the build/i18n-ci/pull-translations-in-ci branch from b265a76 to 079472d Compare January 8, 2026 07:31
@scarf005 scarf005 changed the title build(i18n): pull translations from Transifex in CI instead of daily commits build(port,i18n): pull translations from Transifex in CI instead of daily commits Jan 8, 2026
@scarf005 scarf005 changed the title build(port,i18n): pull translations from Transifex in CI instead of daily commits ci(port,i18n): pull translations from Transifex in CI instead of daily commits Jan 9, 2026
@scarf005 scarf005 changed the title ci(port,i18n): pull translations from Transifex in CI instead of daily commits ci(port,i18n): pull translations from Transifex directly Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs PRs releated to docs page translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant