Skip to content

Commit

Permalink
添加翻译
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Jul 21, 2023
1 parent e50b20f commit 998927a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 26 deletions.
4 changes: 3 additions & 1 deletion locale/en-us/script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ 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 fields: {}'

MWS_NOT_SUPPORT =
'{} does not support multi workspace for now, I may need to restart to support the new workspace ...'
Expand Down
2 changes: 2 additions & 0 deletions locale/pt-br/script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ 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 fields: {}'

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 ...'
Expand Down
50 changes: 26 additions & 24 deletions locale/zh-cn/script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +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_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 `{}`.'
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 =
'签名不完整。函数 `{2}` 的参数 `{1}` 缺少 @param 注解。'
DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN =
'签名不完整。函数 `{2}` 的第 {1} 个返回值缺少 @return 注解。'
DIAG_UNKNOWN_DIAG_CODE =
'未知的诊断代号 `{}`。'
DIAG_CAST_LOCAL_TYPE =
Expand Down Expand Up @@ -166,8 +166,10 @@ 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 =
'缺少字段: {}'

MWS_NOT_SUPPORT =
'{} 目前还不支持多工作目录,我可能需要重启才能支持新的工作目录...'
Expand Down Expand Up @@ -196,8 +198,8 @@ 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).'
WORKSPACE_SCAN_TOO_MUCH =
'已扫描了超过 {} 个文件,当前扫描的目录为 `{}`. 请参阅 [FAQ](https://github.com/LuaLS/lua-language-server/wiki/FAQ#how-can-i-improve-startup-speeds) 了解如何排除多余的文件。也可能是你的 [设置有错误](https://github.com/LuaLS/lua-language-server/wiki/FAQ#why-is-the-server-scanning-the-wrong-folder).'

PARSER_CRASH =
'语法解析崩溃了!遗言:{}'
Expand Down Expand Up @@ -448,8 +450,8 @@ ACTION_ADD_DICT =
'\'{}\' 添加到工作区的词典中。'
ACTION_FIX_ADD_PAREN =
'添加括号。'
ACTION_AUTOREQUIRE = -- TODO: need translate!
"Import '{}' as {}"
ACTION_AUTOREQUIRE =
"导入 '{}' 作为 `{}`"

COMMAND_DISABLE_DIAG =
'禁用诊断'
Expand All @@ -469,8 +471,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 =
'{} 个引用'

Expand Down
2 changes: 2 additions & 0 deletions locale/zh-tw/script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ 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 fields: {}'

MWS_NOT_SUPPORT =
'{} 目前還不支援多工作目錄,我可能需要重新啟動才能支援新的工作目錄...'
Expand Down
3 changes: 2 additions & 1 deletion script/core/diagnostics/missing-fields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local vm = require 'vm'
local files = require 'files'
local guide = require 'parser.guide'
local await = require 'await'
local lang = require 'language'

---@async
return function (uri, callback)
Expand Down Expand Up @@ -66,7 +67,7 @@ return function (uri, callback)
callback {
start = src.start,
finish = src.finish,
message = string.format('Missing fields: %s', table.concat(missedKeys, ', ')),
message = lang.script('DIAG_MISSING_FIELDS', table.concat(missedKeys, ', ')),
}
end)
end

0 comments on commit 998927a

Please sign in to comment.