Skip to content

Commit 44bf755

Browse files
committed
update settings
1 parent 1796aef commit 44bf755

File tree

10 files changed

+4335
-658
lines changed

10 files changed

+4335
-658
lines changed

build-settings.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ local json = require 'json-beautify'
1010
local configuration = require 'server.tools.configuration'
1111
local fsu = require 'fs-utility'
1212
local lloader = require 'locale-loader'
13+
local diagd = require 'proto.diagnostic'
14+
local util = require 'utility'
1315

1416
local function addSplited(t, key, value)
1517
t[key] = value
@@ -50,6 +52,17 @@ local encodeOption = {
5052
newline = '\r\n',
5153
indent = ' ',
5254
}
55+
local function mergeDiagnosticGroupLocale(locale)
56+
for groupName, names in pairs(diagd.diagnosticGroups) do
57+
local key = ('config.diagnostics.%s'):format(groupName)
58+
local list = {}
59+
for name in util.sortPairs(names) do
60+
list[#list+1] = ('* %s'):format(name)
61+
end
62+
local desc = table.concat(list, '\n')
63+
locale[key] = desc
64+
end
65+
end
5366

5467
for dirPath in fs.pairs(fs.path 'server/locale') do
5568
local lang = dirPath:filename():string()
@@ -59,6 +72,8 @@ for dirPath in fs.pairs(fs.path 'server/locale') do
5972
goto CONTINUE
6073
end
6174
local nls = lloader(text, nlsPath:string())
75+
-- add `config.diagnostics.XXX`
76+
mergeDiagnosticGroupLocale(nls)
6277

6378
local setting = {
6479
title = 'setting',

0 commit comments

Comments
 (0)