fix(package/locale): sync behaviour with Lua

This commit is contained in:
Linden
2024-05-14 18:19:26 +10:00
parent 8080fa1474
commit 0b13a56071
2 changed files with 4 additions and 2 deletions

View File

@@ -29,6 +29,8 @@ export const locale = (str: string, ...args: any[]) => {
return lstr;
}
return str;
};
export const getLocales = () => dict;
@@ -55,7 +57,7 @@ function loadLocale(key: string): typeof dict {
}
export const initLocale = (key?: string) => {
const lang = key || GetConvar('ox:locale', 'en');
const lang = key || exports.ox_lib.getLocaleKey();
let locales = loadLocale('en');
if (lang !== 'en') Object.assign(locales, loadLocale(lang));