summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/locale/en-US/script.lni1
-rw-r--r--server/locale/zh-CN/script.lni1
-rw-r--r--server/src/core/completion.lua3
-rw-r--r--server/test/completion/init.lua2
4 files changed, 5 insertions, 2 deletions
diff --git a/server/locale/en-US/script.lni b/server/locale/en-US/script.lni
index f56b8024..39256be4 100644
--- a/server/locale/en-US/script.lni
+++ b/server/locale/en-US/script.lni
@@ -69,6 +69,7 @@ HOVER_DOCUMENT_LUA52 = '[View documents](http://www.lua.org/manual/5.2/manual
HOVER_DOCUMENT_LUA53 = '[View documents](http://www.lua.org/manual/5.3/manual.html#pdf-{})'
HOVER_DOCUMENT_LUA54 = '[View documents](http://www.lua.org/work/doc/manual.html#pdf-{})'
HOVER_DOCUMENT_LUAJIT = '[View documents](http://www.lua.org/manual/5.1/manual.html#pdf-{})'
+HOVER_MULTI_PROTOTYPE = '({} prototypes)'
ACTION_DISABLE_DIAG = 'Disable diagnostics ({}).'
ACTION_MARK_GLOBAL = 'Mark `{}` as defined global.'
diff --git a/server/locale/zh-CN/script.lni b/server/locale/zh-CN/script.lni
index 2b5d33e1..e1f775ef 100644
--- a/server/locale/zh-CN/script.lni
+++ b/server/locale/zh-CN/script.lni
@@ -69,6 +69,7 @@ HOVER_DOCUMENT_LUA52 = '[查看文档](http://www.lua.org/manual/5.2/manual.h
HOVER_DOCUMENT_LUA53 = '[查看文档](http://cloudwu.github.io/lua53doc/manual.html#pdf-{})'
HOVER_DOCUMENT_LUA54 = '[查看文档](http://www.lua.org/work/doc/manual.html#pdf-{})'
HOVER_DOCUMENT_LUAJIT = '[查看文档](http://www.lua.org/manual/5.1/manual.html#pdf-{})'
+HOVER_MULTI_PROTOTYPE = '({} 个原型)'
ACTION_DISABLE_DIAG = '禁用诊断({})。'
ACTION_MARK_GLOBAL = '标记 `{}` 为已定义的全局变量。'
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua
index 3575622e..a0a7fb82 100644
--- a/server/src/core/completion.lua
+++ b/server/src/core/completion.lua
@@ -6,6 +6,7 @@ local sourceMgr = require 'vm.source'
local config = require 'config'
local matchKey = require 'core.matchKey'
local parser = require 'parser'
+local lang = require 'language'
local State
local CompletionItemKind = {
@@ -123,7 +124,7 @@ local function getDetail(value)
local func = value:getFunction()
local overLoads = func and func:getEmmyOverLoads()
if overLoads then
- detals[#detals+1] = ('(%d 个原型)'):format(#overLoads + 1)
+ detals[#detals+1] = lang.script('HOVER_MULTI_PROTOTYPE', #overLoads + 1)
end
end
if #detals == 0 then
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua
index c60e8ea0..5f43b8d2 100644
--- a/server/test/completion/init.lua
+++ b/server/test/completion/init.lua
@@ -1304,7 +1304,7 @@ zzz$
{
label = 'zzzzz',
kind = CompletionItemKind.Function,
- detail = '(function)(4 个原型)',
+ detail = '(function)(4 prototypes)',
documentation = {
kind = 'markdown',
value = [[