The Suspense wrapper was removed from root-providers.tsx to simplify code. For the Privacy Path Checking, a property was added to 'AuthRedirectListener' to allow customization of 'privatePathPrefixes', and the prefixes list was moved to the top. Also, explicit constant assertions were added in 'create-i18n-settings.ts' to ensure the types correctness.
34 lines
599 B
TypeScript
34 lines
599 B
TypeScript
/**
|
|
* Get i18n settings for i18next.
|
|
* @param languages
|
|
* @param language
|
|
* @param namespaces
|
|
*/
|
|
export function createI18nSettings({
|
|
languages,
|
|
language,
|
|
namespaces,
|
|
}: {
|
|
languages: string[];
|
|
language: string;
|
|
namespaces?: string | string[];
|
|
}) {
|
|
const lng = language;
|
|
const ns = namespaces;
|
|
|
|
return {
|
|
supportedLngs: languages,
|
|
fallbackLng: languages[0],
|
|
detection: undefined,
|
|
lng,
|
|
load: 'languageOnly' as const,
|
|
preload: false as const,
|
|
lowerCaseLng: true as const,
|
|
fallbackNS: ns,
|
|
ns,
|
|
react: {
|
|
useSuspense: true,
|
|
},
|
|
};
|
|
}
|