From 9e6d5a6e4bcbe564e795e4aacd772b174e8fad11 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 12:44:19 +0100 Subject: [PATCH 1/4] fix(deps): update dependency mysql2 to v3.12.0 (#3214) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 90a0fafb78..7b2db75ca2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "express": "4.21.2", "jquery": "3.7.1", "morgan": "1.10.0", - "mysql2": "3.11.5", + "mysql2": "3.12.0", "ngx-toastr": "19.0.0", "ngx-ui-switch": "15.0.0", "node-fetch": "2.7.0", @@ -19304,9 +19304,9 @@ } }, "node_modules/mysql2": { - "version": "3.11.5", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.5.tgz", - "integrity": "sha512-0XFu8rUmFN9vC0ME36iBvCUObftiMHItrYFhlCRvFWbLgpNqtC4Br/NmZX1HNCszxT0GGy5QtP+k3Q3eCJPaYA==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.12.0.tgz", + "integrity": "sha512-C8fWhVysZoH63tJbX8d10IAoYCyXy4fdRFz2Ihrt9jtPILYynFEKUUzpp1U7qxzDc3tMbotvaBH+sl6bFnGZiw==", "license": "MIT", "dependencies": { "aws-ssl-profiles": "^1.1.1", diff --git a/package.json b/package.json index 752cac35c4..4f76599918 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "express": "4.21.2", "jquery": "3.7.1", "morgan": "1.10.0", - "mysql2": "3.11.5", + "mysql2": "3.12.0", "ngx-toastr": "19.0.0", "ngx-ui-switch": "15.0.0", "node-fetch": "2.7.0", From 262ad479450e7e0d995e3af4a7e5438c00218eda Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Dec 2024 12:47:49 +0100 Subject: [PATCH 2/4] chore(deps): update dependency highlight.js to v11.11.1 (#3216) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b2db75ca2..81cbb366c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,7 +76,7 @@ "eslint": "8.57.1", "eslint-plugin-playwright": "1.6.0", "eslint-plugin-prettier": "5.2.1", - "highlight.js": "11.11.0", + "highlight.js": "11.11.1", "husky": "9.1.7", "jasmine-core": "5.5.0", "jasmine-spec-reporter": "7.0.0", @@ -15463,9 +15463,9 @@ } }, "node_modules/highlight.js": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.11.0.tgz", - "integrity": "sha512-6ErL7JlGu2CNFHyRQEuDogOyGPNiqcuWdt4iSSFUPyferNTGlNTPFqeV36Y/XwA4V/TJ8l0sxp6FTnxud/mf8g==", + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.11.1.tgz", + "integrity": "sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w==", "dev": true, "license": "BSD-3-Clause", "engines": { diff --git a/package.json b/package.json index 4f76599918..72b751b943 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "eslint": "8.57.1", "eslint-plugin-playwright": "1.6.0", "eslint-plugin-prettier": "5.2.1", - "highlight.js": "11.11.0", + "highlight.js": "11.11.1", "husky": "9.1.7", "jasmine-core": "5.5.0", "jasmine-spec-reporter": "7.0.0", From a1a8269e80dbb1fafece812172a93f83a895ac3e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Dec 2024 18:16:36 +0100 Subject: [PATCH 3/4] chore(deps): update dependency @swc/core to v1.10.2 (#3217) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 86 +++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index 81cbb366c6..109621cc8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7740,9 +7740,9 @@ } }, "node_modules/@swc/core": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.10.1.tgz", - "integrity": "sha512-rQ4dS6GAdmtzKiCRt3LFVxl37FaY1cgL9kSUTnhQ2xc3fmHOd7jdJK/V4pSZMG1ruGTd0bsi34O2R0Olg9Zo/w==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.10.2.tgz", + "integrity": "sha512-d3reIYowBL6gbp4jC6FRZ3hE0eWcWwqh0XcHd6k5rKF/oZA6jLb7gxIRduJhrn+jyLz/HCC8WyfomUkEcs7iZQ==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -7758,16 +7758,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.10.1", - "@swc/core-darwin-x64": "1.10.1", - "@swc/core-linux-arm-gnueabihf": "1.10.1", - "@swc/core-linux-arm64-gnu": "1.10.1", - "@swc/core-linux-arm64-musl": "1.10.1", - "@swc/core-linux-x64-gnu": "1.10.1", - "@swc/core-linux-x64-musl": "1.10.1", - "@swc/core-win32-arm64-msvc": "1.10.1", - "@swc/core-win32-ia32-msvc": "1.10.1", - "@swc/core-win32-x64-msvc": "1.10.1" + "@swc/core-darwin-arm64": "1.10.2", + "@swc/core-darwin-x64": "1.10.2", + "@swc/core-linux-arm-gnueabihf": "1.10.2", + "@swc/core-linux-arm64-gnu": "1.10.2", + "@swc/core-linux-arm64-musl": "1.10.2", + "@swc/core-linux-x64-gnu": "1.10.2", + "@swc/core-linux-x64-musl": "1.10.2", + "@swc/core-win32-arm64-msvc": "1.10.2", + "@swc/core-win32-ia32-msvc": "1.10.2", + "@swc/core-win32-x64-msvc": "1.10.2" }, "peerDependencies": { "@swc/helpers": "*" @@ -7779,9 +7779,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.10.1.tgz", - "integrity": "sha512-NyELPp8EsVZtxH/mEqvzSyWpfPJ1lugpTQcSlMduZLj1EASLO4sC8wt8hmL1aizRlsbjCX+r0PyL+l0xQ64/6Q==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.10.2.tgz", + "integrity": "sha512-xPDbCUfGdVjA/0yhRFVSyog73wO3/W3JNgx1PkOcCc+0OgZtgAnt4YD8QbSsUE+euc5bQJs/7HfJQ3305+HWVA==", "cpu": [ "arm64" ], @@ -7796,9 +7796,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.10.1.tgz", - "integrity": "sha512-L4BNt1fdQ5ZZhAk5qoDfUnXRabDOXKnXBxMDJ+PWLSxOGBbWE6aJTnu4zbGjJvtot0KM46m2LPAPY8ttknqaZA==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.10.2.tgz", + "integrity": "sha512-Dm4R9ffQw4yrGjvdYxxuO5RViwkRkSsn64WF7YGYZIlhkyFoseibPnQlOsx5qnjquc8f3h1C8/806XG+y3rMaQ==", "cpu": [ "x64" ], @@ -7813,9 +7813,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.10.1.tgz", - "integrity": "sha512-Y1u9OqCHgvVp2tYQAJ7hcU9qO5brDMIrA5R31rwWQIAKDkJKtv3IlTHF0hrbWk1wPR0ZdngkQSJZple7G+Grvw==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.10.2.tgz", + "integrity": "sha512-aXTqgel7AueM7CcCOFFUq6+gJyD/A3rFBWxPT6wA34IC7oQ0IIFpJjBLl8zN6/0aZ4OQ1ExlQ7zoKaTlk5tBug==", "cpu": [ "arm" ], @@ -7830,9 +7830,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.10.1.tgz", - "integrity": "sha512-tNQHO/UKdtnqjc7o04iRXng1wTUXPgVd8Y6LI4qIbHVoVPwksZydISjMcilKNLKIwOoUQAkxyJ16SlOAeADzhQ==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.10.2.tgz", + "integrity": "sha512-HYFag6ULpnVMnHuKKAFuZH3kco/2eKKZ24I+gI2M4JlIW4soDmP8Oc2eAADIloln4SfQXzADX34m6merCWp65g==", "cpu": [ "arm64" ], @@ -7847,9 +7847,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.10.1.tgz", - "integrity": "sha512-x0L2Pd9weQ6n8dI1z1Isq00VHFvpBClwQJvrt3NHzmR+1wCT/gcYl1tp9P5xHh3ldM8Cn4UjWCw+7PaUgg8FcQ==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.10.2.tgz", + "integrity": "sha512-N8es+V+M9GijYsxfiIG3NJ+lHgoZosX+yjblc5eOx0xrBDeqH3kNLhJpctOczrJk0rUjN+zX5x+8H8qurcEAaw==", "cpu": [ "arm64" ], @@ -7864,9 +7864,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.10.1.tgz", - "integrity": "sha512-yyYEwQcObV3AUsC79rSzN9z6kiWxKAVJ6Ntwq2N9YoZqSPYph+4/Am5fM1xEQYf/kb99csj0FgOelomJSobxQA==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.10.2.tgz", + "integrity": "sha512-fI4rxJkWQaNeG4UcuqKJrc1JM+nAwIzzFba9+A4Aohc6z0EgPokrA1v7WmPUObO+cdZjVXdMpDGkhGQhbok1aQ==", "cpu": [ "x64" ], @@ -7881,9 +7881,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.10.1.tgz", - "integrity": "sha512-tcaS43Ydd7Fk7sW5ROpaf2Kq1zR+sI5K0RM+0qYLYYurvsJruj3GhBCaiN3gkzd8m/8wkqNqtVklWaQYSDsyqA==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.10.2.tgz", + "integrity": "sha512-ycDOxBgII/2xkusMgq2S9n81IQ8SeWk1FU0zuUsZrUkaXEq/78+nHFo/0IStPLrtRxzG2gJ0JZvfaa6jMxr79Q==", "cpu": [ "x64" ], @@ -7898,9 +7898,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.10.1.tgz", - "integrity": "sha512-D3Qo1voA7AkbOzQ2UGuKNHfYGKL6eejN8VWOoQYtGHHQi1p5KK/Q7V1ku55oxXBsj79Ny5FRMqiRJpVGad7bjQ==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.10.2.tgz", + "integrity": "sha512-s7/UrbdfYGdUar+Nj8jxNeXaFdryWnKuJU5udDONgk9gb1xp7K5TPxBL9j7EtCrAenM2sR9Bd84ZemwzyZ/VLw==", "cpu": [ "arm64" ], @@ -7915,9 +7915,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.10.1.tgz", - "integrity": "sha512-WalYdFoU3454Og+sDKHM1MrjvxUGwA2oralknXkXL8S0I/8RkWZOB++p3pLaGbTvOO++T+6znFbQdR8KRaa7DA==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.10.2.tgz", + "integrity": "sha512-sz8f+dmrzb816Ji25G+vs8HMq6zHq1IMKF4hVUnSJKdNr2k789+qRjF1fnv3YDcz5kkeYSvolXqVS1mCezDebg==", "cpu": [ "ia32" ], @@ -7932,9 +7932,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.10.1.tgz", - "integrity": "sha512-JWobfQDbTnoqaIwPKQ3DVSywihVXlQMbDuwik/dDWlj33A8oEHcjPOGs4OqcA3RHv24i+lfCQpM3Mn4FAMfacA==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.10.2.tgz", + "integrity": "sha512-XXYHuc5KdhuLx1nP8cEKW+5Kakxy+iq/jcuJ52+27E2uB+xxzLeXvbPvz645je3Cti5nQ4la2HIn6tpST5ufSw==", "cpu": [ "x64" ], From 4442cc81466295e5a84c0627c7264918879044c3 Mon Sep 17 00:00:00 2001 From: Exitare Date: Fri, 27 Dec 2024 05:00:07 -0800 Subject: [PATCH 4/4] ci: add new workflow to sync i18n files (#3215) --- .github/workflows/sync_i18n.yml | 41 +++++++++++++++++++++++++++ scripts/sync_i18n.py | 49 +++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 .github/workflows/sync_i18n.yml create mode 100644 scripts/sync_i18n.py diff --git a/.github/workflows/sync_i18n.yml b/.github/workflows/sync_i18n.yml new file mode 100644 index 0000000000..f46461d2e9 --- /dev/null +++ b/.github/workflows/sync_i18n.yml @@ -0,0 +1,41 @@ +name: Check and Fix Missing Translation Keys + +on: + push: + branches: + - '**' + pull_request: + branches: + - main + +jobs: + check-translation-keys: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install dependencies + run: pip install json-delta + + - name: Run Python script to check and fix missing keys + run: | + python scripts/sync_i18n.py + + - name: Commit and push changes if necessary + run: | + if [ "$(git status --porcelain)" != "" ]; then + git config user.name "i18n Sync Bot" + git config user.email "action@github.com" + git add apps/keira/src/assets/i18n/*.json + git commit -m "Fix missing translation keys" + git push + else + echo "No missing keys detected." + fi diff --git a/scripts/sync_i18n.py b/scripts/sync_i18n.py new file mode 100644 index 0000000000..e13bc2f455 --- /dev/null +++ b/scripts/sync_i18n.py @@ -0,0 +1,49 @@ +import os +import json +from pathlib import Path + +def merge_with_en(en_data: dict, target_data: dict) -> dict: + """ + Recursively merge en.json keys into target translation file. + - Adds missing keys from en.json. + - Preserves existing keys and values in the target file. + - Removes keys not present in en.json. + """ + merged = {} + for key, value in en_data.items(): + if key in target_data: + # If key exists in both, check if it's a nested dictionary + if isinstance(value, dict) and isinstance(target_data[key], dict): + merged[key] = merge_with_en(value, target_data[key]) + else: + merged[key] = target_data[key] # Preserve existing value + else: + merged[key] = value # Add missing key with value from en.json + + return merged + +def sync_keys(translations_dir: Path, en_file: Path) -> None: + # Load en.json as the reference file + with open(en_file, 'r', encoding='utf-8') as f: + en_data = json.load(f) + + for file in os.listdir(translations_dir): + if file.endswith('.json') and file != os.path.basename(en_file): + file_path = os.path.join(translations_dir, file) + with open(file_path, 'r', encoding='utf-8') as f: + target_data = json.load(f) + + # Synchronize keys with en.json + synced_data = merge_with_en(en_data, target_data) + + # Save the synchronized file + with open(file_path, 'w', encoding='utf-8') as f: + json.dump(synced_data, f, ensure_ascii=False, indent=2) + + print(f"Synced {file}") + + +if __name__ == "__main__": + translations_dir = Path("apps", "keira", "src", "assets", "i18n") # Update to your directory + en_file = Path(translations_dir, "en.json") + sync_keys(translations_dir, en_file)