feat(locale): configure Chinese (zh) localization for client and align with 40250 server
This commit is contained in:
+10
-4
@@ -458,7 +458,11 @@ func setup(m2client: Node, assets_root: String,
|
||||
if ClassDB.class_exists("Metin2Proto") and assets_root != "":
|
||||
proto = ClassDB.instantiate("Metin2Proto")
|
||||
add_child(proto)
|
||||
var ip := assets_root.path_join("locale/locale/en/item_proto")
|
||||
var LocaleScript = load("res://locale.gd")
|
||||
var cur_lang: String = LocaleScript.get_default_lang() if LocaleScript and LocaleScript.has_method("get_default_lang") else "zh"
|
||||
var ip := assets_root.path_join("locale/locale/%s/item_proto" % cur_lang)
|
||||
if not FileAccess.file_exists(ip):
|
||||
ip = assets_root.path_join("locale/locale/en/item_proto")
|
||||
if FileAccess.file_exists(ip):
|
||||
proto.call("load_item_proto", ip)
|
||||
if quickbar and "proto" in quickbar:
|
||||
@@ -468,7 +472,9 @@ func setup(m2client: Node, assets_root: String,
|
||||
chat.set_proto(proto)
|
||||
if quest_dialog and quest_dialog.has_method("set_proto"):
|
||||
quest_dialog.set_proto(proto)
|
||||
var mp := assets_root.path_join("locale/locale/en/mob_proto")
|
||||
var mp := assets_root.path_join("locale/locale/%s/mob_proto" % cur_lang)
|
||||
if not FileAccess.file_exists(mp):
|
||||
mp = assets_root.path_join("locale/locale/en/mob_proto")
|
||||
if FileAccess.file_exists(mp):
|
||||
proto.call("load_mob_proto", mp)
|
||||
await _yield()
|
||||
@@ -480,7 +486,7 @@ func setup(m2client: Node, assets_root: String,
|
||||
if net_world and "title_name_resolver" in net_world and assets_root != "":
|
||||
# §8.8 称号名:introloading.__RegisterTitleName -> localeInfo.PVP_LEVEL<grade>
|
||||
var _tt_loc: RefCounted = load("res://locale.gd").new()
|
||||
_tt_loc.setup(assets_root, "en")
|
||||
_tt_loc.setup(assets_root, cur_lang)
|
||||
net_world.title_name_resolver = func(g: int) -> String:
|
||||
var k := "PVP_LEVEL%d" % g
|
||||
return _tt_loc.t(k) if _tt_loc.has(k) else ""
|
||||
@@ -515,7 +521,7 @@ func setup(m2client: Node, assets_root: String,
|
||||
var _possessive := ""
|
||||
if assets_root != "":
|
||||
var _poss_loc: RefCounted = load("res://locale.gd").new()
|
||||
_poss_loc.setup(assets_root, "en")
|
||||
_poss_loc.setup(assets_root, cur_lang)
|
||||
if _poss_loc.has("POSSESSIVE_MORPHENE"):
|
||||
_possessive = _poss_loc.t("POSSESSIVE_MORPHENE")
|
||||
ground_items.setup(client, _mount, func() -> Node: return player, proto, item_list,
|
||||
|
||||
Reference in New Issue
Block a user