8 lines
195 B
TypeScript
8 lines
195 B
TypeScript
|
export const createTranslationFunc = (
|
||
|
translations: Record<string, Record<string, string>>
|
||
|
) => {
|
||
|
return (s: string) => {
|
||
|
return translations[window.game_data.locale]?.[s] ?? s;
|
||
|
};
|
||
|
};
|