diff options
Diffstat (limited to 'packages/demobank-ui')
-rw-r--r-- | packages/demobank-ui/src/components/app.tsx | 4 | ||||
-rw-r--r-- | packages/demobank-ui/src/i18n/strings-prelude | 19 | ||||
-rw-r--r-- | packages/demobank-ui/src/i18n/strings.ts | 63 |
3 files changed, 38 insertions, 48 deletions
diff --git a/packages/demobank-ui/src/components/app.tsx b/packages/demobank-ui/src/components/app.tsx index 3d1a43803..c3e579810 100644 --- a/packages/demobank-ui/src/components/app.tsx +++ b/packages/demobank-ui/src/components/app.tsx @@ -24,7 +24,7 @@ import { Fragment, FunctionalComponent, h } from "preact"; import { SWRConfig } from "swr"; import { BackendStateProvider } from "../context/backend.js"; import { BankCoreApiProvider } from "../context/config.js"; -import { strings } from "../i18n/strings.js"; +import { strings, StringsType } from "../i18n/strings.js"; import { BankUiSettings, fetchSettings } from "../settings.js"; import { Routing } from "../Routing.js"; import { BankFrame } from "../pages/BankFrame.js"; @@ -42,7 +42,7 @@ const App: FunctionalComponent = () => { const baseUrl = getInitialBackendBaseURL(settings.backendBaseURL); return ( <SettingsProvider value={settings}> - <TranslationProvider source={strings}> + <TranslationProvider source={strings} completness={{ "es": strings["es"].completeness, "de": strings["de"].completeness }}> <BackendStateProvider> <BankCoreApiProvider baseUrl={baseUrl} frameOnError={BankFrame}> <SWRConfig diff --git a/packages/demobank-ui/src/i18n/strings-prelude b/packages/demobank-ui/src/i18n/strings-prelude deleted file mode 100644 index a0aeb8268..000000000 --- a/packages/demobank-ui/src/i18n/strings-prelude +++ /dev/null @@ -1,19 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2022 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - -/*eslint quote-props: ["error", "consistent"]*/ -export const strings: {[s: string]: any} = {}; - diff --git a/packages/demobank-ui/src/i18n/strings.ts b/packages/demobank-ui/src/i18n/strings.ts index fada43b38..ddff053eb 100644 --- a/packages/demobank-ui/src/i18n/strings.ts +++ b/packages/demobank-ui/src/i18n/strings.ts @@ -1,24 +1,17 @@ -/* - This file is part of GNU Taler - (C) 2022 Taler Systems S.A. - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - -/*eslint quote-props: ["error", "consistent"]*/ -export const strings: {[s: string]: any} = {}; +export interface StringsType { + // X-Domain or 'messages' + domain: string; + lang: string; + completeness: number, + 'plural_forms': string; + locale_data: { + messages: Record<string, any> + } +} +export const strings: Record<string,StringsType> = {}; strings['it'] = { - "domain": "messages", "locale_data": { "messages": { "": { @@ -1062,11 +1055,14 @@ strings['it'] = { "" ] } - } + }, + "domain": "messages", + "plural_forms": "nplurals=2; plural=n != 1;", + "lang": "it", + "completeness": 14 }; strings['fr'] = { - "domain": "messages", "locale_data": { "messages": { "": { @@ -2110,11 +2106,14 @@ strings['fr'] = { "" ] } - } + }, + "domain": "messages", + "plural_forms": "nplurals=2; plural=n > 1;", + "lang": "fr", + "completeness": 0 }; strings['es'] = { - "domain": "messages", "locale_data": { "messages": { "": { @@ -3158,11 +3157,14 @@ strings['es'] = { "Bienvenido a %1$s!" ] } - } + }, + "domain": "messages", + "plural_forms": "nplurals=2; plural=n != 1;", + "lang": "es", + "completeness": 100 }; strings['en'] = { - "domain": "messages", "locale_data": { "messages": { "": { @@ -4206,11 +4208,14 @@ strings['en'] = { "" ] } - } + }, + "domain": "messages", + "plural_forms": "nplurals=2; plural=(n != 1);", + "lang": "en", + "completeness": 100 }; strings['de'] = { - "domain": "messages", "locale_data": { "messages": { "": { @@ -5254,6 +5259,10 @@ strings['de'] = { "" ] } - } + }, + "domain": "messages", + "plural_forms": "nplurals=2; plural=n != 1;", + "lang": "de", + "completeness": 4 }; |