diff --git a/web/i18n/en/a11y/tabs.json b/web/i18n/en/a11y/tabs.json new file mode 100644 index 00000000..4803a944 --- /dev/null +++ b/web/i18n/en/a11y/tabs.json @@ -0,0 +1,3 @@ +{ + "tabPanel": "tabs panel" +} diff --git a/web/i18n/en/tabs.json b/web/i18n/en/tabs.json new file mode 100644 index 00000000..dcee6f6f --- /dev/null +++ b/web/i18n/en/tabs.json @@ -0,0 +1,7 @@ +{ + "save": "save", + "settings": "settings", + "updates": "updates", + "donate": "donate", + "about": "about" +} diff --git a/web/i18n/languages.json b/web/i18n/languages.json new file mode 100644 index 00000000..0760fe1d --- /dev/null +++ b/web/i18n/languages.json @@ -0,0 +1,4 @@ +{ + "en": "english", + "ru": "русский" +} diff --git a/web/i18n/ru/a11y/tabs.json b/web/i18n/ru/a11y/tabs.json new file mode 100644 index 00000000..2ae32277 --- /dev/null +++ b/web/i18n/ru/a11y/tabs.json @@ -0,0 +1,3 @@ +{ + "tabPanel": "панель вкладок" +} diff --git a/web/i18n/ru/tabs.json b/web/i18n/ru/tabs.json new file mode 100644 index 00000000..be1742b0 --- /dev/null +++ b/web/i18n/ru/tabs.json @@ -0,0 +1,7 @@ +{ + "save": "скачать", + "settings": "настройки", + "updates": "новости", + "donate": "донаты", + "about": "чаво" +} diff --git a/web/package-lock.json b/web/package-lock.json index 9ffdf386..dbf8f2ee 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -12,6 +12,7 @@ "@fontsource-variable/noto-sans-mono": "^5.0.20", "@fontsource/ibm-plex-mono": "^5.0.13", "@tabler/icons-svelte": "^3.6.0", + "sveltekit-i18n": "^2.4.2", "ts-deepmerge": "^7.0.0" }, "devDependencies": { @@ -894,6 +895,21 @@ "vite": "^5.0.0" } }, + "node_modules/@sveltekit-i18n/base": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@sveltekit-i18n/base/-/base-1.3.7.tgz", + "integrity": "sha512-kg1kql1/ro/lIudwFiWrv949Q07gmweln87tflUZR51MNdXXzK4fiJQv5Mw50K/CdQ5BOk/dJ0WOH2vOtBI6yw==", + "license": "MIT", + "peerDependencies": { + "svelte": ">=3.49.0" + } + }, + "node_modules/@sveltekit-i18n/parser-default": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@sveltekit-i18n/parser-default/-/parser-default-1.1.1.tgz", + "integrity": "sha512-/gtzLlqm/sox7EoPKD56BxGZktK/syGc79EbJAPWY5KVitQD9SM0TP8yJCqDxTVPk7Lk0WJhrBGUE2Nn0f5M1w==", + "license": "MIT" + }, "node_modules/@tabler/icons": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-3.6.0.tgz", @@ -3002,6 +3018,22 @@ } } }, + "node_modules/sveltekit-i18n": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/sveltekit-i18n/-/sveltekit-i18n-2.4.2.tgz", + "integrity": "sha512-hjRWn4V4DBL8JQKJoJa3MRvn6d32Zo+rWkoSP5bsQ/XIAguPdQUZJ8LMe6Nc1rST8WEVdu9+vZI3aFdKYGR3+Q==", + "license": "MIT", + "workspaces": [ + "./examples/*/" + ], + "dependencies": { + "@sveltekit-i18n/base": "~1.3.0", + "@sveltekit-i18n/parser-default": "~1.1.0" + }, + "peerDependencies": { + "svelte": ">=3.49.0" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", diff --git a/web/package.json b/web/package.json index 6d2d17e2..a1834827 100644 --- a/web/package.json +++ b/web/package.json @@ -41,6 +41,7 @@ "@fontsource-variable/noto-sans-mono": "^5.0.20", "@fontsource/ibm-plex-mono": "^5.0.13", "@tabler/icons-svelte": "^3.6.0", + "sveltekit-i18n": "^2.4.2", "ts-deepmerge": "^7.0.0" } } diff --git a/web/src/app.html b/web/src/app.html index f39fedca..c3ada304 100644 --- a/web/src/app.html +++ b/web/src/app.html @@ -1,5 +1,5 @@ - + diff --git a/web/src/components/settings/LanguageDropdown.svelte b/web/src/components/settings/LanguageDropdown.svelte new file mode 100644 index 00000000..26c3be91 --- /dev/null +++ b/web/src/components/settings/LanguageDropdown.svelte @@ -0,0 +1,28 @@ + + + diff --git a/web/src/components/sidebar/Sidebar.svelte b/web/src/components/sidebar/Sidebar.svelte index e075da07..35a8e858 100644 --- a/web/src/components/sidebar/Sidebar.svelte +++ b/web/src/components/sidebar/Sidebar.svelte @@ -1,4 +1,6 @@ @@ -38,9 +36,10 @@ href={tabLink} bind:this={tab} on:focus={() => showTab(tab)} + role="tab" > - {tabName} + {$t(`tabs.${tabName}`)}