diff options
Diffstat (limited to 'locale')
-rw-r--r-- | locale/en-us/meta.lua | 10 | ||||
-rw-r--r-- | locale/en-us/script.lua | 103 | ||||
-rw-r--r-- | locale/en-us/setting.lua | 20 | ||||
-rw-r--r-- | locale/pt-br/meta.lua | 10 | ||||
-rw-r--r-- | locale/pt-br/script.lua | 91 | ||||
-rw-r--r-- | locale/pt-br/setting.lua | 20 | ||||
-rw-r--r-- | locale/zh-cn/meta.lua | 10 | ||||
-rw-r--r-- | locale/zh-cn/script.lua | 117 | ||||
-rw-r--r-- | locale/zh-cn/setting.lua | 192 | ||||
-rw-r--r-- | locale/zh-tw/meta.lua | 10 | ||||
-rw-r--r-- | locale/zh-tw/script.lua | 91 | ||||
-rw-r--r-- | locale/zh-tw/setting.lua | 22 |
12 files changed, 434 insertions, 262 deletions
diff --git a/locale/en-us/meta.lua b/locale/en-us/meta.lua index 9ab6aab8..e1ca5577 100644 --- a/locale/en-us/meta.lua +++ b/locale/en-us/meta.lua @@ -519,11 +519,11 @@ math.log10 = 'Returns the base-10 logarithm of x.' math.max = 'Returns the argument with the maximum value, according to the Lua operator `<`.' -math.maxinteger = +math.maxinteger['>5.3'] = 'An integer with the maximum value for an integer.' math.min = 'Returns the argument with the minimum value, according to the Lua operator `<`.' -math.mininteger = +math.mininteger['>5.3'] = 'An integer with the minimum value for an integer.' math.modf = 'Returns the integral part of `x` and the fractional part of `x`.' @@ -557,11 +557,11 @@ math.tan = 'Returns the tangent of `x` (assumed to be in radians).' math.tanh = 'Returns the hyperbolic tangent of `x` (assumed to be in radians).' -math.tointeger = +math.tointeger['>5.3'] = 'If the value `x` is convertible to an integer, returns that integer.' -math.type = +math.type['>5.3'] = 'Returns `"integer"` if `x` is an integer, `"float"` if it is a float, or `nil` if `x` is not a number.' -math.ult = +math.ult['>5.3'] = 'Returns `true` if and only if `m` is below `n` when they are compared as unsigned integers.' os = diff --git a/locale/en-us/script.lua b/locale/en-us/script.lua index a830ab19..20d858bb 100644 --- a/locale/en-us/script.lua +++ b/locale/en-us/script.lua @@ -1,7 +1,7 @@ DIAG_LINE_ONLY_SPACE = 'Line with spaces only.' DIAG_LINE_POST_SPACE = -'Line with postspace.' +'Line with trailing space.' DIAG_UNUSED_LOCAL = 'Unused local `{}`.' DIAG_UNDEF_GLOBAL = @@ -120,10 +120,16 @@ DIAG_MISSING_GLOBAL_DOC_PARAM = 'Missing @param annotation for parameter `{}` in global function `{}`.' DIAG_MISSING_GLOBAL_DOC_RETURN = 'Missing @return annotation at index `{}` in global function `{}`.' +DIAG_MISSING_LOCAL_EXPORT_DOC_COMMENT = +'Missing comment for exported local function `{}`.' +DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM = +'Missing @param annotation for parameter `{}` in exported local function `{}`.' +DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN = +'Missing @return annotation at index `{}` in exported local function `{}`.' DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM = -'Incomplete signature. Missing @param annotation for parameter `{}` in function `{}`.' +'Incomplete signature. Missing @param annotation for parameter `{}`.' DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN = -'Incomplete signature. Missing @return annotation at index `{}` in function `{}`.' +'Incomplete signature. Missing @return annotation at index `{}`.' DIAG_UNKNOWN_DIAG_CODE = 'Unknown diagnostic code `{}`.' DIAG_CAST_LOCAL_TYPE = @@ -160,8 +166,16 @@ DIAG_INVISIBLE_PROTECTED = 'Field `{field}` is protected, it can only be accessed in class `{class}` and its subclasses.' DIAG_INVISIBLE_PACKAGE = 'Field `{field}` can only be accessed in same file `{uri}`.' -DIAG_GLOBAL_ELEMENT = +DIAG_GLOBAL_ELEMENT = 'Element is global.' +DIAG_MISSING_FIELDS = +'Missing required fields in type `{1}`: {2}' +DIAG_INJECT_FIELD = +'Fields cannot be injected into the reference of `{class}` for `{field}`. {fix}' +DIAG_INJECT_FIELD_FIX_CLASS = +'To do so, use `---@class` for `{node}`.' +DIAG_INJECT_FIELD_FIX_TABLE = +'To allow injection, add `{fix}` to the definition.' MWS_NOT_SUPPORT = '{} does not support multi workspace for now, I may need to restart to support the new workspace ...' @@ -189,9 +203,9 @@ WORKSPACE_DIAGNOSTIC = WORKSPACE_SKIP_HUGE_FILE = 'For performance reasons, the parsing of this file has been stopped: {}' WORKSPACE_NOT_ALLOWED = -'Your workspace is set to `{}`. Lua language server refused to load this directory. Please check your configuration.[learn more here](https://github.com/LuaLS/lua-language-server/wiki/FAQ#why-is-the-server-scanning-the-wrong-folder)' +'Your workspace is set to `{}`. Lua language server refused to load this directory. Please check your configuration.[learn more here](https://luals.github.io/wiki/faq#why-is-the-server-scanning-the-wrong-folder)' WORKSPACE_SCAN_TOO_MUCH = -'More than {} files have been scanned. The current scanned directory is `{}`. Please see the [FAQ](https://github.com/LuaLS/lua-language-server/wiki/FAQ#how-can-i-improve-startup-speeds) to see how you can include fewer files. It is also possible that your [configuration is incorrect](https://github.com/LuaLS/lua-language-server/wiki/FAQ#why-is-the-server-scanning-the-wrong-folder).' +'More than {} files have been scanned. The current scanned directory is `{}`. Please see the [FAQ](https://luals.github.io/wiki/faq/#how-can-i-improve-startup-speeds) to see how you can include fewer files. It is also possible that your [configuration is incorrect](https://luals.github.io/wiki/faq#why-is-the-server-scanning-the-wrong-folder).' PARSER_CRASH = 'Parser crashed! Last words:{}' @@ -287,9 +301,9 @@ PARSER_INDEX_IN_FUNC_NAME = 'The `[name]` form cannot be used in the name of a named function.' PARSER_UNKNOWN_ATTRIBUTE = 'Local attribute should be `const` or `close`' -PARSER_AMBIGUOUS_SYNTAX = -- TODO: need translate! +PARSER_AMBIGUOUS_SYNTAX = 'In Lua 5.1, the left brackets called by the function must be in the same line as the function.' -PARSER_NEED_PAREN = -- TODO: need translate! +PARSER_NEED_PAREN = 'Need to add a pair of parentheses.' PARSER_NESTING_LONG_MARK = 'Nesting of `[[...]]` is not allowed in Lua 5.1 .' @@ -440,8 +454,10 @@ ACTION_MARK_ASYNC = 'Mark current function as async.' ACTION_ADD_DICT = 'Add \'{}\' to workspace dict' -ACTION_FIX_ADD_PAREN = -- TODO: need translate! +ACTION_FIX_ADD_PAREN = 'Add parentheses.' +ACTION_AUTOREQUIRE = +"Import '{}' as {}" COMMAND_DISABLE_DIAG = 'Disable diagnostics' @@ -542,7 +558,7 @@ WINDOW_APPLY_SETTING = WINDOW_CHECK_SEMANTIC = 'If you are using the color theme in the market, you may need to modify `editor.semanticHighlighting.enabled` to `true` to make semantic tokens take effect.' WINDOW_TELEMETRY_HINT = -'Please allow sending anonymous usage data and error reports to help us further improve this extension. Read our privacy policy [here](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy) .' +'Please allow sending anonymous usage data and error reports to help us further improve this extension. Read our privacy policy [here](https://luals.github.io/privacy#language-server) .' WINDOW_TELEMETRY_ENABLE = 'Allow' WINDOW_TELEMETRY_DISABLE = @@ -687,7 +703,7 @@ Defines a class/table structure Manager = {} ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#class) +[View Wiki](https://luals.github.io/wiki/annotations#class) ]=] LUADOC_DESC_TYPE = [=[ @@ -738,7 +754,7 @@ local x --x[""] is true local myFunction ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#types-and-type) +[View Wiki](https://luals.github.io/wiki/annotations#type) ]=] LUADOC_DESC_ALIAS = [=[ @@ -788,7 +804,7 @@ local enums = { ---| `enums.CLOSE` ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#alias) +[View Wiki](https://luals.github.io/wiki/annotations#alias) ]=] LUADOC_DESC_PARAM = [=[ @@ -813,7 +829,7 @@ function get(url, headers, timeout) end function concat(base, ...) end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#param) +[View Wiki](https://luals.github.io/wiki/annotations#param) ]=] LUADOC_DESC_RETURN = [=[ @@ -851,7 +867,7 @@ function getFirstLast() end function getTags(item) end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#return) +[View Wiki](https://luals.github.io/wiki/annotations#return) ]=] LUADOC_DESC_FIELD = [=[ @@ -882,7 +898,7 @@ response = get("localhost") statusCode = response.status.code ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#field) +[View Wiki](https://luals.github.io/wiki/annotations#field) ]=] LUADOC_DESC_GENERIC = [=[ @@ -939,7 +955,7 @@ local v = Generic("Foo") -- v is an object of Foo -- we give for key (K) or value (V) ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#generics-and-generic) +[View Wiki](https://luals.github.io/wiki/annotations/#generic) ]=] LUADOC_DESC_VARARG = [=[ @@ -958,7 +974,7 @@ provide typing or allow descriptions. function concat(...) end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#vararg) +[View Wiki](https://luals.github.io/wiki/annotations/#vararg) ]=] LUADOC_DESC_OVERLOAD = [=[ @@ -973,7 +989,7 @@ Allows defining of multiple function signatures. function table.insert(t, position, value) end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#overload) +[View Wiki](https://luals.github.io/wiki/annotations#overload) ]=] LUADOC_DESC_DEPRECATED = [=[ @@ -984,7 +1000,7 @@ being ~~struck through~~. `---@deprecated` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#deprecated) +[View Wiki](https://luals.github.io/wiki/annotations#deprecated) ]=] LUADOC_DESC_META = [=[ @@ -999,7 +1015,7 @@ There are 3 main distinctions to note with meta files: `---@meta` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#meta) +[View Wiki](https://luals.github.io/wiki/annotations#meta) ]=] LUADOC_DESC_VERSION = [=[ @@ -1024,7 +1040,7 @@ function onlyWorksInJIT() end function oldLuaOnly() end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#version) +[View Wiki](https://luals.github.io/wiki/annotations#version) ]=] LUADOC_DESC_SEE = [=[ @@ -1034,7 +1050,7 @@ Define something that can be viewed for more information `---@see <text>` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#see) +[View Wiki](https://luals.github.io/wiki/annotations#see) ]=] LUADOC_DESC_DIAGNOSTIC = [=[ @@ -1060,7 +1076,7 @@ local unused = "hello world" ---@diagnostic enable: unused-local ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#diagnostic) +[View Wiki](https://luals.github.io/wiki/annotations#diagnostic) ]=] LUADOC_DESC_MODULE = [=[ @@ -1077,7 +1093,7 @@ local stringUtils local module = require('string.utils') ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#module) +[View Wiki](https://luals.github.io/wiki/annotations#module) ]=] LUADOC_DESC_ASYNC = [=[ @@ -1087,7 +1103,7 @@ Marks a function as asynchronous. `---@async` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#async) +[View Wiki](https://luals.github.io/wiki/annotations#async) ]=] LUADOC_DESC_NODISCARD = [=[ @@ -1099,7 +1115,7 @@ be ignored. `---@nodiscard` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#nodiscard) +[View Wiki](https://luals.github.io/wiki/annotations#nodiscard) ]=] LUADOC_DESC_CAST = [=[ @@ -1134,7 +1150,7 @@ local x --> string|table print(x) --> table ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#cast) +[View Wiki](https://luals.github.io/wiki/annotations#cast) ]=] LUADOC_DESC_OPERATOR = [=[ @@ -1169,7 +1185,7 @@ pB = -pA LUADOC_DESC_ENUM = [=[ Mark a table as an enum. If you want an enum but can't define it as a Lua -table, take a look at the [`@alias`](https://github.com/LuaLS/lua-language-server/wiki/Annotations#alias) +table, take a look at the [`@alias`](https://luals.github.io/wiki/annotations#alias) tag. ## Syntax @@ -1193,6 +1209,33 @@ local function setColor(color) end setColor(colors.green) ``` ]=] +LUADOC_DESC_SOURCE = +[=[ +Provide a reference to some source code which lives in another file. When +searching for the definition of an item, its `@source` will be used. + +## Syntax +`@source <path>` + +## Usage +``` +---You can use absolute paths +---@source C:/Users/me/Documents/program/myFile.c +local a + +---Or URIs +---@source file:///C:/Users/me/Documents/program/myFile.c:10 +local b + +---Or relative paths +---@source local/file.c +local c + +---You can also include line and char numbers +---@source local/file.c:10:8 +local d +``` +]=] LUADOC_DESC_PACKAGE = [=[ Mark a function as private to the file it is defined in. A packaged function @@ -1217,7 +1260,7 @@ end LUADOC_DESC_PRIVATE = [=[ Mark a function as private to a @class. Private functions can be accessed only -from within their class and are not accessable from child classes. +from within their class and are not accessible from child classes. ## Syntax `@private` diff --git a/locale/en-us/setting.lua b/locale/en-us/setting.lua index a354ff0b..80926d12 100644 --- a/locale/en-us/setting.lua +++ b/locale/en-us/setting.lua @@ -27,7 +27,7 @@ config.runtime.unicodeName = config.runtime.nonstandardSymbol = "Supports non-standard symbols. Make sure that your runtime environment supports these symbols." config.runtime.plugin = -"Plugin path. Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/Plugins) to learn more." +"Plugin path. Please read [wiki](https://luals.github.io/wiki/plugins) to learn more." config.runtime.pluginArgs = "Additional arguments for the plugin." config.runtime.fileEncoding = @@ -269,22 +269,16 @@ Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/doc ]] config.spell.dict = 'Custom words for spell checking.' +config.nameStyle.config = +'Set name style config' config.telemetry.enable = [[ -Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy). +Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://luals.github.io/privacy/#language-server). ]] config.misc.parameters = '[Command line parameters](https://github.com/LuaLS/lua-telemetry-server/tree/master/method) when starting the language server in VSCode.' config.misc.executablePath = 'Specify the executable path in VSCode.' -config.IntelliSense.traceLocalSet = -'Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.' -config.IntelliSense.traceReturn = -'Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.' -config.IntelliSense.traceBeSetted = -'Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.' -config.IntelliSense.traceFieldInject = -'Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.' config.type.castNumberToInteger = 'Allowed to assign the `number` type to the `integer` type.' config.type.weakUnionCheck = @@ -379,6 +373,8 @@ config.diagnostics['invisible'] = 'Enable diagnostics for accesses to fields which are invisible.' config.diagnostics['missing-global-doc'] = 'Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.' +config.diagnostics['missing-local-export-doc'] = +'Missing annotations for exported locals! Exported local functions must have a comment and annotations for all parameters and return values.' config.diagnostics['missing-parameter'] = 'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.' config.diagnostics['missing-return'] = @@ -401,6 +397,8 @@ config.diagnostics['return-type-mismatch'] = 'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.' config.diagnostics['spell-check'] = 'Enable diagnostics for typos in strings.' +config.diagnostics['name-style-check'] = +'Enable diagnostics for name style.' config.diagnostics['unbalanced-assignments']= 'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).' config.diagnostics['undefined-doc-class'] = @@ -434,3 +432,5 @@ command.exportDocument = 'Lua: Export Document ...' command.addon_manager.open = 'Lua: Open Addon Manager ...' +command.reloadFFIMeta = +'Lua: Reload luajit ffi meta' diff --git a/locale/pt-br/meta.lua b/locale/pt-br/meta.lua index f21dac60..ddd81ce2 100644 --- a/locale/pt-br/meta.lua +++ b/locale/pt-br/meta.lua @@ -519,11 +519,11 @@ math.log10 = 'Retorna o logaritmo `x` na base 10.' math.max = 'Retorna o argumento com o valor máximo de acordo com o operador `<`.' -math.maxinteger = +math.maxinteger['>5.3'] = 'Retorna o valor máximo para um inteiro.' math.min = 'Retorna o argumento com o valor mínimo de acordo com o operador `<`.' -math.mininteger = +math.mininteger['>5.3'] = 'Retorna o valor mínimo para um inteiro.' math.modf = 'Retorna a parte inteira e a parte fracionária de `x`.' @@ -557,11 +557,11 @@ math.tan = 'Retorna a tangente de `x` (requer valor em radianos).' math.tanh = 'Retorna a tangente hiperbólica de `x` (requer valor em radianos).' -math.tointeger = +math.tointeger['>5.3'] = 'Se o valor `x` pode ser convertido para um inteiro, retorna esse inteiro.' -math.type = +math.type['>5.3'] = 'Retorna `"integer"` se `x` é um inteiro, `"float"` se for um valor real (i.e., ponto flutuante), ou `nil` se `x` não é um número.' -math.ult = +math.ult['>5.3'] = 'Retorna `true` se e somente se `m` é menor `n` quando eles são comparados como inteiros sem sinal.' os = diff --git a/locale/pt-br/script.lua b/locale/pt-br/script.lua index 03e17c15..2357aa50 100644 --- a/locale/pt-br/script.lua +++ b/locale/pt-br/script.lua @@ -120,10 +120,16 @@ DIAG_MISSING_GLOBAL_DOC_PARAM = -- TODO: need translate! 'Missing @param annotation for parameter `{}` in global function `{}`.' DIAG_MISSING_GLOBAL_DOC_RETURN = -- TODO: need translate! 'Missing @return annotation at index `{}` in global function `{}`.' +DIAG_MISSING_LOCAL_EXPORT_DOC_COMMENT = -- TODO: need translate! +'Missing comment for exported local function `{}`.' +DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM = -- TODO: need translate! +'Missing @param annotation for parameter `{}` in exported local function `{}`.' +DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN = -- TODO: need translate! +'Missing @return annotation at index `{}` in exported local function `{}`.' DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM = -- TODO: need translate! -'Incomplete signature. Missing @param annotation for parameter `{}` in function `{}`.' +'Incomplete signature. Missing @param annotation for parameter `{}`.' DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN = -- TODO: need translate! -'Incomplete signature. Missing @return annotation at index `{}` in function `{}`.' +'Incomplete signature. Missing @return annotation at index `{}`.' DIAG_UNKNOWN_DIAG_CODE = -- TODO: need translate! 'Código de diagnóstico desconhecido `{}`.' DIAG_CAST_LOCAL_TYPE = -- TODO: need translate! @@ -162,6 +168,14 @@ DIAG_INVISIBLE_PACKAGE = -- TODO: need translate! 'Field `{field}` can only be accessed in same file `{uri}`.' DIAG_GLOBAL_ELEMENT = -- TODO: need translate! 'Element is global.' +DIAG_MISSING_FIELDS = -- TODO: need translate! +'Missing required fields in type `{1}`: {2}' +DIAG_INJECT_FIELD = -- TODO: need translate! +'Fields cannot be injected into the reference of `{class}` for `{field}`. {fix}' +DIAG_INJECT_FIELD_FIX_CLASS = -- TODO: need translate! +'To do so, use `---@class` for `{node}`.' +DIAG_INJECT_FIELD_FIX_TABLE = -- TODO: need translate! +'如要允许注入,请在定义中添加 `{fix}` 。' MWS_NOT_SUPPORT = '{} não é suportado múltiplos espaços de trabalho por enquanto, posso precisar reiniciar para estabelecer um novo espaço de trabalho ...' @@ -189,9 +203,9 @@ WORKSPACE_DIAGNOSTIC = WORKSPACE_SKIP_HUGE_FILE = 'Por motivos de desempenho, a análise deste arquivo foi interrompida: {}' WORKSPACE_NOT_ALLOWED = -'Seu espaço de trabalho foi definido para `{}`. Servidor da linguagem Lua recusou o carregamneto neste diretório. Por favor, cheque sua configuração. [aprenda mais aqui](https://github.com/LuaLS/lua-language-server/wiki/FAQ#why-is-the-server-scanning-the-wrong-folder)' +'Seu espaço de trabalho foi definido para `{}`. Servidor da linguagem Lua recusou o carregamneto neste diretório. Por favor, cheque sua configuração. [aprenda mais aqui](https://luals.github.io/wiki/faq#why-is-the-server-scanning-the-wrong-folder)' WORKSPACE_SCAN_TOO_MUCH = -- TODO: need translate! -'Mais do que {} arquivos foram escaneados. O diretório atual escaneado é `{}`. Please see the [FAQ](https://github.com/LuaLS/lua-language-server/wiki/FAQ#how-can-i-improve-startup-speeds) to see how you can include fewer files. It is also possible that your [configuration is incorrect](https://github.com/LuaLS/lua-language-server/wiki/FAQ#why-is-the-server-scanning-the-wrong-folder).' +'Mais do que {} arquivos foram escaneados. O diretório atual escaneado é `{}`. Please see the [FAQ](https://luals.github.io/wiki/faq#how-can-i-improve-startup-speeds) to see how you can include fewer files. It is also possible that your [configuration is incorrect](https://luals.github.io/wiki/faq#why-is-the-server-scanning-the-wrong-folder).' PARSER_CRASH = 'Parser quebrou! Últimas palavras: {}' @@ -442,6 +456,8 @@ ACTION_ADD_DICT = 'Adicione \'{}\' ao seu espaço de trabalho no ' ACTION_FIX_ADD_PAREN = -- TODO: need translate! '添加括号。' +ACTION_AUTOREQUIRE = -- TODO: need translate! +"Import '{}' as {}" COMMAND_DISABLE_DIAG = 'Desativar diagnósticos.' @@ -542,7 +558,7 @@ WINDOW_APPLY_SETTING = WINDOW_CHECK_SEMANTIC = 'Se você estiver usando o tema de cores do market, talvez seja necessário modificar `editor.semanticHighlighting.enabled` para `true` para fazer com tokens semânticas sejam habilitados.' WINDOW_TELEMETRY_HINT = -'Por favor, permita o envio de dados de uso e relatórios de erro anônimos para nos ajudar a melhorar ainda mais essa extensão. Leia nossa política de privacidade [aqui](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy) .' +'Por favor, permita o envio de dados de uso e relatórios de erro anônimos para nos ajudar a melhorar ainda mais essa extensão. Leia nossa política de privacidade [aqui](https://luals.github.io/privacy/#language-server) .' WINDOW_TELEMETRY_ENABLE = 'Permitir' WINDOW_TELEMETRY_DISABLE = @@ -687,7 +703,7 @@ Defines a class/table structure Manager = {} ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#class) +[View Wiki](https://luals.github.io/wiki/annotations#class) ]=] LUADOC_DESC_TYPE = -- TODO: need translate! [=[ @@ -738,7 +754,7 @@ local x --x[""] is true local myFunction ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#types-and-type) +[View Wiki](https://luals.github.io/wiki/annotations#type) ]=] LUADOC_DESC_ALIAS = -- TODO: need translate! [=[ @@ -788,7 +804,7 @@ local enums = { ---| `enums.CLOSE` ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#alias) +[View Wiki](https://luals.github.io/wiki/annotations#alias) ]=] LUADOC_DESC_PARAM = -- TODO: need translate! [=[ @@ -813,7 +829,7 @@ function get(url, headers, timeout) end function concat(base, ...) end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#param) +[View Wiki](https://luals.github.io/wiki/annotations#param) ]=] LUADOC_DESC_RETURN = -- TODO: need translate! [=[ @@ -851,7 +867,7 @@ function getFirstLast() end function getTags(item) end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#return) +[View Wiki](https://luals.github.io/wiki/annotations#return) ]=] LUADOC_DESC_FIELD = -- TODO: need translate! [=[ @@ -882,7 +898,7 @@ response = get("localhost") statusCode = response.status.code ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#field) +[View Wiki](https://luals.github.io/wiki/annotations#field) ]=] LUADOC_DESC_GENERIC = -- TODO: need translate! [=[ @@ -939,7 +955,7 @@ local v = Generic("Foo") -- v is an object of Foo -- we give for key (K) or value (V) ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#generics-and-generic) +[View Wiki](https://luals.github.io/wiki/annotations/#generic) ]=] LUADOC_DESC_VARARG = -- TODO: need translate! [=[ @@ -958,7 +974,7 @@ provide typing or allow descriptions. function concat(...) end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#vararg) +[View Wiki](https://luals.github.io/wiki/annotations#vararg) ]=] LUADOC_DESC_OVERLOAD = -- TODO: need translate! [=[ @@ -973,7 +989,7 @@ Allows defining of multiple function signatures. function table.insert(t, position, value) end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#overload) +[View Wiki](https://luals.github.io/wiki/annotations#overload) ]=] LUADOC_DESC_DEPRECATED = -- TODO: need translate! [=[ @@ -984,7 +1000,7 @@ being ~~struck through~~. `---@deprecated` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#deprecated) +[View Wiki](https://luals.github.io/wiki/annotations#deprecated) ]=] LUADOC_DESC_META = -- TODO: need translate! [=[ @@ -999,7 +1015,7 @@ There are 3 main distinctions to note with meta files: `---@meta` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#meta) +[View Wiki](https://luals.github.io/wiki/annotations#meta) ]=] LUADOC_DESC_VERSION = -- TODO: need translate! [=[ @@ -1024,7 +1040,7 @@ function onlyWorksInJIT() end function oldLuaOnly() end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#version) +[View Wiki](https://luals.github.io/wiki/annotations#version) ]=] LUADOC_DESC_SEE = -- TODO: need translate! [=[ @@ -1034,7 +1050,7 @@ Define something that can be viewed for more information `---@see <text>` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#see) +[View Wiki](https://luals.github.io/wiki/annotations#see) ]=] LUADOC_DESC_DIAGNOSTIC = -- TODO: need translate! [=[ @@ -1060,7 +1076,7 @@ local unused = "hello world" ---@diagnostic enable: unused-local ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#diagnostic) +[View Wiki](https://luals.github.io/wiki/annotations#diagnostic) ]=] LUADOC_DESC_MODULE = -- TODO: need translate! [=[ @@ -1077,7 +1093,7 @@ local stringUtils local module = require('string.utils') ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#module) +[View Wiki](https://luals.github.io/wiki/annotations#module) ]=] LUADOC_DESC_ASYNC = -- TODO: need translate! [=[ @@ -1087,7 +1103,7 @@ Marks a function as asynchronous. `---@async` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#async) +[View Wiki](https://luals.github.io/wiki/annotations#async) ]=] LUADOC_DESC_NODISCARD = -- TODO: need translate! [=[ @@ -1099,7 +1115,7 @@ be ignored. `---@nodiscard` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#nodiscard) +[View Wiki](https://luals.github.io/wiki/annotations#nodiscard) ]=] LUADOC_DESC_CAST = -- TODO: need translate! [=[ @@ -1134,7 +1150,7 @@ local x --> string|table print(x) --> table ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#cast) +[View Wiki](https://luals.github.io/wiki/annotations#cast) ]=] LUADOC_DESC_OPERATOR = -- TODO: need translate! [=[ @@ -1169,7 +1185,7 @@ pB = -pA LUADOC_DESC_ENUM = -- TODO: need translate! [=[ Mark a table as an enum. If you want an enum but can't define it as a Lua -table, take a look at the [`@alias`](https://github.com/LuaLS/lua-language-server/wiki/Annotations#alias) +table, take a look at the [`@alias`](https://luals.github.io/wiki/annotations#alias) tag. ## Syntax @@ -1193,6 +1209,33 @@ local function setColor(color) end setColor(colors.green) ``` ]=] +LUADOC_DESC_SOURCE = -- TODO: need translate! +[=[ +Provide a reference to some source code which lives in another file. When +searching for the defintion of an item, its `@source` will be used. + +## Syntax +`@source <path>` + +## Usage +``` +---You can use absolute paths +---@source C:/Users/me/Documents/program/myFile.c +local a + +---Or URIs +---@source file:///C:/Users/me/Documents/program/myFile.c:10 +local b + +---Or relative paths +---@source local/file.c +local c + +---You can also include line and char numbers +---@source local/file.c:10:8 +local d +``` +]=] LUADOC_DESC_PACKAGE = -- TODO: need translate! [=[ Mark a function as private to the file it is defined in. A packaged function diff --git a/locale/pt-br/setting.lua b/locale/pt-br/setting.lua index c38f0ff0..4e23e0ff 100644 --- a/locale/pt-br/setting.lua +++ b/locale/pt-br/setting.lua @@ -27,7 +27,7 @@ config.runtime.unicodeName = -- TODO: need translate! config.runtime.nonstandardSymbol = -- TODO: need translate! "Supports non-standard symbols. Make sure that your runtime environment supports these symbols." config.runtime.plugin = -- TODO: need translate! -"Plugin path. Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/Plugins) to learn more." +"Plugin path. Please read [wiki](https://luals.github.io/wiki/plugins) to learn more." config.runtime.pluginArgs = -- TODO: need translate! "Additional arguments for the plugin." config.runtime.fileEncoding = -- TODO: need translate! @@ -269,22 +269,16 @@ Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/doc ]] config.spell.dict = -- TODO: need translate! 'Custom words for spell checking.' +config.nameStyle.config = -- TODO: need translate! +'Set name style config' config.telemetry.enable = -- TODO: need translate! [[ -Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy). +Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://luals.github.io/privacy/#language-server). ]] config.misc.parameters = -- TODO: need translate! '[Command line parameters](https://github.com/LuaLS/lua-telemetry-server/tree/master/method) when starting the language service in VSCode.' config.misc.executablePath = -- TODO: need translate! 'Specify the executable path in VSCode.' -config.IntelliSense.traceLocalSet = -- TODO: need translate! -'Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.' -config.IntelliSense.traceReturn = -- TODO: need translate! -'Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.' -config.IntelliSense.traceBeSetted = -- TODO: need translate! -'Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.' -config.IntelliSense.traceFieldInject = -- TODO: need translate! -'Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.' config.type.castNumberToInteger = -- TODO: need translate! 'Allowed to assign the `number` type to the `integer` type.' config.type.weakUnionCheck = -- TODO: need translate! @@ -379,6 +373,8 @@ config.diagnostics['invisible'] = -- TODO: need translate! 'Enable diagnostics for accesses to fields which are invisible.' config.diagnostics['missing-global-doc'] = -- TODO: need translate! 'Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.' +config.diagnostics['missing-local-export-doc'] = -- TODO: need translate! +'Missing annotations for exported locals! Exported local functions must have a comment and annotations for all parameters and return values.' config.diagnostics['missing-parameter'] = -- TODO: need translate! 'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.' config.diagnostics['missing-return'] = -- TODO: need translate! @@ -401,6 +397,8 @@ config.diagnostics['return-type-mismatch'] = -- TODO: need translate! 'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.' config.diagnostics['spell-check'] = -- TODO: need translate! 'Enable diagnostics for typos in strings.' +config.diagnostics['name-style-check'] = -- TODO: need translate! +'Enable diagnostics for name style.' config.diagnostics['unbalanced-assignments']= -- TODO: need translate! 'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).' config.diagnostics['undefined-doc-class'] = -- TODO: need translate! @@ -434,3 +432,5 @@ command.exportDocument = -- TODO: need translate! 'Lua: Export Document ...' command.addon_manager.open = -- TODO: need translate! 'Lua: Open Addon Manager ...' +command.reloadFFIMeta = -- TODO: need translate! +'Lua: Reload luajit ffi meta' diff --git a/locale/zh-cn/meta.lua b/locale/zh-cn/meta.lua index c4b5fbb6..64d04ae5 100644 --- a/locale/zh-cn/meta.lua +++ b/locale/zh-cn/meta.lua @@ -497,11 +497,11 @@ math.log10 = '返回 `x` 的以10为底的对数。' math.max = '返回参数中最大的值, 大小由 Lua 操作 `<` 决定。' -math.maxinteger = +math.maxinteger['>5.3'] = '最大值的整数。' math.min = '返回参数中最小的值, 大小由 Lua 操作 `<` 决定。' -math.mininteger = +math.mininteger['>5.3'] = '最小值的整数。' math.modf = '返回 `x` 的整数部分和小数部分。' @@ -535,11 +535,11 @@ math.tan = '返回 `x` 的正切值(假定参数是弧度)。' math.tanh = '返回 `x` 的双曲正切值(假定参数是弧度)。' -math.tointeger = +math.tointeger['>5.3'] = '如果 `x` 可以转换为一个整数, 返回该整数。' -math.type = +math.type['>5.3'] = '如果 `x` 是整数,返回 `"integer"`, 如果它是浮点数,返回 `"float"`, 如果 `x` 不是数字,返回 `nil`。' -math.ult = +math.ult['>5.3'] = '如果整数 `m` 和 `n` 以无符号整数形式比较, `m` 在 `n` 之下,返回布尔真否则返回假。' os = diff --git a/locale/zh-cn/script.lua b/locale/zh-cn/script.lua index c100e2d6..6459a104 100644 --- a/locale/zh-cn/script.lua +++ b/locale/zh-cn/script.lua @@ -114,16 +114,22 @@ DIAG_UNDEFINED_DOC_NAME = '未定义的类型或别名 `{}`。' DIAG_UNDEFINED_DOC_PARAM = '指向了未定义的参数 `{}`。' -DIAG_MISSING_GLOBAL_DOC_COMMENT = -- TODO: need translate! -'Missing comment for global function `{}`.' -DIAG_MISSING_GLOBAL_DOC_PARAM = -- TODO: need translate! -'Missing @param annotation for parameter `{}` in global function `{}`.' -DIAG_MISSING_GLOBAL_DOC_RETURN = -- TODO: need translate! -'Missing @return annotation at index `{}` in global function `{}`.' -DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM = -- TODO: need translate! -'Incomplete signature. Missing @param annotation for parameter `{}` in function `{}`.' -DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN = -- TODO: need translate! -'Incomplete signature. Missing @return annotation at index `{}` in function `{}`.' +DIAG_MISSING_GLOBAL_DOC_COMMENT = +'全局函数 `{}` 缺少注释。' +DIAG_MISSING_GLOBAL_DOC_PARAM = +'全局函数 `{2}` 的参数 `{1}` 缺少 @param 注解。' +DIAG_MISSING_GLOBAL_DOC_RETURN = +'全局函数 `{2}` 的第 `{1}` 个返回值缺少 @return 注解。' +DIAG_MISSING_LOCAL_EXPORT_DOC_COMMENT = +'导出的局部函数 `{}` 缺少注释。' +DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM = +'导出的局部函数 `{2}` 的参数 `{1}` 缺少 @param 注解。' +DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN = +'导出的局部函数 `{2}` 的第 {1} 个返回值缺少 @return 注解。' +DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM = +'签名不完整。参数 `{1}` 缺少 @param 注解。' +DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN = +'签名不完整。第 {1} 个返回值缺少 @return 注解。' DIAG_UNKNOWN_DIAG_CODE = '未知的诊断代号 `{}`。' DIAG_CAST_LOCAL_TYPE = @@ -160,8 +166,16 @@ DIAG_INVISIBLE_PROTECTED = '字段 `{field}` 受到保护,只能在 `{class}` 类极其子类中才能访问。' DIAG_INVISIBLE_PACKAGE = '字段 `{field}` 只能在相同的文件 `{uri}` 中才能访问。' -DIAG_GLOBAL_ELEMENT = -- TODO: need translate! -'Element is global.' +DIAG_GLOBAL_ELEMENT = +'全局变量。' +DIAG_MISSING_FIELDS = +'缺少类型 `{1}` 的必要字段: {2}' +DIAG_INJECT_FIELD = +'不能在 `{class}` 的引用中注入字段 `{field}` 。{fix}' +DIAG_INJECT_FIELD_FIX_CLASS = +'如要允许注入,请对 `{node}` 使用 `{fix}` 。' +DIAG_INJECT_FIELD_FIX_TABLE = +'如要允许注入,请在定义中添加 `{fix}` 。' MWS_NOT_SUPPORT = '{} 目前还不支持多工作目录,我可能需要重启才能支持新的工作目录...' @@ -189,9 +203,9 @@ WORKSPACE_DIAGNOSTIC = WORKSPACE_SKIP_HUGE_FILE = '出于性能考虑,已停止对此文件解析:{}' WORKSPACE_NOT_ALLOWED = -'你的工作目录被设置为了 `{}`,Lua语言服务拒绝加载此目录,请检查你的配置。[了解更多](https://github.com/LuaLS/lua-language-server/wiki/FAQ#why-is-the-server-scanning-the-wrong-folder)' -WORKSPACE_SCAN_TOO_MUCH = -- TODO: need translate! -'已扫描了超过 {} 个文件,当前扫描的目录为 `{}`. Please see the [FAQ](https://github.com/LuaLS/lua-language-server/wiki/FAQ#how-can-i-improve-startup-speeds) to see how you can include fewer files. It is also possible that your [configuration is incorrect](https://github.com/LuaLS/lua-language-server/wiki/FAQ#why-is-the-server-scanning-the-wrong-folder).' +'你的工作目录被设置为了 `{}`,Lua语言服务拒绝加载此目录,请检查你的配置。[了解更多](https://luals.github.io/wiki/faq#why-is-the-server-scanning-the-wrong-folder)' +WORKSPACE_SCAN_TOO_MUCH = +'已扫描了超过 {} 个文件,当前扫描的目录为 `{}`. 请参阅 [FAQ](https://luals.github.io/wiki/faq#how-can-i-improve-startup-speeds) 了解如何排除多余的文件。也可能是你的 [设置有错误](https://luals.github.io/wiki/faq#why-is-the-server-scanning-the-wrong-folder).' PARSER_CRASH = '语法解析崩溃了!遗言:{}' @@ -442,6 +456,8 @@ ACTION_ADD_DICT = '将 \'{}\' 添加到工作区的词典中。' ACTION_FIX_ADD_PAREN = '添加括号。' +ACTION_AUTOREQUIRE = +"导入 '{}' 作为 `{}`" COMMAND_DISABLE_DIAG = '禁用诊断' @@ -461,8 +477,8 @@ COMMAND_JSON_TO_LUA = 'JSON 转 Lua' COMMAND_JSON_TO_LUA_FAILED = 'JSON 转 Lua 失败:{}' -COMMAND_ADD_DICT = -- TODO: need translate! -'Add Word to dictionary' +COMMAND_ADD_DICT = +'将单词添加到字典' COMMAND_REFERENCE_COUNT = '{} 个引用' @@ -542,7 +558,7 @@ WINDOW_APPLY_SETTING = WINDOW_CHECK_SEMANTIC = '如果你正在使用市场中的颜色主题,你可能需要同时修改 `editor.semanticHighlighting.enabled` 选项为 `true` 才会使语义着色生效。' WINDOW_TELEMETRY_HINT = -'请允许发送匿名的使用数据与错误报告,帮助我们进一步完善此插件。在[此处](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy)阅读我们的隐私声明。' +'请允许发送匿名的使用数据与错误报告,帮助我们进一步完善此插件。在[此处](https://luals.github.io/privacy/#language-server)阅读我们的隐私声明。' WINDOW_TELEMETRY_ENABLE = '允许' WINDOW_TELEMETRY_DISABLE = @@ -687,7 +703,7 @@ Defines a class/table structure Manager = {} ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#class) +[View Wiki](https://luals.github.io/wiki/annotations#class) ]=] LUADOC_DESC_TYPE = -- TODO: need translate! [=[ @@ -738,7 +754,7 @@ local x --x[""] is true local myFunction ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#types-and-type) +[View Wiki](https://luals.github.io/wiki/annotations#type) ]=] LUADOC_DESC_ALIAS = -- TODO: need translate! [=[ @@ -788,7 +804,7 @@ local enums = { ---| `enums.CLOSE` ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#alias) +[View Wiki](https://luals.github.io/wiki/annotations#alias) ]=] LUADOC_DESC_PARAM = -- TODO: need translate! [=[ @@ -813,7 +829,7 @@ function get(url, headers, timeout) end function concat(base, ...) end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#param) +[View Wiki](https://luals.github.io/wiki/annotations#param) ]=] LUADOC_DESC_RETURN = -- TODO: need translate! [=[ @@ -851,7 +867,7 @@ function getFirstLast() end function getTags(item) end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#return) +[View Wiki](https://luals.github.io/wiki/annotations#return) ]=] LUADOC_DESC_FIELD = -- TODO: need translate! [=[ @@ -882,7 +898,7 @@ response = get("localhost") statusCode = response.status.code ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#field) +[View Wiki](https://luals.github.io/wiki/annotations#field) ]=] LUADOC_DESC_GENERIC = -- TODO: need translate! [=[ @@ -939,7 +955,7 @@ local v = Generic("Foo") -- v is an object of Foo -- we give for key (K) or value (V) ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#generics-and-generic) +[View Wiki](https://luals.github.io/wiki/annotations/#generic) ]=] LUADOC_DESC_VARARG = -- TODO: need translate! [=[ @@ -958,7 +974,7 @@ provide typing or allow descriptions. function concat(...) end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#vararg) +[View Wiki](https://luals.github.io/wiki/annotations#vararg) ]=] LUADOC_DESC_OVERLOAD = -- TODO: need translate! [=[ @@ -973,7 +989,7 @@ Allows defining of multiple function signatures. function table.insert(t, position, value) end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#overload) +[View Wiki](https://luals.github.io/wiki/annotations#overload) ]=] LUADOC_DESC_DEPRECATED = -- TODO: need translate! [=[ @@ -984,7 +1000,7 @@ being ~~struck through~~. `---@deprecated` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#deprecated) +[View Wiki](https://luals.github.io/wiki/annotations#deprecated) ]=] LUADOC_DESC_META = -- TODO: need translate! [=[ @@ -999,7 +1015,7 @@ There are 3 main distinctions to note with meta files: `---@meta` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#meta) +[View Wiki](https://luals.github.io/wiki/annotations#meta) ]=] LUADOC_DESC_VERSION = -- TODO: need translate! [=[ @@ -1024,7 +1040,7 @@ function onlyWorksInJIT() end function oldLuaOnly() end ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#version) +[View Wiki](https://luals.github.io/wiki/annotations#version) ]=] LUADOC_DESC_SEE = -- TODO: need translate! [=[ @@ -1034,7 +1050,7 @@ Define something that can be viewed for more information `---@see <text>` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#see) +[View Wiki](https://luals.github.io/wiki/annotations#see) ]=] LUADOC_DESC_DIAGNOSTIC = -- TODO: need translate! [=[ @@ -1060,7 +1076,7 @@ local unused = "hello world" ---@diagnostic enable: unused-local ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#diagnostic) +[View Wiki](https://luals.github.io/wiki/annotations#diagnostic) ]=] LUADOC_DESC_MODULE = -- TODO: need translate! [=[ @@ -1077,7 +1093,7 @@ local stringUtils local module = require('string.utils') ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#module) +[View Wiki](https://luals.github.io/wiki/annotations#module) ]=] LUADOC_DESC_ASYNC = -- TODO: need translate! [=[ @@ -1087,7 +1103,7 @@ Marks a function as asynchronous. `---@async` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#async) +[View Wiki](https://luals.github.io/wiki/annotations#async) ]=] LUADOC_DESC_NODISCARD = -- TODO: need translate! [=[ @@ -1099,7 +1115,7 @@ be ignored. `---@nodiscard` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#nodiscard) +[View Wiki](https://luals.github.io/wiki/annotations#nodiscard) ]=] LUADOC_DESC_CAST = -- TODO: need translate! [=[ @@ -1134,7 +1150,7 @@ local x --> string|table print(x) --> table ``` --- -[View Wiki](https://github.com/LuaLS/lua-language-server/wiki/Annotations#cast) +[View Wiki](https://luals.github.io/wiki/annotations#cast) ]=] LUADOC_DESC_OPERATOR = -- TODO: need translate! [=[ @@ -1169,7 +1185,7 @@ pB = -pA LUADOC_DESC_ENUM = -- TODO: need translate! [=[ Mark a table as an enum. If you want an enum but can't define it as a Lua -table, take a look at the [`@alias`](https://github.com/LuaLS/lua-language-server/wiki/Annotations#alias) +table, take a look at the [`@alias`](https://luals.github.io/wiki/annotations#alias) tag. ## Syntax @@ -1193,6 +1209,33 @@ local function setColor(color) end setColor(colors.green) ``` ]=] +LUADOC_DESC_SOURCE = -- TODO: need translate! +[=[ +Provide a reference to some source code which lives in another file. When +searching for the defintion of an item, its `@source` will be used. + +## Syntax +`@source <path>` + +## Usage +``` +---You can use absolute paths +---@source C:/Users/me/Documents/program/myFile.c +local a + +---Or URIs +---@source file:///C:/Users/me/Documents/program/myFile.c:10 +local b + +---Or relative paths +---@source local/file.c +local c + +---You can also include line and char numbers +---@source local/file.c:10:8 +local d +``` +]=] LUADOC_DESC_PACKAGE = -- TODO: need translate! [=[ Mark a function as private to the file it is defined in. A packaged function diff --git a/locale/zh-cn/setting.lua b/locale/zh-cn/setting.lua index 9dbd961d..c4ec1b55 100644 --- a/locale/zh-cn/setting.lua +++ b/locale/zh-cn/setting.lua @@ -1,7 +1,7 @@ ---@diagnostic disable: undefined-global -config.addonManager.enable = -- TODO: need translate! -"Whether the addon manager is enabled or not." +config.addonManager.enable = +"是否启用扩展的附加插件管理器(Addon Manager)" config.runtime.version = "Lua运行版本。" config.runtime.path = @@ -27,7 +27,7 @@ config.runtime.unicodeName = config.runtime.nonstandardSymbol = "支持非标准的符号。请务必确认你的运行环境支持这些符号。" config.runtime.plugin = -"插件路径,请查阅[文档](https://github.com/LuaLS/lua-language-server/wiki/Plugins)了解用法。" +"插件路径,请查阅[文档](https://luals.github.io/wiki/plugins)了解用法。" config.runtime.pluginArgs = -- TODO: need translate! "Additional arguments for the plugin." config.runtime.fileEncoding = @@ -257,7 +257,7 @@ config.hint.semicolon.SameLine = '2个语句在同一行时,在它们之间显示分号。' config.hint.semicolon.Disable = '禁用虚拟分号。' -config.codeLens.enable = -- TODO: need translate! +config.codeLens.enable = '启用代码度量。' config.format.enable = '启用代码格式化程序。' @@ -268,22 +268,16 @@ config.format.defaultConfig = ]] config.spell.dict = '拼写检查的自定义单词。' +config.nameStyle.config = +'设定命名风格检查的配置' config.telemetry.enable = [[ -启用遥测,通过网络发送你的编辑器信息与错误日志。在[此处](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy)阅读我们的隐私声明。 +启用遥测,通过网络发送你的编辑器信息与错误日志。在[此处](https://luals.github.io/privacy/#language-server)阅读我们的隐私声明。 ]] config.misc.parameters = -'VSCode中启动语言服务时的[命令行参数](https://github.com/LuaLS/lua-language-server/wiki/Getting-Started#arguments)。' +'VSCode中启动语言服务时的[命令行参数](https://luals.github.io/wiki/usage#arguments)。' config.misc.executablePath = 'VSCode中指定可执行文件路径。' -config.IntelliSense.traceLocalSet = -'请查阅[文档](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features)了解用法。' -config.IntelliSense.traceReturn = -'请查阅[文档](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features)了解用法。' -config.IntelliSense.traceBeSetted = -'请查阅[文档](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features)了解用法。' -config.IntelliSense.traceFieldInject = -'请查阅[文档](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features)了解用法。' config.type.castNumberToInteger = '允许将 `number` 类型赋给 `integer` 类型。' config.type.weakUnionCheck = @@ -338,98 +332,104 @@ config.diagnostics['empty-block'] = '空代码块' config.diagnostics['redundant-value'] = '赋值操作时,值的数量比被赋值的对象多' -config.diagnostics['assign-type-mismatch'] = -- TODO: need translate! -'Enable diagnostics for assignments in which the value\'s type does not match the type of the assigned variable.' -config.diagnostics['await-in-sync'] = -- TODO: need translate! -'Enable diagnostics for calls of asynchronous functions within a synchronous function.' -config.diagnostics['cast-local-type'] = -- TODO: need translate! -'Enable diagnostics for casts of local variables where the target type does not match the defined type.' -config.diagnostics['cast-type-mismatch'] = -- TODO: need translate! -'Enable diagnostics for casts where the target type does not match the initial type.' -config.diagnostics['circular-doc-class'] = -- TODO: need translate! -'Enable diagnostics for two classes inheriting from each other introducing a circular relation.' +config.diagnostics['assign-type-mismatch'] = +'值类型与赋值变量类型不匹配' +config.diagnostics['await-in-sync'] = +'同步函数中异步函数调用' +config.diagnostics['cast-local-type'] = +'已显式定义变量类型与要定义的值的类型不匹配' +config.diagnostics['cast-type-mismatch'] = +'变量被转换为与其初始类型不匹配的类型' +config.diagnostics['circular-doc-class'] = +'两个类相互继承并互相循环' config.diagnostics['close-non-object'] = -- TODO: need translate! 'Enable diagnostics for attempts to close a variable with a non-object.' -config.diagnostics['code-after-break'] = -- TODO: need translate! -'Enable diagnostics for code placed after a break statement in a loop.' +config.diagnostics['code-after-break'] = +'放在循环中break语句后面的代码' config.diagnostics['codestyle-check'] = -- TODO: need translate! 'Enable diagnostics for incorrectly styled lines.' -config.diagnostics['count-down-loop'] = -- TODO: need translate! -'Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing.' -config.diagnostics['deprecated'] = -- TODO: need translate! -'Enable diagnostics to highlight deprecated API.' -config.diagnostics['different-requires'] = -- TODO: need translate! -'Enable diagnostics for files which are required by two different paths.' -config.diagnostics['discard-returns'] = -- TODO: need translate! -'Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored.' -config.diagnostics['doc-field-no-class'] = -- TODO: need translate! -'Enable diagnostics to highlight a field annotation without a defining class annotation.' -config.diagnostics['duplicate-doc-alias'] = -- TODO: need translate! -'Enable diagnostics for a duplicated alias annotation name.' -config.diagnostics['duplicate-doc-field'] = -- TODO: need translate! -'Enable diagnostics for a duplicated field annotation name.' -config.diagnostics['duplicate-doc-param'] = -- TODO: need translate! -'Enable diagnostics for a duplicated param annotation name.' -config.diagnostics['duplicate-set-field'] = -- TODO: need translate! -'Enable diagnostics for setting the same field in a class more than once.' -config.diagnostics['incomplete-signature-doc'] = -- TODO: need translate! -'Incomplete @param or @return annotations for functions.' -config.diagnostics['invisible'] = -- TODO: need translate! -'Enable diagnostics for accesses to fields which are invisible.' -config.diagnostics['missing-global-doc'] = -- TODO: need translate! -'Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.' -config.diagnostics['missing-parameter'] = -- TODO: need translate! -'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.' -config.diagnostics['missing-return'] = -- TODO: need translate! -'Enable diagnostics for functions with return annotations which have no return statement.' -config.diagnostics['missing-return-value'] = -- TODO: need translate! -'Enable diagnostics for return statements without values although the containing function declares returns.' -config.diagnostics['need-check-nil'] = -- TODO: need translate! -'Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before.' -config.diagnostics['no-unknown'] = -- TODO: need translate! -'Enable diagnostics for cases in which the type cannot be inferred.' -config.diagnostics['not-yieldable'] = -- TODO: need translate! -'Enable diagnostics for calls to `coroutine.yield()` when it is not permitted.' -config.diagnostics['param-type-mismatch'] = -- TODO: need translate! -'Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition.' -config.diagnostics['redundant-return'] = -- TODO: need translate! -'Enable diagnostics for return statements which are not needed because the function would exit on its own.' -config.diagnostics['redundant-return-value']= -- TODO: need translate! -'Enable diagnostics for return statements which return an extra value which is not specified by a return annotation.' -config.diagnostics['return-type-mismatch'] = -- TODO: need translate! -'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.' +config.diagnostics['count-down-loop'] = +'for循环永远无法达到最大/极限值(在递减时递增)' +config.diagnostics['deprecated'] = +'变量已被标记为deprecated(过时)但仍在使用' +config.diagnostics['different-requires'] = +'required的同一个文件使用了两个不同的名字' +config.diagnostics['discard-returns'] = +'函数的返回值被忽略(函数被`@nodiscard`标记时)' +config.diagnostics['doc-field-no-class'] = +'为不存在的类`@class`标记`@field`字段' +config.diagnostics['duplicate-doc-alias'] = +'`@alias`字段的名字冲突' +config.diagnostics['duplicate-doc-field'] = +'`@field`字段的名字冲突' +config.diagnostics['duplicate-doc-param'] = +'`@param`字段的名字冲突' +config.diagnostics['duplicate-set-field'] = +'在一个类中多次定义同一字段' +config.diagnostics['incomplete-signature-doc'] = +'`@param`或`@return`的注释不完整' +config.diagnostics['invisible'] = +'使用不可见的值' +config.diagnostics['missing-global-doc'] = +'全局变量的注释缺失(全局函数必须为所有参数和返回值提供注释和注释)' +config.diagnostics['missing-local-export-doc'] = +'导出的本地函数缺少注释(导出的本地函数必须有包括本身以及所有参数和返回值的注释)' +config.diagnostics['missing-parameter'] = +'函数参数数少于注释函数参数数' +config.diagnostics['missing-return'] = +'函数带有返回注释而无返回语句' +config.diagnostics['missing-return-value'] = +'函数无值返回但函数使用`@return`标记了返回值' +config.diagnostics['need-check-nil'] = +'变量之前被赋值为`nil`或可选值(可能为 `nil`)' +config.diagnostics['no-unknown'] = +'变量的未知类型无法推断' +config.diagnostics['not-yieldable'] = +'不允许调用 `coroutine.yield()` ' +config.diagnostics['param-type-mismatch'] = +'给定参数的类型与函数定义所要求的类型(`@param`)不匹配' +config.diagnostics['redundant-return'] = +'当放置一个不需要的返回值时触发(函数会自行退出)' +config.diagnostics['redundant-return-value']= +'返回`@return`注释未指定的额外值' +config.diagnostics['return-type-mismatch'] = +'返回值的类型与`@return`中声明的类型不匹配' config.diagnostics['spell-check'] = -- TODO: need translate! 'Enable diagnostics for typos in strings.' -config.diagnostics['unbalanced-assignments']= -- TODO: need translate! -'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).' -config.diagnostics['undefined-doc-class'] = -- TODO: need translate! -'Enable diagnostics for class annotations in which an undefined class is referenced.' -config.diagnostics['undefined-doc-name'] = -- TODO: need translate! -'Enable diagnostics for type annotations referencing an undefined type or alias.' -config.diagnostics['undefined-doc-param'] = -- TODO: need translate! -'Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition.' -config.diagnostics['undefined-field'] = -- TODO: need translate! -'Enable diagnostics for cases in which an undefined field of a variable is read.' -config.diagnostics['unknown-cast-variable'] = -- TODO: need translate! -'Enable diagnostics for casts of undefined variables.' -config.diagnostics['unknown-diag-code'] = -- TODO: need translate! -'Enable diagnostics in cases in which an unknown diagnostics code is entered.' -config.diagnostics['unknown-operator'] = -- TODO: need translate! -'Enable diagnostics for unknown operators.' -config.diagnostics['unreachable-code'] = -- TODO: need translate! -'Enable diagnostics for unreachable code.' +config.diagnostics['name-style-check'] = -- TODO: need translate! +'变量的名称样式检查' +config.diagnostics['unbalanced-assignments']= +'多重赋值时没有赋值所有变量(如`local x,y = 1`)' +config.diagnostics['undefined-doc-class'] = +'在`@class`注解中引用未定义的类。' +config.diagnostics['undefined-doc-name'] = +'在`@type`注解中引用未定义的类型或`@alias`' +config.diagnostics['undefined-doc-param'] = +'函数声明中`@param`引用了未定义的参数' +config.diagnostics['undefined-field'] = +'引用变量的未定义字段' +config.diagnostics['unknown-cast-variable'] = +'使用`@cast`对未定义变量的强制转换' +config.diagnostics['unknown-diag-code'] = +'未知的诊断代码' +config.diagnostics['unknown-operator'] = +'未知的运算符' +config.diagnostics['unreachable-code'] = +'不可达的代码' config.diagnostics['global-element'] = -- TODO: need translate! 'Enable diagnostics to warn about global elements.' -config.typeFormat.config = -- TODO: need translate! -'Configures the formatting behavior while typing Lua code.' -config.typeFormat.config.auto_complete_end = -- TODO: need translate! -'Controls if `end` is automatically completed at suitable positions.' -config.typeFormat.config.auto_complete_table_sep = -- TODO: need translate! -'Controls if a separator is automatically appended at the end of a table declaration.' -config.typeFormat.config.format_line = -- TODO: need translate! -'Controls if a line is formatted at all.' +config.typeFormat.config = +'配置输入Lua代码时的格式化行为' +config.typeFormat.config.auto_complete_end = +'是否在合适的位置自动完成 `end`' +config.typeFormat.config.auto_complete_table_sep = +'是否在table末尾自动添加分隔符' +config.typeFormat.config.format_line = +'是否对某一行进行格式化' command.exportDocument = 'Lua: 导出文档...' command.addon_manager.open = 'Lua: 打开插件管理器...' +command.reloadFFIMeta = +'Lua: 重新生成luajit的FFI模块C语言元数据' diff --git a/locale/zh-tw/meta.lua b/locale/zh-tw/meta.lua index 23af021a..8aa5656d 100644 --- a/locale/zh-tw/meta.lua +++ b/locale/zh-tw/meta.lua @@ -498,11 +498,11 @@ math.log10 = '回傳 `x` 的以10為底的對數。' math.max = '回傳引數中最大的值,大小由 Lua 運算子 `<` 決定。' -math.maxinteger = +math.maxinteger['>5.3'] = '最大值的整數。' math.min = '回傳引數中最小的值,大小由 Lua 運算子 `<` 決定。' -math.mininteger = +math.mininteger['>5.3'] = '最小值的整數。' math.modf = '回傳 `x` 的整數部分和小數部分。' @@ -536,11 +536,11 @@ math.tan = '回傳 `x` 的正切值(假定引數是弧度)。' math.tanh = '回傳 `x` 的雙曲正切值(假定引數是弧度)。' -math.tointeger = +math.tointeger['>5.3'] = '如果 `x` 可以轉換為一個整數,回傳該整數。' -math.type = +math.type['>5.3'] = '如果 `x` 是整數,回傳 `"integer"` ,如果它是浮點數,回傳 `"float"` ,如果 `x` 不是數字,回傳 `nil` 。' -math.ult = +math.ult['>5.3'] = '整數 `m` 和 `n` 以無符號整數形式比較,如果 `m` 在 `n` 之下則回傳布林真,否則回傳假。' os = diff --git a/locale/zh-tw/script.lua b/locale/zh-tw/script.lua index 3a618184..43c064b2 100644 --- a/locale/zh-tw/script.lua +++ b/locale/zh-tw/script.lua @@ -120,10 +120,16 @@ DIAG_MISSING_GLOBAL_DOC_PARAM = -- TODO: need translate! 'Missing @param annotation for parameter `{}` in global function `{}`.' DIAG_MISSING_GLOBAL_DOC_RETURN = -- TODO: need translate! 'Missing @return annotation at index `{}` in global function `{}`.' +DIAG_MISSING_LOCAL_EXPORT_DOC_COMMENT = -- TODO: need translate! +'Missing comment for exported local function `{}`.' +DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM = -- TODO: need translate! +'Missing @param annotation for parameter `{}` in exported local function `{}`.' +DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN = -- TODO: need translate! +'Missing @return annotation at index `{}` in exported local function `{}`.' DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM = -- TODO: need translate! -'Incomplete signature. Missing @param annotation for parameter `{}` in function `{}`.' +'Incomplete signature. Missing @param annotation for parameter `{}`.' DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN = -- TODO: need translate! -'Incomplete signature. Missing @return annotation at index `{}` in function `{}`.' +'Incomplete signature. Missing @return annotation at index `{}`.' DIAG_UNKNOWN_DIAG_CODE = '未知的診斷代碼 `{}`。' DIAG_CAST_LOCAL_TYPE = @@ -162,6 +168,14 @@ DIAG_INVISIBLE_PACKAGE = -- TODO: need translate! 'Field `{field}` can only be accessed in same file `{uri}`.' DIAG_GLOBAL_ELEMENT = -- TODO: need translate! 'Element is global.' +DIAG_MISSING_FIELDS = -- TODO: need translate! +'Missing required fields in type `{1}`: {2}' +DIAG_INJECT_FIELD = -- TODO: need translate! +'Fields cannot be injected into the reference of `{class}` for `{field}`. {fix}' +DIAG_INJECT_FIELD_FIX_CLASS = -- TODO: need translate! +'To do so, use `---@class` for `{node}`.' +DIAG_INJECT_FIELD_FIX_TABLE = -- TODO: need translate! +'如要允许注入,请在定义中添加 `{fix}` 。' MWS_NOT_SUPPORT = '{} 目前還不支援多工作目錄,我可能需要重新啟動才能支援新的工作目錄...' @@ -189,9 +203,9 @@ WORKSPACE_DIAGNOSTIC = WORKSPACE_SKIP_HUGE_FILE = '出於效能考慮,已停止對此檔案解析:{}' WORKSPACE_NOT_ALLOWED = -'你的工作目錄被設定為了 `{}` ,Lua語言伺服拒絕載入此目錄,請檢查你的設定檔。[了解更多](https://github.com/LuaLS/lua-language-server/wiki/FAQ#why-is-the-server-scanning-the-wrong-folder)' +'你的工作目錄被設定為了 `{}` ,Lua語言伺服拒絕載入此目錄,請檢查你的設定檔。[了解更多](https://luals.github.io/wiki/faq#why-is-the-server-scanning-the-wrong-folder)' WORKSPACE_SCAN_TOO_MUCH = -- TODO: need translate! -'已掃描了超過 {} 個檔案,目前掃描的目錄為 `{}`. Please see the [FAQ](https://github.com/LuaLS/lua-language-server/wiki/FAQ#how-can-i-improve-startup-speeds) to see how you can include fewer files. It is also possible that your [configuration is incorrect](https://github.com/LuaLS/lua-language-server/wiki/FAQ#why-is-the-server-scanning-the-wrong-folder).' +'已掃描了超過 {} 個檔案,目前掃描的目錄為 `{}`. Please see the [FAQ](https://luals.github.io/wiki/faq#how-can-i-improve-startup-speeds) to see how you can include fewer files. It is also possible that your [configuration is incorrect](https://luals.github.io/wiki/faq#why-is-the-server-scanning-the-wrong-folder).' PARSER_CRASH = '語法解析崩潰了!遺言:{}' @@ -442,6 +456,8 @@ ACTION_ADD_DICT = '添加 \'{}\' 到工作區字典' ACTION_FIX_ADD_PAREN = -- TODO: need translate! '添加括号。' +ACTION_AUTOREQUIRE = -- TODO: need translate! +"Import '{}' as {}" COMMAND_DISABLE_DIAG = '停用診斷' @@ -542,7 +558,7 @@ WINDOW_APPLY_SETTING = WINDOW_CHECK_SEMANTIC = '如果你正在使用市場中的顏色主題,你可能需要同時修改 `editor.semanticHighlighting.enabled` 選項為 `true` 才會使語義著色生效。' WINDOW_TELEMETRY_HINT = -'請允許發送匿名的使用資料與錯誤報告,幫助我們進一步完善此延伸模組。在[此處](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy)閱讀我們的隱私聲明。' +'請允許發送匿名的使用資料與錯誤報告,幫助我們進一步完善此延伸模組。在[此處](https://luals.github.io/privacy/#language-server)閱讀我們的隱私聲明。' WINDOW_TELEMETRY_ENABLE = '允許' WINDOW_TELEMETRY_DISABLE = @@ -687,7 +703,7 @@ LUADOC_DESC_CLASS = Manager = {} ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#class) +[檢視文件](https://luals.github.io/wiki/annotations#class) ]=] LUADOC_DESC_TYPE = [=[ @@ -738,7 +754,7 @@ local x --x[""] is true local myFunction ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#types-and-type) +[檢視文件](https://luals.github.io/wiki/annotations#type) ]=] LUADOC_DESC_ALIAS = [=[ @@ -788,7 +804,7 @@ local enums = { ---| `enums.CLOSE` ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#alias) +[檢視文件](https://luals.github.io/wiki/annotations#alias) ]=] LUADOC_DESC_PARAM = [=[ @@ -813,7 +829,7 @@ function get(url, headers, timeout) end function concat(base, ...) end ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#param) +[檢視文件](https://luals.github.io/wiki/annotations#param) ]=] LUADOC_DESC_RETURN = [=[ @@ -851,7 +867,7 @@ function getFirstLast() end function getTags(item) end ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#return) +[檢視文件](https://luals.github.io/wiki/annotations#return) ]=] LUADOC_DESC_FIELD = [=[ @@ -880,7 +896,7 @@ response = get("localhost") statusCode = response.status.code ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#field) +[檢視文件](https://luals.github.io/wiki/annotations#field) ]=] LUADOC_DESC_GENERIC = [=[ @@ -936,7 +952,7 @@ local v = Generic("Foo") -- v is an object of Foo -- we give for key (K) or value (V) ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#generics-and-generic) +[檢視文件](https://luals.github.io/wiki/annotations#generic) ]=] LUADOC_DESC_VARARG = [=[ @@ -954,7 +970,7 @@ LUADOC_DESC_VARARG = function concat(...) end ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#vararg) +[檢視文件](https://luals.github.io/wiki/annotations#vararg) ]=] LUADOC_DESC_OVERLOAD = [=[ @@ -969,7 +985,7 @@ LUADOC_DESC_OVERLOAD = function table.insert(t, position, value) end ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#overload) +[檢視文件](https://luals.github.io/wiki/annotations#overload) ]=] LUADOC_DESC_DEPRECATED = [=[ @@ -979,7 +995,7 @@ LUADOC_DESC_DEPRECATED = `---@deprecated` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#deprecated) +[檢視文件](https://luals.github.io/wiki/annotations#deprecated) ]=] LUADOC_DESC_META = [=[ @@ -994,7 +1010,7 @@ LUADOC_DESC_META = `---@meta` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#meta) +[檢視文件](https://luals.github.io/wiki/annotations#meta) ]=] LUADOC_DESC_VERSION = [=[ @@ -1019,7 +1035,7 @@ function onlyWorksInJIT() end function oldLuaOnly() end ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#version) +[檢視文件](https://luals.github.io/wiki/annotations#version) ]=] LUADOC_DESC_SEE = [=[ @@ -1029,7 +1045,7 @@ LUADOC_DESC_SEE = `---@see <text>` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#see) +[檢視文件](https://luals.github.io/wiki/annotations#see) ]=] LUADOC_DESC_DIAGNOSTIC = [=[ @@ -1055,7 +1071,7 @@ local unused = "hello world" ---@diagnostic enable: unused-local ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#diagnostic) +[檢視文件](https://luals.github.io/wiki/annotations#diagnostic) ]=] LUADOC_DESC_MODULE = [=[ @@ -1072,7 +1088,7 @@ local stringUtils local module = require('string.utils') ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#module) +[檢視文件](https://luals.github.io/wiki/annotations#module) ]=] LUADOC_DESC_ASYNC = [=[ @@ -1082,7 +1098,7 @@ LUADOC_DESC_ASYNC = `---@async` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#async) +[檢視文件](https://luals.github.io/wiki/annotations#async) ]=] LUADOC_DESC_NODISCARD = [=[ @@ -1093,7 +1109,7 @@ LUADOC_DESC_NODISCARD = `---@nodiscard` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#nodiscard) +[檢視文件](https://luals.github.io/wiki/annotations#nodiscard) ]=] LUADOC_DESC_CAST = [=[ @@ -1128,7 +1144,7 @@ local x --> string|table print(x) --> table ``` --- -[檢視文件](https://github.com/LuaLS/lua-language-server/wiki/Annotations#cast) +[檢視文件](https://luals.github.io/wiki/annotations#cast) ]=] LUADOC_DESC_OPERATOR = -- TODO: need translate! [=[ @@ -1163,7 +1179,7 @@ pB = -pA LUADOC_DESC_ENUM = -- TODO: need translate! [=[ Mark a table as an enum. If you want an enum but can't define it as a Lua -table, take a look at the [`@alias`](https://github.com/LuaLS/lua-language-server/wiki/Annotations#alias) +table, take a look at the [`@alias`](https://luals.github.io/wiki/annotations#alias) tag. ## Syntax @@ -1187,6 +1203,33 @@ local function setColor(color) end setColor(colors.green) ``` ]=] +LUADOC_DESC_SOURCE = -- TODO: need translate! +[=[ +Provide a reference to some source code which lives in another file. When +searching for the defintion of an item, its `@source` will be used. + +## Syntax +`@source <path>` + +## Usage +``` +---You can use absolute paths +---@source C:/Users/me/Documents/program/myFile.c +local a + +---Or URIs +---@source file:///C:/Users/me/Documents/program/myFile.c:10 +local b + +---Or relative paths +---@source local/file.c +local c + +---You can also include line and char numbers +---@source local/file.c:10:8 +local d +``` +]=] LUADOC_DESC_PACKAGE = -- TODO: need translate! [=[ Mark a function as private to the file it is defined in. A packaged function diff --git a/locale/zh-tw/setting.lua b/locale/zh-tw/setting.lua index 7cf93297..c8e0dbfc 100644 --- a/locale/zh-tw/setting.lua +++ b/locale/zh-tw/setting.lua @@ -27,7 +27,7 @@ config.runtime.unicodeName = config.runtime.nonstandardSymbol = "支援非標準的符號。請務必確認你的執行環境支援這些符號。" config.runtime.plugin = -"延伸模組路徑,請查閱[文件](https://github.com/LuaLS/lua-language-server/wiki/Plugins)瞭解用法。" +"延伸模組路徑,請查閱[文件](https://luals.github.io/wiki/plugins)瞭解用法。" config.runtime.pluginArgs = -- TODO: need translate! "Additional arguments for the plugin." config.runtime.fileEncoding = @@ -268,22 +268,16 @@ config.format.defaultConfig = ]] config.spell.dict = '拼寫檢查的自訂單詞。' +config.nameStyle.config = -- TODO: need translate! +'Set name style config' config.telemetry.enable = [[ -啟用遙測,透過網路發送你的編輯器資訊與錯誤日誌。在[此處](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy)閱讀我們的隱私聲明。 +啟用遙測,透過網路發送你的編輯器資訊與錯誤日誌。在[此處](https://luals.github.io/privacy/#language-server)閱讀我們的隱私聲明。 ]] config.misc.parameters = -'VSCode中啟動語言伺服時的[命令列參數](https://github.com/LuaLS/lua-language-server/wiki/Getting-Started#arguments)。' +'VSCode中啟動語言伺服時的[命令列參數](https://luals.github.io/wiki/usage#arguments)。' config.misc.executablePath = -- TODO: need translate! 'Specify the executable path in VSCode.' -config.IntelliSense.traceLocalSet = -'請查閱[文件](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features)瞭解用法。' -config.IntelliSense.traceReturn = -'請查閱[文件](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features)瞭解用法。' -config.IntelliSense.traceBeSetted = -'請查閱[文件](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features)瞭解用法。' -config.IntelliSense.traceFieldInject = -'請查閱[文件](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features)瞭解用法。' config.type.castNumberToInteger = '允許將 `number` 類型賦值給 `integer` 類型。' config.type.weakUnionCheck = @@ -378,6 +372,8 @@ config.diagnostics['invisible'] = -- TODO: need translate! 'Enable diagnostics for accesses to fields which are invisible.' config.diagnostics['missing-global-doc'] = -- TODO: need translate! 'Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.' +config.diagnostics['missing-local-export-doc'] = -- TODO: need translate! +'Missing annotations for exported locals! Exported local functions must have a comment and annotations for all parameters and return values.' config.diagnostics['missing-parameter'] = -- TODO: need translate! 'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.' config.diagnostics['missing-return'] = -- TODO: need translate! @@ -400,6 +396,8 @@ config.diagnostics['return-type-mismatch'] = -- TODO: need translate! 'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.' config.diagnostics['spell-check'] = -- TODO: need translate! 'Enable diagnostics for typos in strings.' +config.diagnostics['name-style-check'] = -- TODO: need translate! +'Enable diagnostics for name style.' config.diagnostics['unbalanced-assignments']= -- TODO: need translate! 'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).' config.diagnostics['undefined-doc-class'] = -- TODO: need translate! @@ -433,3 +431,5 @@ command.exportDocument = -- TODO: need translate! 'Lua: Export Document ...' command.addon_manager.open = -- TODO: need translate! 'Lua: Open Addon Manager ...' +command.reloadFFIMeta = -- TODO: need translate! +'Lua: Reload luajit ffi meta' |