diff --git a/backend/locales/en/BranchSelect.json b/backend/locales/en/BranchSelect.json index 2960d18a..016b720d 100644 --- a/backend/locales/en/BranchSelect.json +++ b/backend/locales/en/BranchSelect.json @@ -1,3 +1,5 @@ { - "update_channel_label": "Update Channel" + "update_channel":{ + "label": "Update Channel" + } } diff --git a/backend/locales/en/DeveloperIndex.json b/backend/locales/en/DeveloperIndex.json index b87d1e1b..e8849a7e 100644 --- a/backend/locales/en/DeveloperIndex.json +++ b/backend/locales/en/DeveloperIndex.json @@ -1,7 +1,11 @@ { - "valve_internal_label": "Enable Valve Internal", - "valve_internal_desc1": "Enables the Valve internal developer menu.", - "valve_internal_desc2": "Do not touch anything in this menu unless you know what it does.", - "react_devtools_label": "Enable React DevTools", - "react_devtools_desc": "Enables connection to a computer running React DevTools. Changing this setting will reload Steam. Set the IP address before enabling." + "valve_internal":{ + "label": "Enable Valve Internal", + "desc1": "Enables the Valve internal developer menu.", + "desc2": "Do not touch anything in this menu unless you know what it does." + }, + "react_devtools":{ + "label": "Enable React DevTools", + "desc": "Enables connection to a computer running React DevTools. Changing this setting will reload Steam. Set the IP address before enabling." + } } diff --git a/backend/locales/en/PluginInstallModal.json b/backend/locales/en/PluginInstallModal.json index 20742aca..800958b2 100644 --- a/backend/locales/en/PluginInstallModal.json +++ b/backend/locales/en/PluginInstallModal.json @@ -1,7 +1,8 @@ { - "install_title": "Install {{artifact}}", - "install_desc": "Are you sure you want to install {{artifact}} {{version}}?", - "install_button_idle": "Install", - "install_button_processing": "Installing" - + "install":{ + "title": "Install {{artifact}}", + "desc": "Are you sure you want to install {{artifact}} {{version}}?", + "button_idle": "Install", + "button_processing": "Installing" + } } \ No newline at end of file diff --git a/backend/locales/en/RemoteDebugging.json b/backend/locales/en/RemoteDebugging.json index 2a07349e..052f0d39 100644 --- a/backend/locales/en/RemoteDebugging.json +++ b/backend/locales/en/RemoteDebugging.json @@ -1,4 +1,6 @@ { - "remote_cef_label": "Allow Remote CEF Debugging", - "remote_cef_desc": "Allow unauthenticated access to the CEF debugger to anyone in your network" + "remote_cef":{ + "label": "Allow Remote CEF Debugging", + "desc": "Allow unauthenticated access to the CEF debugger to anyone in your network" + } } diff --git a/backend/locales/en/SettingsGeneralIndex.json b/backend/locales/en/SettingsGeneralIndex.json index bee4a73b..2c32c27e 100644 --- a/backend/locales/en/SettingsGeneralIndex.json +++ b/backend/locales/en/SettingsGeneralIndex.json @@ -1,6 +1,10 @@ { - "developer_mode_label": "Developer mode", - "developer_mode_desc": "Enables Decky's developer settings.", - "manual_plugin_label": "Manual plugin install", - "manual_plugin_install_button": "Install" + "developer_mode":{ + "label": "Developer mode", + "desc": "Enables Decky's developer settings." + }, + "manual_plugin":{ + "label": "Manual plugin install", + "button": "Install" + } } diff --git a/backend/locales/en/Store.json b/backend/locales/en/Store.json index e2fec4eb..ba8a3403 100644 --- a/backend/locales/en/Store.json +++ b/backend/locales/en/Store.json @@ -1,19 +1,28 @@ { - "store_tabs_title": "Browse", - "store_tabs_about": "About", + "store_tabs":{ + "title": "Browse", + "about": "About", - "store_tabs_alph_desc": "Alphabetical (A to Z)", - "store_tabs_alph_asce": "Alphabetical (Z to A)", - - "store_sort_label": "Sort", - "store_sort_label_def": "Last Updated (Newest)", - "store_filter_label": "Filter", - "store_fiter_label_def": "All", + "alph_desc": "Alphabetical (A to Z)", + "alph_asce": "Alphabetical (Z to A)" + }, + "store_sort":{ + "label": "Sort", + "label_def": "Last Updated (Newest)" + }, + "store_filter":{ + "label": "Filter", + "label_def": "All" + }, "store_search_label": "Search", "store_testing_cta": "Please consider testing new plugins to help the Decky Loader team!", - "store_contrib_label": "Contributing", - "store_contrib_desc": "If you would like to contribute to the Decky Plugin Store, check the SteamDeckHomebrew/decky-plugin-template repository on GitHub. Information on development and distribution is available in the README.", - "store_source_label": "Source Code", - "store_source_desc": "All plugin source code is available on SteamDeckHomebrew/decky-plugin-database repository on GitHub." + "store_contrib":{ + "label": "Contributing", + "desc": "If you would like to contribute to the Decky Plugin Store, check the SteamDeckHomebrew/decky-plugin-template repository on GitHub. Information on development and distribution is available in the README." + }, + "store_source":{ + "label": "Source Code", + "desc": "All plugin source code is available on SteamDeckHomebrew/decky-plugin-database repository on GitHub." + } } \ No newline at end of file diff --git a/backend/locales/en/Updater.json b/backend/locales/en/Updater.json index 9fa0aca4..c132be8f 100644 --- a/backend/locales/en/Updater.json +++ b/backend/locales/en/Updater.json @@ -2,13 +2,14 @@ "no_patch_notes_desc": "no patch notes for this version", "decky_updates": "Decky Updates", - "updates_label": "Updates", - "updates_cur_version": "Current version: {{ver}}", - "updates_lat_version": "Latest version: {{ver}}", - - "updates_checking": "'Checking", - "updates_check_button": "Check For Updates", - "updates_install_button": "Install Update", - "updates_reloading": "Reloading", - "updates_updating": "Updating" + "updates":{ + "label": "Updates", + "cur_version": "Current version: {{ver}}", + "lat_version": "Latest version: {{ver}}", + "checking": "'Checking", + "check_button": "Check For Updates", + "install_button": "Install Update", + "reloading": "Reloading", + "updating": "Updating" + } } diff --git a/backend/locales/en/plugin-loader.json b/backend/locales/en/plugin-loader.json index f270a40a..69c45de6 100644 --- a/backend/locales/en/plugin-loader.json +++ b/backend/locales/en/plugin-loader.json @@ -4,7 +4,9 @@ "decky_update_available": "Update to {{tag_name}} available!", "plugin_update_one": "Updates available for 1 plugin!", "plugin_update_other": "Updates available for {{number}} plugins!", - "plugin_uninstall": "Are you sure you want to uninstall {{name}}?", + "plugin_uninstall_title":"Uninstall {{name}}", + "plugin_uninstall_desc": "Are you sure you want to uninstall {{name}}?", + "plugin_uninstall_button": "Uninstall", "plugin_load_error": "Error loading plugin {{name}}", "plugin_load_error_toast": "Error loading {{name}}", "error": "Error", diff --git a/backend/locales/it/BranchSelect.json b/backend/locales/it/BranchSelect.json index efdcefd7..29ee409a 100644 --- a/backend/locales/it/BranchSelect.json +++ b/backend/locales/it/BranchSelect.json @@ -1,3 +1,5 @@ { - "update_channel_label": "Canale di aggiornamento" + "update_channel":{ + "label": "Canale di aggiornamento" + } } diff --git a/backend/locales/it/DeveloperIndex.json b/backend/locales/it/DeveloperIndex.json index c0f9a4de..98cd3e42 100644 --- a/backend/locales/it/DeveloperIndex.json +++ b/backend/locales/it/DeveloperIndex.json @@ -1,7 +1,11 @@ { - "valve_internal_label": "Abilita Menu Sviluppatore", - "valve_internal_desc1": "Abilita il menu interno di sviluppo di Valve.", - "valve_internal_desc2": "Non toccare nulla in questo menu se non sai quello che fa.", - "react_devtools_label": "Abilita i DevTools di React", - "react_devtools_desc": "Abilita la connessione ad un computer che esegue i DevTools di React. Cambiando questa impostazione ricaricherà Steam. Imposta l'indirizzo IP prima di abilitarlo." + "valve_internal":{ + "label": "Abilita Menu Sviluppatore", + "desc1": "Abilita il menu interno di sviluppo di Valve.", + "desc2": "Non toccare nulla in questo menu se non sai quello che fa." + }, + "react_devtools":{ + "label": "Abilita i DevTools di React", + "desc": "Abilita la connessione ad un computer che esegue i DevTools di React. Cambiando questa impostazione ricaricherà Steam. Imposta l'indirizzo IP prima di abilitarlo." + } } diff --git a/backend/locales/it/PluginInstallModal.json b/backend/locales/it/PluginInstallModal.json index 13c9e073..185aa434 100644 --- a/backend/locales/it/PluginInstallModal.json +++ b/backend/locales/it/PluginInstallModal.json @@ -1,7 +1,8 @@ { - "install_title": "Installa {{artifact}}", - "install_desc": "Sei sicuro di voler installare {{artifact}} {{version}}?", - "install_button_idle": "Installa", - "install_button_processing": "Installando" - + "install":{ + "title": "Installa {{artifact}}", + "desc": "Sei sicuro di voler installare {{artifact}} {{version}}?", + "button_idle": "Installa", + "button_processing": "Installando" + } } \ No newline at end of file diff --git a/backend/locales/it/RemoteDebugging.json b/backend/locales/it/RemoteDebugging.json index 4d503d8e..4c8ae18f 100644 --- a/backend/locales/it/RemoteDebugging.json +++ b/backend/locales/it/RemoteDebugging.json @@ -1,4 +1,6 @@ { - "remote_cef_label": "Permetti il debug remoto di CEF", - "remote_cef_desc": "Permetti l'accesso non autenticato a chiunque sulla tua rete locale al debugger di CEF." + "remote_cef":{ + "label": "Permetti il debug remoto di CEF", + "desc": "Permetti l'accesso non autenticato a chiunque sulla tua rete locale al debugger di CEF." + } } diff --git a/backend/locales/it/SettingsGeneralIndex.json b/backend/locales/it/SettingsGeneralIndex.json index 0cecb2da..5d8e8a26 100644 --- a/backend/locales/it/SettingsGeneralIndex.json +++ b/backend/locales/it/SettingsGeneralIndex.json @@ -1,6 +1,10 @@ { - "developer_mode_label": "Modalità sviluppatore", - "developer_mode_desc": "Abilità le impostazioni di sviluppo di Decky.", - "manual_plugin_label": "Installazione manuale plugins", - "manual_plugin_install_button": "Installa" + "developer_mode":{ + "label": "Modalità sviluppatore", + "desc": "Abilità le impostazioni di sviluppo di Decky." + }, + "manual_plugin":{ + "label": "Installazione manuale plugins", + "button": "Installa" + } } diff --git a/backend/locales/it/Store.json b/backend/locales/it/Store.json index 49d6fd8f..4c594a56 100644 --- a/backend/locales/it/Store.json +++ b/backend/locales/it/Store.json @@ -1,19 +1,29 @@ { - "store_tabs_title": "Naviga", - "store_tabs_about": "About", + "store_tabs":{ + "title": "Naviga", + "about": "About", - "store_tabs_alph_desc": "Alfabetico (A a Z)", - "store_tabs_alph_asce": "Alfabetico (Z a A)", + "alph_desc": "Alfabetico (A a Z)", + "alph_asce": "Alfabetico (Z a A)" + }, - "store_sort_label": "Ordina", - "store_sort_label_def": "Ultimo aggiornato (Più recente)", - "store_filter_label": "Filtra", - "store_fiter_label_def": "Tutto", + "store_sort":{ + "label": "Ordina", + "label_def": "Ultimo aggiornato (Più recente)" + }, + "store_filter":{ + "label": "Filtra", + "label_def": "Tutto" + }, "store_search_label": "Cerca", "store_testing_cta": "Valuta la possibilità di testare nuovi plugin per aiutare il team di Decky Loader!", - "store_contrib_label": "Contribuisci", - "store_contrib_desc": "Se desideri contribuire allo store di Decky, puoi trovare un template caricato su GitHub all'indirizzo SteamDeckHomebrew/decky-plugin-template. Informazioni riguardo sviluppo e distribuzione sono disponibili nel README.", - "store_source_label": "Codice Sorgente", - "store_source_desc": "Tutto il codice sorgente dei plugin è disponibile su GitHub all'indirizzo SteamDeckHomebrew/decky-plugin-database" + "store_contrib":{ + "label": "Contribuisci", + "desc": "Se desideri contribuire allo store di Decky, puoi trovare un template caricato su GitHub all'indirizzo SteamDeckHomebrew/decky-plugin-template. Informazioni riguardo sviluppo e distribuzione sono disponibili nel README." + }, + "store_source":{ + "label": "Codice Sorgente", + "desc": "Tutto il codice sorgente dei plugin è disponibile su GitHub all'indirizzo SteamDeckHomebrew/decky-plugin-database" + } } \ No newline at end of file diff --git a/backend/locales/it/Updater.json b/backend/locales/it/Updater.json index 458448ff..6095d2f1 100644 --- a/backend/locales/it/Updater.json +++ b/backend/locales/it/Updater.json @@ -2,13 +2,14 @@ "no_patch_notes_desc": "nessuna patch notes per questa versione", "decky_updates": "Aggiornamenti di Decky", - "updates_label": "Aggiornamenti", - "updates_cur_version": "Versione attuale: {{ver}}", - "updates_lat_version": "Ultima versione: {{ver}}", - - "updates_checking": "Controllando", - "updates_check_button": "Cerca aggiornamenti", - "updates_install_button": "Installa aggiornamento", - "updates_reloading": "Ricaricando", - "updates_updating": "Aggiornando" + "updates":{ + "label": "Aggiornamenti", + "cur_version": "Versione attuale: {{ver}}", + "lat_version": "Ultima versione: {{ver}}", + "checking": "Controllando", + "check_button": "Cerca aggiornamenti", + "install_button": "Installa aggiornamento", + "reloading": "Ricaricando", + "updating": "Aggiornando" + } } diff --git a/backend/locales/it/plugin-loader.json b/backend/locales/it/plugin-loader.json index 8d740b4c..69f0ef53 100644 --- a/backend/locales/it/plugin-loader.json +++ b/backend/locales/it/plugin-loader.json @@ -4,7 +4,9 @@ "decky_update_available": "Disponibile aggiornamento a {{tag_name}}!", "plugin_update_one": "Aggiornamento disponibile per un plugin!", "plugin_update_other": "Aggiornamento disponibile per {{number}} plugins!", - "plugin_uninstall": "Rimuovo {{name}}?", + "plugin_uninstall_title":"Rimozione di {{name}}", + "plugin_uninstall_desc": "Rimuovo {{name}}?", + "plugin_uninstall_button": "Rimuovi", "plugin_load_error": "Errore caricando il plugin {{name}}", "plugin_load_error_toast": "Errore caricando {{name}}", "error": "Errore", diff --git a/frontend/index.d.ts b/frontend/index.d.ts index 3e1bef28..19992a58 100644 --- a/frontend/index.d.ts +++ b/frontend/index.d.ts @@ -1,2 +1,2 @@ declare module '*.png'; -declare module '*.jpg'; +declare module '*.jpg'; \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index 7bdd424a..da86e6d7 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -43,8 +43,9 @@ }, "dependencies": { "decky-frontend-lib": "^3.18.10", - "i18next": "^22.0.6", + "i18next": "^22.4.9", "i18next-http-backend": "^2.1.1", + "i18next-browser-languagedetector": "^7.0.1", "react-file-icon": "^1.2.0", "react-i18next": "^12.0.0", "react-icons": "^4.4.0", diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index e2ffeecc..3c2fc1ab 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -13,7 +13,8 @@ specifiers: '@types/webpack': ^5.28.0 decky-frontend-lib: ^3.18.10 husky: ^8.0.1 - i18next: ^22.0.6 + i18next: ^22.4.9 + i18next-browser-languagedetector: ^7.0.1 i18next-http-backend: ^2.1.1 import-sort-style-module: ^6.0.0 inquirer: ^8.2.4 @@ -35,10 +36,11 @@ specifiers: dependencies: decky-frontend-lib: 3.18.10 - i18next: 22.0.6 + i18next: 22.4.9 + i18next-browser-languagedetector: 7.0.1 i18next-http-backend: 2.1.1 react-file-icon: 1.2.0_wcqkhtmu7mswc6yz4uyexck3ty - react-i18next: 12.0.0_l5i64r2igudm3ypjcze5pllh6e + react-i18next: 12.0.0_goxgninut6ie3oe2kpsp3ellgm react-icons: 4.4.0_react@16.14.0 react-markdown: 8.0.3_vshvapmxg47tngu7tvrsqpq55u remark-gfm: 3.0.1 @@ -237,6 +239,13 @@ packages: regenerator-runtime: 0.13.11 dev: false + /@babel/runtime/7.20.13: + resolution: {integrity: sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.13.11 + dev: false + /@babel/template/7.18.6: resolution: {integrity: sha512-JoDWzPe+wgBsTTgdnIma3iHNFC7YVJoPssVBDjiHfNlyt4YcunDtcDOUmfVDfCK5MfdsaIoX9PkijPhjH3nYUw==} engines: {node: '>=6.9.0'} @@ -1297,6 +1306,12 @@ packages: hasBin: true dev: true + /i18next-browser-languagedetector/7.0.1: + resolution: {integrity: sha512-Pa5kFwaczXJAeHE56CHG2aWzFBMJNUNghf0Pm4SwSrEMps/PTKqW90EYWlIvhuYStf3Sn1K0vw+gH3+TLdkH1g==} + dependencies: + '@babel/runtime': 7.20.1 + dev: false + /i18next-http-backend/2.1.1: resolution: {integrity: sha512-jByfUCDVgQ8+/Wens7queQhYYvMcGTW/lR4IJJNEDDXnmqjLrwi8ubXKpmp76/JIWEZHffNdWqnxFJcTVGeaOw==} dependencies: @@ -1305,10 +1320,10 @@ packages: - encoding dev: false - /i18next/22.0.6: - resolution: {integrity: sha512-RlreNGoPIdDP4QG+qSA9PxZKGwlzmcozbI9ObI6+OyUa/Rp0EjZZA9ubyBjw887zVNZsC+7FI3sXX8oiTzAfig==} + /i18next/22.4.9: + resolution: {integrity: sha512-8gWMmUz460KJDQp/ob3MNUX84cVuDRY9PLFPnV8d+Qezz/6dkjxwOaH70xjrCNDO+JrUL25iXfAIN9wUkInNZw==} dependencies: - '@babel/runtime': 7.20.1 + '@babel/runtime': 7.20.13 dev: false /iconv-lite/0.4.24: @@ -2196,7 +2211,7 @@ packages: tinycolor2: 1.4.2 dev: false - /react-i18next/12.0.0_l5i64r2igudm3ypjcze5pllh6e: + /react-i18next/12.0.0_goxgninut6ie3oe2kpsp3ellgm: resolution: {integrity: sha512-/O7N6aIEAl1FaWZBNvhdIo9itvF/MO/nRKr9pYqRc9LhuC1u21SlfwpiYQqvaeNSEW3g3qUXLREOWMt+gxrWbg==} peerDependencies: i18next: '>= 19.0.0' @@ -2211,7 +2226,7 @@ packages: dependencies: '@babel/runtime': 7.20.1 html-parse-stringify: 3.0.1 - i18next: 22.0.6 + i18next: 22.4.9 react: 16.14.0 react-dom: 16.14.0_react@16.14.0 dev: false diff --git a/frontend/src/components/modals/PluginInstallModal.tsx b/frontend/src/components/modals/PluginInstallModal.tsx index 5183ab80..156cddbf 100644 --- a/frontend/src/components/modals/PluginInstallModal.tsx +++ b/frontend/src/components/modals/PluginInstallModal.tsx @@ -29,13 +29,13 @@ const PluginInstallModal: FC = ({ artifact, version, ha onCancel={async () => { await onCancel(); }} - strTitle={t('install_title', artifact)} - strOKButtonText={loading ? t('install_button_processing') : t('install_button_idle')} + strTitle={t('install.title', artifact)} + strOKButtonText={loading ? t('install.button_processing') : t('install.button_idle')} > {hash == 'False' ? (

!!!!NO HASH PROVIDED!!!!

) : ( - t('install_desc', artifact, version) + t('install.desc', artifact, version) )} ); diff --git a/frontend/src/components/settings/pages/developer/index.tsx b/frontend/src/components/settings/pages/developer/index.tsx index a1114983..caffa025 100644 --- a/frontend/src/components/settings/pages/developer/index.tsx +++ b/frontend/src/components/settings/pages/developer/index.tsx @@ -16,10 +16,10 @@ export default function DeveloperSettings() { return ( <> - {t('valve_internal_desc1')} {t('valve_internal_desc2')} + {t('valve_internal.desc1')} {t('valve_internal.desc2')} } icon={} @@ -56,10 +56,10 @@ export default function DeveloperSettings() { } > - {t('react_devtools_desc')} + {t('react_devtools.desc')}
setReactDevtoolsIP(e?.target.value)} />
diff --git a/frontend/src/components/settings/pages/general/BranchSelect.tsx b/frontend/src/components/settings/pages/general/BranchSelect.tsx index 2ef86d12..720b7d79 100644 --- a/frontend/src/components/settings/pages/general/BranchSelect.tsx +++ b/frontend/src/components/settings/pages/general/BranchSelect.tsx @@ -21,7 +21,7 @@ const BranchSelect: FunctionComponent<{}> = () => { return ( // Returns numerical values from 0 to 2 (with current branch setup as of 8/28/22) // 0 being stable, 1 being pre-release and 2 being nightly - + typeof branch == 'string') diff --git a/frontend/src/components/settings/pages/general/RemoteDebugging.tsx b/frontend/src/components/settings/pages/general/RemoteDebugging.tsx index 1abfc36d..47d2c03e 100644 --- a/frontend/src/components/settings/pages/general/RemoteDebugging.tsx +++ b/frontend/src/components/settings/pages/general/RemoteDebugging.tsx @@ -10,8 +10,8 @@ export default function RemoteDebuggingSettings() { return ( {t('remote_cef_desc')}} + label={t('remote_cef.label')} + description={{t('remote_cef.desc')}} icon={} > {`${t('updates_cur_version', versionInfo.current)}\n${ - versionInfo.updatable ? t('updates_lat_version', versionInfo.remote?.tag_name) : '' + {`${t('updates.cur_version', { ver: versionInfo.current })}\n${ + versionInfo.updatable ? t('updates.lat_version', { ver: versionInfo.remote?.tag_name }) : '' }`} ) } @@ -131,10 +131,10 @@ export default function UpdaterSettings() { } > {checkingForUpdates - ? t('updates_checking') + ? t('updates.checking') : !versionInfo?.remote || versionInfo?.remote?.tag_name == versionInfo?.current - ? t('updates_check_button') - : t('updates_install_button')} + ? t('updates.check_button') + : t('updates.install_button')} ) : ( )} diff --git a/frontend/src/components/settings/pages/general/index.tsx b/frontend/src/components/settings/pages/general/index.tsx index 30c414e5..3d4dff5c 100644 --- a/frontend/src/components/settings/pages/general/index.tsx +++ b/frontend/src/components/settings/pages/general/index.tsx @@ -26,8 +26,8 @@ export default function GeneralSettings({ {t('developer_mode_desc')}} + label={t('developer_mode.label')} + description={{t('developer_mode.desc')}} icon={} > setPluginURL(e?.target.value)} />} icon={} > installFromURL(pluginURL)}> - {t('manual_plugin_install_button')} + {t('manual_plugin.button')} diff --git a/frontend/src/components/store/Store.tsx b/frontend/src/components/store/Store.tsx index 24f3e7b3..c21ce8ba 100644 --- a/frontend/src/components/store/Store.tsx +++ b/frontend/src/components/store/Store.tsx @@ -63,7 +63,7 @@ const StorePage: FC<{}> = () => { renderTabAddon: () => {data.length}, }, { - title: t('store_tabs_about'), + title: t('store_tabs.about'), content: , id: 'about', }, @@ -78,8 +78,8 @@ const StorePage: FC<{}> = () => { const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => { const sortOptions = useMemo( (): DropdownOption[] => [ - { data: 1, label: t('store_tabs_alph_desc') }, - { data: 2, label: t('store_tabs_alph_asce') }, + { data: 1, label: t('store_tabs.alph_desc') }, + { data: 2, label: t('store_tabs.alph_asce') }, ], [], ); @@ -108,11 +108,11 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => { width: '47.5%', }} > - {t("store_sort_label")} + {t("store_sort.label")} setSort(e.data)} /> @@ -125,11 +125,11 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => { marginLeft: 'auto', }} > - {t("store_filter_label")} + {t("store_filter.label")} setFilter(e.data)} /> @@ -139,7 +139,7 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
- setSearchValue(e.target.value)} /> + setSearchValue(e.target.value)} />
@@ -154,11 +154,11 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => { maxWidth: '100%', }} > - {t('store_sort_label')} + {t('store_sort.label')} setSort(e.data)} /> @@ -169,7 +169,7 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
setSearchValue(e.target.value)} /> @@ -234,10 +234,10 @@ const AboutTab: FC<{}> = () => { deckbrew.xyz/testing - {t('store_contrib_label')} - {t('store_contrib_desc')} - {t('store_source_label')} - {t('store_source_desc')} + {t('store_contrib.label')} + {t('store_contrib.desc')} + {t('store_source.label')} + {t('store_source.desc')}
); }; diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index df268557..1d370266 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -1,46 +1,23 @@ -import i18next from 'i18next'; +import i18n from 'i18next'; +import LanguageDetector from 'i18next-browser-languagedetector'; import Backend from 'i18next-http-backend'; import { initReactI18next } from 'react-i18next'; -i18next +i18n .use(Backend) + .use(LanguageDetector) .use(initReactI18next) .init({ - backend: { - // path where resources get loaded from, or a function - // returning a path: - // function(lngs, namespaces) { return customPath; } - // the returned path will interpolate lng, ns if provided like giving a static path - // the function might return a promise - // returning falsy will abort the download - // - // If allowMultiLoading is false, lngs and namespaces will have only one element each, - // If allowMultiLoading is true, lngs and namespaces can have multiple elements - loadPath: 'https://steamloopback.host:1337/locales/{{lng}}/{{ns}}.json', - - // your backend server supports multiloading - // /locales/resources.json?lng=de+en&ns=ns1+ns2 - // Adapter is needed to enable MultiLoading https://github.com/i18next/i18next-multiload-backend-adapter - // Returned JSON structure in this case is - // { - // lang : { - // namespaceA: {}, - // namespaceB: {}, - // ...etc - // } - // } - allowMultiLoading: false, // set loadPath: '/locales/resources.json?lng={{lng}}&ns={{ns}}' to adapt to multiLoading - - reloadInterval: false, // can be used to reload resources in a specific interval (useful in server environments) - }, + load: 'languageOnly', debug: true, fallbackLng: 'en', - fallbackNS: 'Common', lng: 'en', interpolation: { escapeValue: false, }, - load: 'languageOnly', + backend: { + loadPath: 'http://127.0.0.1:1337/locales/{{lng}}/{{ns}}.json', + }, }); -export default i18next; +export default i18n; diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx index 3b1e88a1..b0e75e9e 100644 --- a/frontend/src/plugin-loader.tsx +++ b/frontend/src/plugin-loader.tsx @@ -154,10 +154,10 @@ class PluginLoader extends Logger { onCancel={() => { // do nothing }} - strTitle={`Uninstall ${name}`} - strOKButtonText={'Uninstall'} + strTitle={t('plugin_uninstall_title', name)} + strOKButtonText={t('plugin_uninstall_button')} > - {t('plugin_uninstall', name)} + {t('plugin_uninstall_desc', name)} , ); }