fix: fix I18nAPI.get
This commit is contained in:
+7
-3
@@ -19,6 +19,7 @@ const GMLIB_API = {
|
||||
setPlayerNbt: ll.import("GMLIB_API", "setPlayerNbt"),
|
||||
setPlayerNbtTags: ll.import("GMLIB_API", "setPlayerNbtTags"),
|
||||
resourcePackTranslate: ll.import("GMLIB_API", "resourcePackTranslate"),
|
||||
resourcePackDefaultTranslate: ll.import("GMLIB_API", "resourcePackDefaultTranslate"),
|
||||
getResourcePackI18nLanguage: ll.import("GMLIB_API", "getResourcePackI18nLanguage"),
|
||||
chooseResourcePackI18nLanguage: ll.import("GMLIB_API", "chooseResourcePackI18nLanguage"),
|
||||
setEducationFeatureEnabled: ll.import("GMLib_ServerAPI", "setEducationFeatureEnabled"),
|
||||
@@ -812,8 +813,11 @@ class I18nAPI {
|
||||
throw new Error("Static class cannot be instantiated");
|
||||
}
|
||||
|
||||
static get(key, params = []) {
|
||||
GMLIB_API.resourcePackTranslate(key, params);
|
||||
static get(key, params = [], langCode = undefined) {
|
||||
if (langCode) {
|
||||
return GMLIB_API.resourcePackTranslate(key, params, langCode);
|
||||
}
|
||||
return GMLIB_API.resourcePackDefaultTranslate(key, params);
|
||||
}
|
||||
|
||||
static translate(key, params = []) {
|
||||
@@ -840,7 +844,7 @@ class I18nAPI {
|
||||
GMLIB_API.updateOrCreateLanguageFile(code, lang, path);
|
||||
}
|
||||
|
||||
static loadLanguagePath(path) {
|
||||
static loadLanguageDirectory(path) {
|
||||
GMLIB_API.loadLanguagePath(path);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user