From c4475f7d10b885bc863e5046194dae2a46e65d0c Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 6 Oct 2026 23:45:46 -0400 Subject: [PATCH] fix(l10n): keep JavaScript extraction consistent across platforms --- .gitattributes | 3 +++ .github/workflows/localize.yml | 15 +++++++++------ locale/themerr.po | 12 ++++++------ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.gitattributes b/.gitattributes index 9d1dd53a..3bbea632 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,7 @@ Dockerfile text eol=lf +# Keep Babel's JavaScript source references consistent across platforms. +*.js text eol=lf + # Match the C# line endings required by .editorconfig on every platform. *.cs text eol=crlf diff --git a/.github/workflows/localize.yml b/.github/workflows/localize.yml index fd7c3011..6b6a8abf 100644 --- a/.github/workflows/localize.yml +++ b/.github/workflows/localize.yml @@ -6,6 +6,7 @@ env: PYTHON_VERSION: '3.14' on: + pull_request: push: branches: - master @@ -44,19 +45,21 @@ jobs: - name: Update Strings run: uv run --locked --no-build --no-sync python ./scripts/localize.py --extract - - name: git diff + - name: Check locale template run: | - # disable the pager - git config --global pager.diff false - - # print the git diff - git diff locale/themerr.po + if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then + git --no-pager diff --exit-code -- locale/themerr.po + else + git --no-pager diff -- locale/themerr.po + fi - name: Get current date + if: ${{ github.event_name != 'pull_request' }} id: date run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" - name: Create/Update Pull Request + if: ${{ github.event_name != 'pull_request' }} uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 with: add-paths: | diff --git a/locale/themerr.po b/locale/themerr.po index 05240dd7..31b385bc 100644 --- a/locale/themerr.po +++ b/locale/themerr.po @@ -651,27 +651,27 @@ msgstr "" msgid "No cookies saved" msgstr "" -#: web/js/config.js:82 web/js/config.js:124 +#: web/js/config.js:81 web/js/config.js:123 msgid "Unsaved changes" msgstr "" -#: web/js/config.js:90 +#: web/js/config.js:89 msgid "Discard unsaved settings changes?" msgstr "" -#: web/js/config.js:124 web/templates/config.html:40 +#: web/js/config.js:123 web/templates/config.html:40 msgid "All changes saved." msgstr "" -#: web/js/config.js:126 +#: web/js/config.js:125 msgid "Settings saved. Network changes take effect after restarting Themerr." msgstr "" -#: web/js/config.js:130 +#: web/js/config.js:129 msgid "Unable to save changes." msgstr "" -#: web/js/config.js:138 +#: web/js/config.js:137 msgid "Save your settings changes before changing your password." msgstr ""