summaryrefslogtreecommitdiff
path: root/script-beta/core
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta/core')
-rw-r--r--script-beta/core/completion.lua7
-rw-r--r--script-beta/core/hover/description.lua2
-rw-r--r--script-beta/core/hover/init.lua6
-rw-r--r--script-beta/core/hover/label.lua6
4 files changed, 10 insertions, 11 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