I18nConfig
Properties
defaultLocale
defaultLocale: LocaleId;
A locale ID to use by default. This is used when locale negotiator and session (if enabled) returns an empty result. The default value is “en”.
directory
directory?: string;
Directory to load translations from.
useSession
useSession?: boolean;
Whether to use session to get and set language code. You must be using session with it.
fluentOptions
fluentOptions?: FluentOptions;
Configuration for the Fluent instance used internally.
fluentBundleOptions
fluentBundleOptions?: FluentBundleOptions;
Bundle options to use when adding a translation to the Fluent instance.
localeNegotiator
localeNegotiator?: LocaleNegotiator<C>;
An optional function that determines which locale to use. See Locale Negotiation for more details.
globalTranslationContext
globalTranslationContext?: (ctx: C) => Record<string, FluentVariable>;
Convenience function for defining global variables that are used frequently in the translation context. Variables defined inside this can be used directly in the translation source file without having to specifying them when calling the translate function. It is possible to overwrite the values by re-defining them in the translation context of translate function.