Skip to content

Commit af71d44

Browse files
committed
#1127 fix locale
parse error of `[[xxx]]`
1 parent 5c4fbc7 commit af71d44

File tree

5 files changed

+8
-64
lines changed

5 files changed

+8
-64
lines changed

locale/zh-cn/meta.lua

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ string.pack =
654654
'返回一个打包了(即以二进制形式序列化) v1, v2 等值的二进制字符串。 字符串 fmt 为打包格式(参见 §6.4.2)。'
655655
string.packsize =
656656
[[返回以指定格式用 $string.pack 打包的字符串的长度。 格式化字符串中不可以有变长选项 's' 或 'z' (参见 §6.4.2)。]]
657+
string.rep['>5.2'] =
658+
'返回 `n` 个字符串 `s` 以字符串 `sep` 为分割符连在一起的字符串。 默认的 `sep` 值为空字符串(即没有分割符)。 如果 `n` 不是正数则返回空串。'
657659
string.rep['<5.1'] =
658660
'返回 `n` 个字符串 `s` 连在一起的字符串。 如果 `n` 不是正数则返回空串。'
659661
string.rep['>5.2'] =
@@ -684,36 +686,6 @@ a1[f],···,a1[e]
684686
return a2
685687
```
686688
]]
687-
string.rep['>5.2'] = -- TODO: need translate!
688-
'Returns a string that is the concatenation of `n` copies of the string `s` separated by the string `sep`.'
689-
string.rep['<5.1'] = -- TODO: need translate!
690-
'Returns a string that is the concatenation of `n` copies of the string `s` .'
691-
string.reverse = -- TODO: need translate!
692-
'Returns a string that is the string `s` reversed.'
693-
string.sub = -- TODO: need translate!
694-
'Returns the substring of the string that starts at `i` and continues until `j`.'
695-
string.unpack = -- TODO: need translate!
696-
'Returns the values packed in string according to the format string `fmt` (see §6.4.2) .'
697-
string.upper = -- TODO: need translate!
698-
'Returns a copy of this string with all lowercase letters changed to uppercase.'
699-
700-
table = -- TODO: need translate!
701-
''
702-
table.concat = -- TODO: need translate!
703-
'Given a list where all elements are strings or numbers, returns the string `list[i]..sep..list[i+1] ··· sep..list[j]`.'
704-
table.insert = -- TODO: need translate!
705-
'Inserts element `value` at position `pos` in `list`.'
706-
table.maxn = -- TODO: need translate!
707-
'Returns the largest positive numerical index of the given table, or zero if the table has no positive numerical indices.'
708-
table.move = -- TODO: need translate!
709-
[[
710-
Moves elements from table `a1` to table `a2`.
711-
```lua
712-
a2[t],··· =
713-
a1[f],···,a1[e]
714-
return a2
715-
```
716-
]]
717689
table.pack =
718690
'返回用所有参数以键 `1`,`2`, 等填充的新表, 并将 `"n"` 这个域设为参数的总数。'
719691
table.remove =

locale/zh-tw/meta.lua

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ string.pack =
654654
'回傳一個打包了(即以二進制形式序列化) v1, v2 等值的二進制字串。 字串 fmt 為打包格式(參見 §6.4.2)。'
655655
string.packsize =
656656
[[回傳以指定格式用 $string.pack 打包的字串的長度。 格式化字串中不可以有變長選項 's' 或 'z' (參見 §6.4.2)。]]
657+
string.rep['>5.2'] =
658+
'回傳 `n` 個字串 `s` 以字串 `sep` 為分割符連在一起的字串。 預設的 `sep` 值為空字串(即沒有分割符)。 如果 `n` 不是正數則回傳空串。'
657659
string.rep['<5.1'] =
658660
'回傳 `n` 個字串 `s` 連在一起的字串。 如果 `n` 不是正數則回傳空串。'
659661
string.rep['>5.2'] =
@@ -684,36 +686,6 @@ a1[f],···,a1[e]
684686
return a2
685687
```
686688
]]
687-
string.rep['>5.2'] =
688-
'回傳一個由 `n` 份被 `sep` 分割的字串 `s` 所序連而成的字串。'
689-
string.rep['<5.1'] =
690-
'回傳一個由 `n` 份字串 `s` 序連而成的字串。'
691-
string.reverse =
692-
'回傳一個字串 `s` 的反轉字串。'
693-
string.sub =
694-
'回傳一個從 `i` 開始並在 `j` 結束的子字串。'
695-
string.unpack =
696-
'根據格式字串 `fmt` 回傳打包在字串內的值 (參見 §6.4.2) 。'
697-
string.upper =
698-
'回傳此字串的副本,其中所有小寫字母都更改為大寫。'
699-
700-
table =
701-
''
702-
table.concat =
703-
'給定一個所有元素都是字串或數字的清單,回傳字串 `list[i]..sep..list[i+1] ··· sep..list[j]`。'
704-
table.insert =
705-
'在 `list` 內的 `pos` 位置插入元素 `value`。'
706-
table.maxn =
707-
'回傳表內最大正數索引,若不存在正數索引則回傳0'
708-
table.move =
709-
[[
710-
從表 `a1` 移動元素至表 `a2`。
711-
```lua
712-
a2[t],··· =
713-
a1[f],···,a1[e]
714-
return a2
715-
```
716-
]]
717689
table.pack =
718690
'回傳用所有參數以鍵 `1`,`2`, 等填充的新表, 並將 `"n"` 這個域設為參數的總數。'
719691
table.remove =
@@ -769,4 +741,4 @@ utf8.codepoint =
769741
utf8.len =
770742
'回傳字串 `s` 中 從位置 `i` 到 `j` 間 (包括兩端) UTF-8 字元的個數。'
771743
utf8.offset =
772-
'回傳編碼在 `s` 中的第 `n` 個字元的開始位置(按位元組數) (從位置 `i` 處開始統計)。'
744+
'回傳編碼在 `s` 中的第 `n` 個字元的開始位置(按位元組數) (從位置 `i` 處開始統計)。'

locale/zh-tw/script.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,4 +537,4 @@ CLI_CHECK_INITING =
537537
CLI_CHECK_SUCCESS =
538538
'診斷完成,沒有發現問題'
539539
CLI_CHECK_RESULTS =
540-
'診斷完成,共有 {} 個問題,請查看 {}'
540+
'診斷完成,共有 {} 個問題,請查看 {}'

locale/zh-tw/setting.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,4 @@ config.diagnostics['duplicate-index'] =
244244
config.diagnostics['empty-block'] =
245245
'空程式碼區塊'
246246
config.diagnostics['redundant-value'] =
247-
'賦值操作時,值的數量比被賦值的對象多'
247+
'賦值操作時,值的數量比被賦值的對象多'

tools/locale.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ local function loadLocaleFile(filePath)
4444
current = nil
4545
else
4646
current.content[#current.content+1] = line
47-
if line:sub(1, 2) == '[[' then
47+
if line:sub(1, 2) == '[[' and line:sub(-2) ~= ']]' then
4848
inLongString = true
4949
end
5050
end

0 commit comments

Comments
 (0)