mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
16 lines
499 B
TypeScript
16 lines
499 B
TypeScript
import locales from "../locales.json";
|
|
import { type BlitzKitStrings, STRINGS } from "./strings";
|
|
|
|
export function wrapper(slicer: (strings: BlitzKitStrings) => string) {
|
|
const defaultString = slicer(STRINGS[locales.default] as BlitzKitStrings);
|
|
|
|
const object = { [locales.default]: defaultString };
|
|
|
|
for (const { locale } of locales.supported) {
|
|
const string = slicer(STRINGS[locale] as BlitzKitStrings);
|
|
if (string !== defaultString) object[locale] = string;
|
|
}
|
|
|
|
return object;
|
|
}
|