diff --git a/types/i18n-js/i18n-js-tests.ts b/types/i18n-js/i18n-js-tests.ts index 8a7480d18e..de5ea45ee1 100644 --- a/types/i18n-js/i18n-js-tests.ts +++ b/types/i18n-js/i18n-js-tests.ts @@ -18,6 +18,11 @@ I18n.t("some.missing.scope", { defaults: [{ scope: "some.existing.scope" }] }); I18n.t("some.missing.scope", { defaults: [{ message: "Some message" }] }); I18n.fallbacks = true; +I18n.fallbacks = "de"; +I18n.fallbacks = { + de: "en", + "de-DE": [ "de", "en" ] +}; I18n.locales.no = ["nb", "en"]; I18n.locales.no = "nb"; I18n.locales.no = locale => ["nb"]; diff --git a/types/i18n-js/index.d.ts b/types/i18n-js/index.d.ts index 887d59effd..0d5987edf6 100644 --- a/types/i18n-js/index.d.ts +++ b/types/i18n-js/index.d.ts @@ -15,7 +15,7 @@ declare namespace I18n { let locale: string; let defaultSeparator: string; let placeholder: RegExp; - let fallbacks: boolean; + let fallbacks: boolean | string | { [locale: string]: string | string[] }; let missingBehaviour: "message" | "guess"; let missingTranslationPrefix: string;