diff --git a/app/client/lib/localization.ts b/app/client/lib/localization.ts index 0167e190..39094809 100644 --- a/app/client/lib/localization.ts +++ b/app/client/lib/localization.ts @@ -95,11 +95,6 @@ type InferResult = T extends Record|undefi * Resolves the translation of the given key and substitutes. Supports dom elements interpolation. */ export function t>(key: string, args?: T|null, instance = i18next): InferResult { - if (!instance.exists(key, args || undefined)) { - const error = new Error(`Missing translation for key: ${key} and language: ${i18next.language}`); - reportError(error); - } - // Don't need to bind `t` function. return domT(key, args, instance.t); } @@ -177,12 +172,6 @@ export function makeT(scope: string, instance?: typeof i18next) { // This will remove all the overloads from the function, but we don't need them. scopedResolver = (_key: string, _args?: any) => fixedResolver(_key, {defaultValue: _key, ..._args}); } - // If the key has interpolation or we did pass some arguments, make sure that - // the key exists. - if ((args || key.includes("{{")) && !scopedInstance.exists(`${scope}.${key}`, args || undefined)) { - const error = new Error(`Missing translation for key: ${key} and language: ${i18next.language}`); - reportError(error); - } return domT(key, args, scopedResolver!); }; } diff --git a/app/client/ui/AccountPage.ts b/app/client/ui/AccountPage.ts index 81a46746..5cc5f6d9 100644 --- a/app/client/ui/AccountPage.ts +++ b/app/client/ui/AccountPage.ts @@ -141,7 +141,7 @@ export class AccountPage extends Disposable { enableCustomCss ? null : [ css.header(t("Theme")), dom.create(ThemeConfig, this._appModel), - css.subHeader(t("Language ")), + css.subHeader(t("Language")), css.dataRow({ style: 'width: 300px'}, select(userLocale, languageOptions, { renderOptionArgs: () => { diff --git a/static/locales/en.client.json b/static/locales/en.client.json index ce14ca56..7f3db564 100644 --- a/static/locales/en.client.json +++ b/static/locales/en.client.json @@ -56,7 +56,8 @@ "Save": "Save", "Theme": "Theme", "Two-factor authentication": "Two-factor authentication", - "Two-factor authentication is an extra layer of security for your Grist account designed to ensure that you're the only person who can access your account, even if someone knows your password.": "Two-factor authentication is an extra layer of security for your Grist account designed to ensure that you're the only person who can access your account, even if someone knows your password." + "Two-factor authentication is an extra layer of security for your Grist account designed to ensure that you're the only person who can access your account, even if someone knows your password.": "Two-factor authentication is an extra layer of security for your Grist account designed to ensure that you're the only person who can access your account, even if someone knows your password.", + "Language": "Language" }, "AccountWidget": { "Access Details": "Access Details", @@ -895,5 +896,8 @@ "convert to card view, select data, and more.": "convert to card view, select data, and more.", "creator panel": "creator panel", "template library": "template library" + }, + "LanguageMenu": { + "Language": "Language" } } diff --git a/static/locales/ru.client.json b/static/locales/ru.client.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/static/locales/ru.client.json @@ -0,0 +1 @@ +{}