diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-09-29 11:25:16 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-09-29 11:25:16 +0800 |
commit | 049eaa1446d8b53cef14ec3a72f315f162ead2bc (patch) | |
tree | 81a711fe508573c0f40585063f340ac09b4f9bee /script-beta | |
parent | 5cd2e0110dfe2d1bc8c141af74baa53dab448c66 (diff) | |
download | lua-language-server-049eaa1446d8b53cef14ec3a72f315f162ead2bc.zip |
增加翻译
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/core/completion.lua | 7 | ||||
-rw-r--r-- | script-beta/core/hover/description.lua | 2 | ||||
-rw-r--r-- | script-beta/core/hover/init.lua | 6 | ||||
-rw-r--r-- | script-beta/core/hover/label.lua | 6 | ||||
-rw-r--r-- | script-beta/files.lua | 3 |
5 files changed, 11 insertions, 13 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua index fd27f535..2e1af2aa 100644 --- a/script-beta/core/completion.lua +++ b/script-beta/core/completion.lua @@ -19,6 +19,7 @@ local keyWordMap = require 'core.keyword' local workspace = require 'workspace' local furi = require 'file-uri' local rpath = require 'workspace.require-path' +local lang = require 'language' local stackID = 0 local stacks = {} @@ -593,11 +594,10 @@ local function checkUri(ast, text, offset, results) } } end - -- TODO 翻译 - collect[info.expect][#collect[info.expect]+1] = ([=[* [%s](%s) (假设搜索路径包含 `%s`)]=]):format( + collect[info.expect][#collect[info.expect]+1] = ([=[* [%s](%s) %s]=]):format( path, uri, - info.searcher + lang.script('HOVER_USE_LUA_PATH', info.searcher) ) end end @@ -620,7 +620,6 @@ local function checkUri(ast, text, offset, results) } } end - -- TODO 翻译 collect[path][#collect[path]+1] = ([=[[%s](%s)]=]):format( path, uri diff --git a/script-beta/core/hover/description.lua b/script-beta/core/hover/description.lua index 9e0066e6..8aa8a625 100644 --- a/script-beta/core/hover/description.lua +++ b/script-beta/core/hover/description.lua @@ -41,7 +41,7 @@ local function asString(source) if searcher then searcher = searcher:sub(#ws.path + 1) searcher = ws.normalize(searcher) - result[i] = ('* [%s](%s) (假设搜索路径包含 `%s`)'):format(path, uri, searcher) + result[i] = ('* [%s](%s) %s'):format(path, uri, lang.script('HOVER_USE_LUA_PATH', searcher)) else result[i] = ('* [%s](%s)'):format(path, uri) end diff --git a/script-beta/core/hover/init.lua b/script-beta/core/hover/init.lua index 46eb9b0b..52c684a8 100644 --- a/script-beta/core/hover/init.lua +++ b/script-beta/core/hover/init.lua @@ -5,6 +5,7 @@ local getLabel = require 'core.hover.label' local getDesc = require 'core.hover.description' local util = require 'utility' local findSource = require 'core.find-source' +local lang = require 'language' local function getHoverAsFunction(source) local values = vm.getInfers(source) @@ -40,13 +41,12 @@ local function getHoverAsFunction(source) } end - -- TODO 翻译 local lines = {} if defs > 1 then - lines[#lines+1] = ('(%d 个定义,%d 个原型)'):format(defs, protos) + lines[#lines+1] = lang.script('HOVER_MULTI_DEF_PROTO', defs, protos) end if other > 0 then - lines[#lines+1] = ('(%d 个非函数定义)'):format(other) + lines[#lines+1] = lang.script('HOVER_MULTI_PROTO_NOT_FUNC', other) end if defs > 1 then for label, count in util.sortPairs(labels) do diff --git a/script-beta/core/hover/label.lua b/script-beta/core/hover/label.lua index 91674023..2c5f0d2a 100644 --- a/script-beta/core/hover/label.lua +++ b/script-beta/core/hover/label.lua @@ -5,6 +5,7 @@ local buildTable = require 'core.hover.table' local vm = require 'vm' local util = require 'utility' local guide = require 'parser.guide' +local lang = require 'language' local function asFunction(source, oop) local name = buildName(source, oop) @@ -100,11 +101,10 @@ local function asString(source) end local len = #str local charLen = util.utf8Len(str, 1, -1) - -- TODO 翻译 if len == charLen then - return ('%d 个字节'):format(len) + return lang.script('HOVER_STRING_BYTES', len) else - return ('%d 个字节,%d 个字符'):format(len, charLen) + return lang.script('HOVER_STRING_CHARACTERS', len, charLen) end end diff --git a/script-beta/files.lua b/script-beta/files.lua index f88ca613..b1b069bc 100644 --- a/script-beta/files.lua +++ b/script-beta/files.lua @@ -201,8 +201,7 @@ function m.getAst(uri) local ws = require 'workspace' proto.notify('window/showMessage', { type = 3, - -- TODO 翻译 - message = lang.script('已跳过过大的文件:{}。当前设置的大小限制为:{} KB,该文件大小为:{} KB' + message = lang.script('WORKSPACE_SKIP_LARGE_FILE' , ws.getRelativePath(file.uri) , config.config.workspace.maxPreload , #file.text / 1000 |