diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-07-08 17:27:32 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-07-08 17:27:32 +0800 |
commit | 3eff278428432a6e21ee71c1434d64390652bad9 (patch) | |
tree | 677299189d8d8047d57b39404c2dd036a1dc9c80 /script | |
parent | 812f57e1811b110e44f1b7064880ca8da9b2f328 (diff) | |
download | lua-language-server-3eff278428432a6e21ee71c1434d64390652bad9.zip |
locale
Diffstat (limited to 'script')
-rw-r--r-- | script/client.lua | 7 | ||||
-rw-r--r-- | script/config/loader.lua | 8 | ||||
-rw-r--r-- | script/library.lua | 7 |
3 files changed, 10 insertions, 12 deletions
diff --git a/script/client.lua b/script/client.lua index 00db9fce..f5078d48 100644 --- a/script/client.lua +++ b/script/client.lua @@ -135,14 +135,13 @@ function m.setConfig(changes, updateLocal) }) end else - -- TODO translate local messages = {} - messages[1] = lang.script('你的客户端不支持从服务侧修改设置,请手动修改如下设置:') + messages[1] = lang.script('WINDOW_CLIENT_NOT_SUPPORT_CONFIG') for _, change in ipairs(finalChanges) do if change.action == 'add' then - messages[#messages+1] = lang.script('为 `{key}` 添加值 `{value:q}`;', change) + messages[#messages+1] = lang.script('WINDOW_MANUAL_CONFIG_ADD', change) else - messages[#messages+1] = lang.script('将 `{key}` 的值设置为 `{value:q}`;', change) + messages[#messages+1] = lang.script('WINDOW_MANUAL_CONFIG_SET', change) end end local message = table.concat(messages, '\n') diff --git a/script/config/loader.lua b/script/config/loader.lua index 435b00d1..b0e8b6db 100644 --- a/script/config/loader.lua +++ b/script/config/loader.lua @@ -26,13 +26,13 @@ function m.loadLocalConfig(filename) local ext = path:extension():string():lower() local buf = fsu.loadFile(path) if not buf then - errorMessage(lang.script('无法读取设置文件:{}', path:string())) + errorMessage(lang.script('CONFIG_LOAD_FAILED', path:string())) return end if ext == '.json' then local suc, res = pcall(json.decode, buf) if not suc then - errorMessage(lang.script('设置文件加载错误:{}', res)) + errorMessage(lang.script('CONFIG_LOAD_ERROR', res)) return end return res @@ -41,12 +41,12 @@ function m.loadLocalConfig(filename) return assert(load(buf, '@' .. path:string(), 't'))() end) if not suc then - errorMessage(lang.script('设置文件加载错误:{}', res)) + errorMessage(lang.script('CONFIG_LOAD_ERROR', res)) return end return res else - errorMessage(lang.script('设置文件必须是lua或json格式:{}', path:string())) + errorMessage(lang.script('CONFIG_TYPE_ERROR', path:string())) return end end diff --git a/script/library.lua b/script/library.lua index 4a40fead..3cb4cb10 100644 --- a/script/library.lua +++ b/script/library.lua @@ -320,12 +320,11 @@ end local hasAsked local function askFor3rd(cfg) hasAsked = true - -- TODO: translate - local yes1 = lang.script['应用并修改设置'] - local yes2 = lang.script['应用但不修改设置'] + local yes1 = lang.script.WINDOW_APPLY_WHIT_SETTING + local yes2 = lang.script.WINDOW_APPLY_WHITOUT_SETTING local no = lang.script.WINDOW_DONT_SHOW_AGAIN local result = client.awaitRequestMessage('Info' - , lang.script('是否需要将你的工作环境配置为 `{}` ?', cfg.name) + , lang.script('WINDOW_ASK_APPLY_LIBRARY', cfg.name) , {yes1, yes2, no} ) if not result then |