mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-14 13:16:11 +01:00
12 lines
330 B
TypeScript
12 lines
330 B
TypeScript
import { I18nString } from '@blitzkit/core';
|
|||
|
|
import { DEFAULT_LOCALE } from './supportedLocales';
|
||
|
|
|
||
|
|
export function unwrapper(locale: string) {
|
||
|
|
return function (i18nString: I18nString) {
|
||
|
|
if (locale in i18nString.locales) {
|
||
|
|
return i18nString.locales[locale];
|
||
|
|
}
|
||
|
|
|
||
|
|
return i18nString.locales[DEFAULT_LOCALE];
|
||
|
|
};
|
||
|
|
}
|