diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-01-28 19:57:00 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-01-28 19:57:00 +0800 |
commit | 0c083272ea34af6705ad838d013fe2a3a85234a2 (patch) | |
tree | fd0386264e83263d99f343d72e67515d9b046a77 /script/provider | |
parent | 457b73fd22d8ed34301a6a606636d3003735b4dc (diff) | |
download | lua-language-server-0c083272ea34af6705ad838d013fe2a3a85234a2.zip |
update locale
Diffstat (limited to 'script/provider')
-rw-r--r-- | script/provider/diagnostic.lua | 20 | ||||
-rw-r--r-- | script/provider/provider.lua | 23 |
2 files changed, 22 insertions, 21 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index 7be65339..9f9416fb 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -186,7 +186,7 @@ function m.doDiagnostic(uri) return end - local prog <close> = progress.create('正在诊断', 0.5) + local prog <close> = progress.create(lang.script.WINDOW_DIAGNOSING, 0.5) prog:setMessage(ws.getRelativePath(files.getOriginUri(uri))) local syntax = m.syntaxErrors(uri, ast) @@ -246,36 +246,38 @@ local function askForDisable() if m.dontAskedForDisable then return end + local delay = 30 + local delayTitle = lang.script('WINDOW_DELAY_WS_DIAGNOSTIC', delay) local item = proto.awaitRequest('window/showMessageRequest', { type = define.MessageType.Info, - message = '你可以在设置中延迟或禁用工作目录诊断', + message = lang.script.WINDOW_SETTING_WS_DIAGNOSTIC, actions = { { - title = '不再提醒', + title = lang.script.WINDOW_DONT_SHOW_AGAIN, }, { - title = '空闲时进行工作区诊断(延迟30秒)', + title = delayTitle, }, { - title = '禁用工作区诊断', + title = lang.script.WINDOW_DISABLE_DIAGNOSTIC, }, } }) if not item then return end - if item.title == '不再提醒' then + if item.title == lang.script.WINDOW_DONT_SHOW_AGAIN then m.dontAskedForDisable = true - elseif item.title == '空闲时再进行诊断(延迟30秒)' then + elseif item.title == delayTitle then proto.notify('$/command', { command = 'lua.config', data = { key = 'Lua.diagnostics.workspaceDelay', action = 'set', - value = 30000, + value = delay * 1000, } }) - elseif item.title == '禁用工作区诊断' then + elseif item.title == lang.script.WINDOW_DISABLE_DIAGNOSTIC then proto.notify('workspace/executeCommand', { command = 'lua.config', data = { diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 894b8ef2..31cefbff 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -104,7 +104,7 @@ end) proto.on('initialized', function (params) files.init() - local _ <close> = progress.create('正在初始化...', 0.5) + local _ <close> = progress.create(lang.script.WINDOW_INITIALIZING, 0.5) updateConfig() proto.awaitRequest('client/registerCapability', { registrations = { @@ -225,7 +225,7 @@ proto.on('textDocument/hover', function (params) await.close 'hover' await.setID 'hover' workspace.awaitReady() - local _ <close> = progress.create('正在处理悬浮提示...', 0.5) + local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_HOVER, 0.5) local core = require 'core.hover' local doc = params.textDocument local uri = doc.uri @@ -255,7 +255,7 @@ end) proto.on('textDocument/definition', function (params) workspace.awaitReady() - local _ <close> = progress.create('正在处理转到定义...', 0.5) + local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_DEFINITION, 0.5) local core = require 'core.definition' local uri = params.textDocument.uri if not files.exists(uri) then @@ -284,7 +284,7 @@ end) proto.on('textDocument/references', function (params) workspace.awaitReady() - local _ <close> = progress.create('正在处理转到引用...', 0.5) + local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_REFERENCE, 0.5) local core = require 'core.reference' local uri = params.textDocument.uri if not files.exists(uri) then @@ -328,7 +328,7 @@ end) proto.on('textDocument/rename', function (params) workspace.awaitReady() - local _ <close> = progress.create('正在处理重命名...', 0.5) + local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_RENAME, 0.5) local core = require 'core.rename' local uri = params.textDocument.uri if not files.exists(uri) then @@ -372,7 +372,7 @@ end) proto.on('textDocument/completion', function (params) workspace.awaitReady() - local _ <close> = progress.create('正在处理自动完成...', 0.5) + local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_COMPLETION, 0.5) --log.info(util.dump(params)) local core = require 'core.completion' --log.debug('textDocument/completion') @@ -497,7 +497,7 @@ proto.on('textDocument/signatureHelp', function (params) return nil end workspace.awaitReady() - local _ <close> = progress.create('正在处理参数提示...', 0.5) + local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_SIGNATURE, 0.5) local uri = params.textDocument.uri if not files.exists(uri) then return nil @@ -538,7 +538,7 @@ end) proto.on('textDocument/documentSymbol', function (params) local core = require 'core.document-symbol' - local _ <close> = progress.create('正在处理文件符号...', 0.5) + local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_SYMBOL, 0.5) local uri = params.textDocument.uri while not files.exists(uri) do await.sleep(0.1) @@ -623,7 +623,7 @@ end) proto.on('workspace/symbol', function (params) workspace.awaitReady() - local _ <close> = progress.create('正在处理工作区符号...', 0.5) + local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_WS_SYMBOL, 0.5) local core = require 'core.workspace-symbol' await.close('workspace/symbol') @@ -656,7 +656,7 @@ end) proto.on('textDocument/semanticTokens/full', function (params) workspace.awaitReady() - local _ <close> = progress.create('正在处理全量语义着色...', 0.5) + local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_SEMANTIC_FULL, 0.5) local core = require 'core.semantic-tokens' local uri = params.textDocument.uri log.debug('semanticTokens/full', uri) @@ -673,7 +673,7 @@ end) proto.on('textDocument/semanticTokens/range', function (params) workspace.awaitReady() - local _ <close> = progress.create('正在处理差量语义着色...', 0.5) + local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_SEMANTIC_RANGE, 0.5) local core = require 'core.semantic-tokens' local uri = params.textDocument.uri log.debug('semanticTokens/range', uri) @@ -719,6 +719,5 @@ proto.on('textDocument/foldingRange', function (params) end) proto.on('window/workDoneProgress/cancel', function (params) - local progress = require 'progress' progress.cancel(params.token) end) |