🤖 Merge PR #44438 Modified type of i18n-js I18n.fallbacks by @atheck

This commit is contained in:
Henrik Fuchs 2020-05-07 07:30:45 +02:00 committed by GitHub
parent 9c0c135e0b
commit ac5c969feb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -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"];

View File

@ -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;