diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9bd7ce4fda748a5bd3df4455f6e9997a405e249a..47ad085c1c84109e054dde6b3ac37ece78ea3b37 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -290,7 +290,6 @@ build_front: - cd front script: - yarn install - - yarn run i18n-compile # this is to ensure we don't have any errors in the output, # cf https://dev.funkwhale.audio/funkwhale/funkwhale/issues/169 - yarn run build:deployment | tee /dev/stderr | (! grep -i 'ERROR in') diff --git a/.gitpod.yml b/.gitpod.yml index ddc67c6a25df6b448b4af695bba5d419fe0d374c..0f6e928570612c0d140afdf0dd760ba066569793 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -37,7 +37,6 @@ tasks: before: cd front init: | yarn install - yarn run i18n-compile command: yarn dev --host 0.0.0.0 --base /front/ - name: Welcome to Funkwhale development! diff --git a/.vscode/settings.json b/.vscode/settings.json index c4ad2bf022935c48b56c4719b2d0d83c7d1adacd..5e36906304447fa20cdc830e9503ebaf3d6d853f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,9 @@ "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, "vitest.enable": true, - "vitest.commandLine": "yarn vitest" + "vitest.commandLine": "yarn vitest", + "i18n-ally.localesPaths": ["front/src/locales"], + "i18n-ally.pathMatcher": "*.json", + "i18n-ally.enabledFrameworks": ["vue"], + "i18n-ally.keystyle": "nested" } diff --git a/changes/changelog.d/1831.enhancement b/changes/changelog.d/1831.enhancement new file mode 100644 index 0000000000000000000000000000000000000000..8a90514ec033c27307fad15fa4de2c2a2f75501a --- /dev/null +++ b/changes/changelog.d/1831.enhancement @@ -0,0 +1,2 @@ +Migrate to vue-i18n (#1831) +Fix locale changing (#1862) diff --git a/front/.eslintrc.js b/front/.eslintrc.js index 343c62e278c8ca42cefe8f1987ca38db6379ea34..1a89bdda37b424492d94e03ea89fe3a4a780d59f 100644 --- a/front/.eslintrc.js +++ b/front/.eslintrc.js @@ -4,6 +4,7 @@ module.exports = { es6: true }, extends: [ + 'plugin:@intlify/vue-i18n/recommended', 'plugin:vue/vue3-recommended', '@vue/typescript/recommended', '@vue/standard' @@ -32,6 +33,17 @@ module.exports = { 'no-redeclare': 'off', 'no-undef': 'off', + // NOTE: i18n + '@intlify/vue-i18n/no-deprecated-i18n-component': 'error', + '@intlify/vue-i18n/valid-message-syntax': 'error', + '@intlify/vue-i18n/no-i18n-t-path-prop': 'error', + '@intlify/vue-i18n/no-missing-keys': 'error', + '@intlify/vue-i18n/no-dynamic-keys': 'error', + '@intlify/vue-i18n/no-unused-keys': ['error', { + extensions: ['.ts', '.vue'], + enableFix: true + }], + // TODO (wvffle): Remove after VUI and #1618 'vue/multi-word-component-names': 'off', 'import/extensions': 'off', @@ -50,6 +62,16 @@ module.exports = { // brings comments support for the