diff --git a/.github/workflows/static_analysis.yaml b/.github/workflows/static_analysis.yaml index 93f83956eb..d191ecd6b1 100644 --- a/.github/workflows/static_analysis.yaml +++ b/.github/workflows/static_analysis.yaml @@ -44,7 +44,10 @@ jobs: files_ignore: | src/i18n/strings/en_EN.json - name: "Assert only en_EN was modified" - if: github.event_name == 'pull_request' && steps.changed_files.outputs.any_modified == 'true' + if: | + github.event_name == 'pull_request' && + github.actor != 'RiotTranslateBot' && + steps.changed_files.outputs.any_modified == 'true' run: | echo "You can only modify en_EN.json, do not touch any of the other i18n files as Weblate will be confused" exit 1 diff --git a/scripts/copy-res.js b/scripts/copy-res.js index 8d91092fdb..58a9885134 100755 --- a/scripts/copy-res.js +++ b/scripts/copy-res.js @@ -232,8 +232,14 @@ function weblateToCounterpart(inTrs) { if (keyParts.length === 2) { let obj = outTrs[keyParts[0]]; if (obj === undefined) { - obj = {}; - outTrs[keyParts[0]] = obj; + obj = outTrs[keyParts[0]] = {}; + } else if (typeof obj === "string") { + // This is a transitional edge case if a string went from singular to pluralised and both still remain + // in the translation json file. Use the singular translation as `other` and merge pluralisation atop. + obj = outTrs[keyParts[0]] = { + "other": inTrs[key], + }; + console.warn("Found entry in i18n file in both singular and pluralised form", keyParts[0]); } obj[keyParts[1]] = inTrs[key]; } else {