summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-26 14:35:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-26 14:35:30 +0800
commit2fdaad20824bfeed0abbfeefef6a533a1ce2632e (patch)
treebacfb9ff9da1fa00b972618e7c754586b36d9b37
parent86a9b83d68da99f26a56ce914c65698a3714f0da (diff)
downloadlua-language-server-2fdaad20824bfeed0abbfeefef6a533a1ce2632e.zip
一些中文翻译
-rw-r--r--README.md2
-rw-r--r--server/locale/en-US/libs/lua53/basic.lni10
-rw-r--r--server/locale/zh-CN/libs/lua53/basic.lni148
3 files changed, 155 insertions, 5 deletions
diff --git a/README.md b/README.md
index fcff80ef..9c3d6959 100644
--- a/README.md
+++ b/README.md
@@ -26,4 +26,6 @@
Please [help me][git] improve the quality of `en-US`.
+API描述的中文翻译来自[云风](https://cloudwu.github.io/lua53doc/manual.html)。
+
[git]: https://github.com/sumneko/vscode-lua-language-server
diff --git a/server/locale/en-US/libs/lua53/basic.lni b/server/locale/en-US/libs/lua53/basic.lni
index 719324ce..48d2e248 100644
--- a/server/locale/en-US/libs/lua53/basic.lni
+++ b/server/locale/en-US/libs/lua53/basic.lni
@@ -107,16 +107,16 @@ description = 'Calls function with the given arguments in protected mode.'
description = 'Receives any number of arguments and prints their values to stdout.'
[rawequal]
-description = 'Checks whether v1 is equal to v2.'
+description = 'Checks whether v1 is equal to v2, without invoking the `__eq` metamethod.'
[rawget]
-description = 'Gets the real value of table[index].'
+description = 'Gets the real value of `table[index]`, without invoking the `__index` metamethod.'
[rawlen]
-description = 'Returns the length of the object v.'
+description = 'Returns the length of the object `v`, without invoking the `__len` metamethod.'
[rawset]
-description = 'Sets the real value of table[index] to value.'
+description = 'Sets the real value of `table[index]` to `value`, without invoking the `__newindex` metamethod.'
[select]
[[.enums]]
@@ -126,7 +126,7 @@ description = 'Returns the total number of extra arguments.'
[[.enums]]
name = 'index'
code = 'integer'
-description = 'Returns all arguments after number index.'
+description = 'Returns all arguments after number `index`.'
[setmetatable]
description = 'Sets the metatable for the given table.'
diff --git a/server/locale/zh-CN/libs/lua53/basic.lni b/server/locale/zh-CN/libs/lua53/basic.lni
index 10b46224..91f79e79 100644
--- a/server/locale/zh-CN/libs/lua53/basic.lni
+++ b/server/locale/zh-CN/libs/lua53/basic.lni
@@ -1,2 +1,150 @@
[assert]
description = '如果其参数 `v` 的值为假,它就调用 `error`。'
+
+[collectgarbage]
+[[.enums]]
+name = 'opt'
+enum = 'collect'
+description = '做一次完整的垃圾收集循环。'
+[[.enums]]
+name = 'opt'
+enum = 'stop'
+description = '停止垃圾收集器的运行。'
+[[.enums]]
+name = 'opt'
+enum = 'restart'
+description = '重启垃圾收集器的自动运行。'
+[[.enums]]
+name = 'opt'
+enum = 'count'
+description = '以 K 字节数为单位返回 Lua 使用的总内存数。'
+[[.enums]]
+name = 'opt'
+enum = 'step'
+description = '单步运行垃圾收集器。'
+[[.enums]]
+name = 'opt'
+enum = 'setpause'
+description = '设置收集器的 `间歇率`。'
+[[.enums]]
+name = 'opt'
+enum = 'setstepmul'
+description = '设置收集器的 `步进倍率`。'
+[[.enums]]
+name = 'opt'
+enum = 'isrunning'
+description = '返回表示收集器是否在工作的布尔值。'
+
+[dofile]
+description = '打开该名字的文件,并执行文件中的 Lua 代码块。'
+
+[error]
+description = '中止上一次保护函数调用, 将错误对象 message 返回。'
+
+[_G]
+description = '内部储存有全局环境。'
+
+[getmetatable]
+description = '返回该对象的元表。'
+
+[ipairs]
+description = [[
+----------------
+```lua
+for i, v in ipairs(t) do
+ body
+end
+```
+]]
+
+[load]
+description = '加载一个代码块。'
+[[.enums]]
+name = 'mode'
+enum = 'b'
+description = '只能是二进制代码块。'
+[[.enums]]
+name = 'mode'
+enum = 't'
+description = '只能是文本代码块。'
+[[.enums]]
+name = 'mode'
+enum = 'bt'
+description = '可以是二进制也可以是文本。'
+
+[loadfile]
+description = '从文件中获取代码块。'
+[[.enums]]
+name = 'mode'
+enum = 'b'
+description = '只能是二进制代码块。'
+[[.enums]]
+name = 'mode'
+enum = 't'
+description = '只能是文本代码块。'
+[[.enums]]
+name = 'mode'
+enum = 'bt'
+description = '可以是二进制也可以是文本。'
+
+[next]
+description = '返回该键的下一个键及其关联的值。'
+
+[pairs]
+description = [[
+----------------
+```lua
+for k, v in pairs(t) do
+ body
+end
+```
+]]
+
+[pcall]
+description = '传入参数,以 *保护模式* 调用函数 `f` 。'
+
+[print]
+description = '接收任意数量的参数,并将它们的值打印到 `stdout`。'
+
+[rawequal]
+description = '在不触发任何元方法的情况下 检查 `v1` 是否和 `v2` 相等。'
+
+[rawget]
+description = '在不触发任何元方法的情况下 获取 `table[index]` 的值。'
+
+[rawlen]
+description = '在不触发任何元方法的情况下 返回对象 `v` 的长度。'
+
+[rawset]
+description = '在不触发任何元方法的情况下 将 `table[index]` 设为 `value`。'
+
+[select]
+[[.enums]]
+name = 'index'
+enum = '#'
+description = '返回参数的个数。'
+[[.enums]]
+name = 'index'
+code = 'integer'
+description = '返回参数中第 `index` 个之后的部分。'
+
+[setmetatable]
+description = '给指定表设置元表。'
+
+[tonumber]
+description = '尝试把参数转换为一个数字。'
+
+[tostring]
+description = '可以接收任何类型,它将其转换为人可阅读的字符串形式。'
+
+[type]
+description = '将参数的类型编码为一个字符串返回。'
+
+[_VERSION]
+description = '当前解释器版本号。'
+
+[xpcall]
+description = '传入参数并设置一个消息处理器 `msgh`,以 *保护模式* 调用函数 `f` 。'
+
+[require]
+description = '加载一个模块。'