B2B-88: add starter kit structure and elements

This commit is contained in:
devmc-ee
2025-06-08 16:18:30 +03:00
parent 657a36a298
commit e7b25600cb
1280 changed files with 77893 additions and 5688 deletions

View File

@@ -0,0 +1,41 @@
import type { InitOptions } from 'i18next';
/**
* Get i18n settings for i18next.
* @param languages
* @param language
* @param namespaces
*/
export function createI18nSettings({
languages,
language,
namespaces,
}: {
languages: string[];
language: string;
namespaces?: string | string[];
}): InitOptions {
const lng = language;
const ns = namespaces;
return {
supportedLngs: languages,
fallbackLng: languages[0],
detection: undefined,
lng,
preload: false as const,
lowerCaseLng: true as const,
fallbackNS: ns,
missingInterpolationHandler: (text, value, options) => {
console.debug(
`Missing interpolation value for key: ${text}`,
value,
options,
);
},
ns,
react: {
useSuspense: true,
},
};
}