From c4627a9305987728fa3be8dcddeb2ba796e7cc68 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 4 Apr 2026 13:17:13 +0200 Subject: [PATCH] weblate-sync: include uucore locales in sync workflow --- .github/workflows/weblate-sync.yml | 9 +++++---- .weblate | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/weblate-sync.yml b/.github/workflows/weblate-sync.yml index 71ec01a8..fd7d7ef7 100644 --- a/.github/workflows/weblate-sync.yml +++ b/.github/workflows/weblate-sync.yml @@ -13,6 +13,7 @@ on: branches: [ main ] paths: - 'src/uu/*/locales/en-US.ftl' + - 'src/uucore/locales/en-US.ftl' - 'src/uu/*/src/*.rs' jobs: @@ -52,7 +53,7 @@ jobs: - name: Fix Fluent syntax issues run: | # Ensure all .ftl files end with a newline - find src/uu/*/locales -name "*.ftl" -type f | while read -r f; do + find src/uu/*/locales src/uucore/locales -name "*.ftl" -type f | while read -r f; do if [ -s "$f" ] && [ "$(tail -c1 "$f" | wc -l)" -eq 0 ]; then echo "" >> "$f" echo "Fixed missing newline: $f" @@ -60,7 +61,7 @@ jobs: done # Fix ## group comments to # single comments (Fluent syntax) - find src/uu/*/locales -name "*.ftl" -type f | while read -r f; do + find src/uu/*/locales src/uucore/locales -name "*.ftl" -type f | while read -r f; do if grep -qP '^## ' "$f"; then sed -i 's/^## /# /' "$f" echo "Fixed ## comments: $f" @@ -70,7 +71,7 @@ jobs: - name: Validate Fluent syntax run: | has_errors=false - for dir in $(find src/uu/*/locales -name "*.ftl" -type f -exec dirname {} \; | sort -u); do + for dir in $(find src/uu/*/locales src/uucore/locales -name "*.ftl" -type f -exec dirname {} \; | sort -u); do if ! moz-fluent-lint --config .github/fluent_linter_config.yml "$dir"; then echo "::warning::Fluent syntax issues in $dir" has_errors=true @@ -86,7 +87,7 @@ jobs: git config --local user.name "GitHub Action" if [ -n "$(git status --porcelain)" ]; then - git add src/uu/*/locales/*.ftl + git add src/uu/*/locales/*.ftl src/uucore/locales/*.ftl git commit -m "Update translations from Weblate" git push else diff --git a/.weblate b/.weblate index 58672b5d..b3907cb6 100644 --- a/.weblate +++ b/.weblate @@ -25,6 +25,11 @@ fluent_monolingual = true base_file_template = src/uu/*/locales/en-US.ftl filemask = src/uu/*/locales/*.ftl +# uucore shared strings +[files.uucore] +base_file_template = src/uucore/locales/en-US.ftl +filemask = src/uucore/locales/*.ftl + # GitHub integration [github] # Enable repository webhooks for automatic sync