summaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
Diffstat (limited to 'locale')
-rw-r--r--locale/en-us/meta.lua6
-rw-r--r--locale/zh-cn/meta.lua6
2 files changed, 12 insertions, 0 deletions
diff --git a/locale/en-us/meta.lua b/locale/en-us/meta.lua
index 858cde13..839dc27a 100644
--- a/locale/en-us/meta.lua
+++ b/locale/en-us/meta.lua
@@ -677,6 +677,12 @@ Returns the elements from the given list. This function is equivalent to
```
By default, `i` is `1` and `j` is `#list`.
]]
+table.foreach =
+'Executes the given f over all elements of table. For each element, f is called with the index and respective value as arguments. If f returns a non-nil value, then the loop is broken, and this value is returned as the final value of foreach.'
+table.foreachi =
+'Executes the given f over the numerical indices of table. For each index, f is called with the index and respective value as arguments. Indices are visited in sequential order, from 1 to n, where n is the size of the table. If f returns a non-nil value, then the loop is broken and this value is returned as the result of foreachi.'
+table.getn =
+'Returns the number of elements in the table. This function is equivalent to `#list`.'
utf8 =
''
diff --git a/locale/zh-cn/meta.lua b/locale/zh-cn/meta.lua
index 8e7c37e8..61ba6c9b 100644
--- a/locale/zh-cn/meta.lua
+++ b/locale/zh-cn/meta.lua
@@ -655,6 +655,12 @@ table.unpack =
```
i 默认为 1 ,j 默认为 #list。
]]
+table.foreach =
+'遍历表中的每一个元素,并以key和value执行回调函数。如果回调函数返回一个非nil值则循环终止,并且返回这个值。该函数等同pair(list),比pair(list)更慢。不推荐使用'
+table.foreachi =
+'遍历数组中的每一个元素,并以索引号index和value执行回调函数。如果回调函数返回一个非nil值则循环终止,并且返回这个值。该函数等同ipair(list),比ipair(list)更慢。不推荐使用'
+table.getn =
+'返回表的长度。该函数等价于#list。'
utf8 =
''