From 219fe4db1bfc038f4dd2f15a450b6395b8bbb01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= <sumneko@hotmail.com> Date: Thu, 6 Jan 2022 16:23:08 +0800 Subject: [PATCH] update nls --- .vscodeignore | 2 +- build-settings.lua | 10 +++++++--- package.nls.json | 12 +++++------ package.nls.zh-cn.json | 45 +++++++++++++++++++++--------------------- package/build.lua | 6 ------ 5 files changed, 36 insertions(+), 39 deletions(-) diff --git a/.vscodeignore b/.vscodeignore index 34bd13f..94ecbc6 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -24,5 +24,5 @@ !README.md !changelog.md !package.nls.json -!package.nls.zh-cn.json +!package.nls.*.json !LICENSE diff --git a/build-settings.lua b/build-settings.lua index 1539040..40e344e 100644 --- a/build-settings.lua +++ b/build-settings.lua @@ -69,12 +69,16 @@ for dirPath in fs.pairs(fs.path 'server/locale') do end), } + local schemaName, nlsName if lang == 'en-us' then - lang = '' + schemaName = 'setting/schema.json' + nlsName = 'package.nls.json' else - lang = '-' .. lang + schemaName = 'setting/schema-' .. lang .. '.json' + nlsName = 'package.nls.' .. lang .. '.json' end - fsu.saveFile(fs.path'setting/schema'..lang..'.json', json.beautify(setting, encodeOption)) + fsu.saveFile(fs.path(schemaName), json.beautify(setting, encodeOption)) + fsu.saveFile(fs.path(nlsName), json.beautify(nls, encodeOption)) ::CONTINUE:: end diff --git a/package.nls.json b/package.nls.json index 3539e75..e17dce2 100644 --- a/package.nls.json +++ b/package.nls.json @@ -30,16 +30,16 @@ "config.develop.debuggerPort": "Listen port of debugger.", "config.develop.debuggerWait": "Suspend before debugger connects.", "config.develop.enable": "Developer mode. Do not enable, performance will be affected.", - "config.diagnostics.disable": "Disabled diagnostic (Use code in hover brackets).\n", + "config.diagnostics.disable": "Disabled diagnostic (Use code in hover brackets).", "config.diagnostics.enable": "Enable diagnostics.", "config.diagnostics.files.Disable": "These files are not diagnosed.", "config.diagnostics.files.Enable": "Always diagnose these files.", "config.diagnostics.files.Opened": "Only when these files are opened will it be diagnosed.", - "config.diagnostics.globals": "Defined global variables.\n", + "config.diagnostics.globals": "Defined global variables.", "config.diagnostics.ignoredFiles": "How to diagnose ignored files.", "config.diagnostics.libraryFiles": "How to diagnose files loaded via `Lua.workspace.library`.", - "config.diagnostics.neededFileStatus": "If you want to check only opened files, choice Opened; else choice Any.\n", - "config.diagnostics.severity": "Modified diagnostic severity.\n", + "config.diagnostics.neededFileStatus": "* Opened: only diagnose opened files\n* Any: diagnose all files\n* Disable: disable this diagnostic\n", + "config.diagnostics.severity": "Modified diagnostic severity.", "config.diagnostics.workspaceDelay": "Latency (milliseconds) for workspace diagnostics. When you start the workspace, or edit any file, the entire workspace will be re-diagnosed in the background. Set to negative to disable workspace diagnostics.", "config.diagnostics.workspaceRate": "Workspace diagnostics run rate (%). Decreasing this value reduces CPU usage, but also reduces the speed of workspace diagnostics. The diagnosis of the file you are currently editing is always done at full speed and is not affected by this setting.", "config.hint.enable": "Enabel hint.", @@ -72,8 +72,8 @@ "config.telemetry.enable": "Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/sumneko/lua-language-server/wiki/Privacy-Policy).\n", "config.window.progressBar": "Show progress bar in status bar.", "config.window.statusBar": "Show extension status in status bar.", - "config.workspace.checkThirdParty": "Automatic detection and adaptation of third-party libraries, currently supported libraries are:\n\n* OpenResty\n* Cocos4.0\n* LÖVE\n* skynet\n* Jass\n", - "config.workspace.ignoreDir": "Ignored files and directories (Use `.gitignore` grammar).\n", + "config.workspace.checkThirdParty": "Automatic detection and adaptation of third-party libraries, currently supported libraries are:\n\n* OpenResty\n* Cocos4.0\n* LÖVE\n* LÖVR\n* skynet\n* Jass\n", + "config.workspace.ignoreDir": "Ignored files and directories (Use `.gitignore` grammar).", "config.workspace.ignoreSubmodules": "Ignore submodules.", "config.workspace.library": "In addition to the current workspace, which directories will load files from. The files in these directories will be treated as externally provided code libraries, and some features (such as renaming fields) will not modify these files.", "config.workspace.maxPreload": "Max preloaded files.", diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index f328da2..4e57123 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -1,10 +1,8 @@ { - "ambiguity-1": "优先级歧义,如:`num or 0 + 1`,推测用户的实际期望为 `(num or 0) + 1` ", "config.IntelliSense.traceBeSetted": "请查阅[文档](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features)了解用法。", "config.IntelliSense.traceFieldInject": "请查阅[文档](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features)了解用法。", "config.IntelliSense.traceLocalSet": "请查阅[文档](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features)了解用法。", "config.IntelliSense.traceReturn": "请查阅[文档](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features)了解用法。", - "config.awakened.cat": "PLAY WITH ME >_<\n\n(这会启用还处于开发中的beta版,欢迎测试反馈!改变此选项需要重载窗口!)", "config.color.mode": "着色模式。", "config.color.mode.Grammar": "语法着色。", "config.color.mode.Semantic": "语义着色。你可能需要同时将 `editor.semanticHighlighting.enabled` 设置为 `true` 才能生效。", @@ -31,18 +29,33 @@ "config.develop.debuggerPort": "调试器监听端口。", "config.develop.debuggerWait": "调试器连接之前挂起。", "config.develop.enable": "开发者模式。请勿开启,会影响性能。", - "config.diagnostics.disable": "禁用的诊断(使用浮框括号内的代码)。\n", + "config.diagnostics.ambiguity-1": "优先级歧义,如:`num or 0 + 1`,推测用户的实际期望为 `(num or 0) + 1` ", + "config.diagnostics.disable": "禁用的诊断(使用浮框括号内的代码)。", + "config.diagnostics.duplicate-index": "在字面量表中重复定义了索引", + "config.diagnostics.empty-block": "空代码块", "config.diagnostics.enable": "启用诊断。", "config.diagnostics.files.Disable": "不诊断这些文件。", "config.diagnostics.files.Enable": "总是诊断这些文件。", "config.diagnostics.files.Opened": "只有打开这些文件时才会诊断。", - "config.diagnostics.globals": "已定义的全局变量。\n", + "config.diagnostics.global-in-nil-env": "不能使用全局变量( `_ENV` 被设置为了 `nil`)", + "config.diagnostics.globals": "已定义的全局变量。", "config.diagnostics.ignoredFiles": "如何诊断被忽略的文件。", "config.diagnostics.libraryFiles": "如何诊断通过 `Lua.workspace.library` 加载的文件。", - "config.diagnostics.neededFileStatus": "如果你只想诊断打开的文件,选Opened;否则,选Any。\n", - "config.diagnostics.severity": "修改诊断等级。\n", + "config.diagnostics.lowercase-global": "首字母小写的全局变量定义", + "config.diagnostics.neededFileStatus": "* Opened: 只诊断打开的文件\n* Any: 诊断任何文件\n* Disable: 禁用此诊断\n", + "config.diagnostics.newfield-call": "在字面量表中,2行代码之间缺少分隔符,在语法上被解析为了一次索引操作", + "config.diagnostics.newline-call": "以 `(` 开始的新行,在语法上被解析为了上一行的函数调用", + "config.diagnostics.redefined-local": "重复定义的局部变量", + "config.diagnostics.redundant-parameter": "函数调用时,传入了多余的参数", + "config.diagnostics.redundant-value": "赋值操作时,值的数量比被赋值的对象多", + "config.diagnostics.severity": "修改诊断等级。", + "config.diagnostics.trailing-space": "后置空格", + "config.diagnostics.undefined-env-child": "`_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中", + "config.diagnostics.undefined-global": "未定义的全局变量", "config.diagnostics.unused-function": "未使用的函数", + "config.diagnostics.unused-label": "未使用的标签", "config.diagnostics.unused-local": "未使用的局部变量", + "config.diagnostics.unused-vararg": "未使用的不定参数", "config.diagnostics.workspaceDelay": "进行工作区诊断的延迟(毫秒)。当你启动工作区,或编辑了任意文件后,将会在后台对整个工作区进行重新诊断。设置为负数可以禁用工作区诊断。", "config.diagnostics.workspaceRate": "工作区诊断的运行速率(百分比)。降低该值会减少CPU占用,但是也会降低工作区诊断的速度。你当前正在编辑的文件的诊断总是全速完成,不受该选项影响。", "config.hint.enable": "启用内联提示。", @@ -75,27 +88,13 @@ "config.telemetry.enable": "启用遥测,通过网络发送你的编辑器信息与错误日志。在[此处](https://github.com/sumneko/lua-language-server/wiki/%E9%9A%90%E7%A7%81%E5%A3%B0%E6%98%8E)阅读我们的隐私声明。\n", "config.window.progressBar": "在状态栏显示进度条。", "config.window.statusBar": "在状态栏显示插件状态。", - "config.workspace.checkThirdParty": "自动检测与适配第三方库,目前支持的库为:\n\n* OpenResty\n* Cocos4.0\n* LÖVE\n* skynet\n* Jass\n", - "config.workspace.ignoreDir": "忽略的文件与目录(使用 `.gitignore` 语法)。\n", + "config.workspace.checkThirdParty": "自动检测与适配第三方库,目前支持的库为:\n\n* OpenResty\n* Cocos4.0\n* LÖVE\n* LÖVR\n* skynet\n* Jass\n", + "config.workspace.ignoreDir": "忽略的文件与目录(使用 `.gitignore` 语法)。", "config.workspace.ignoreSubmodules": "忽略子模块。", "config.workspace.library": "除了当前工作区以外,还会从哪些目录中加载文件。这些目录中的文件将被视作外部提供的代码库,部分操作(如重命名字段)不会修改这些文件。", "config.workspace.maxPreload": "最大预加载文件数。", "config.workspace.preloadFileSize": "预加载时跳过大小大于该值(KB)的文件。", "config.workspace.useGitIgnore": "忽略 `.gitignore` 中列举的文件。", "config.workspace.userThirdParty": "在这里添加私有的第三方库适配文件路径,请参考内置的[配置文件路径](https://github.com/sumneko/lua-language-server/tree/master/meta/3rd)", - "config.zzzzzz.cat": "DONT TOUCH ME, LET ME SLEEP >_<", - "duplicate-index": "在字面量表中重复定义了索引", - "empty-block": "空代码块", - "global-in-nil-env": "不能使用全局变量( `_ENV` 被设置为了 `nil`)", - "lowercase-global": "首字母小写的全局变量定义", - "newfield-call": "在字面量表中,2行代码之间缺少分隔符,在语法上被解析为了一次索引操作", - "newline-call": "以 `(` 开始的新行,在语法上被解析为了上一行的函数调用", - "redefined-local": "重复定义的局部变量", - "redundant-parameter": "函数调用时,传入了多余的参数", - "redundant-value": "赋值操作时,值的数量比被赋值的对象多", - "trailing-space": "后置空格", - "undefined-env-child": "`_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中", - "undefined-global": "未定义的全局变量", - "unused-label": "未使用的标签", - "unused-vararg": "未使用的不定参数" + "config.zzzzzz.cat": "DONT TOUCH ME, LET ME SLEEP >_<" } \ No newline at end of file diff --git a/package/build.lua b/package/build.lua index 738e480..042f643 100644 --- a/package/build.lua +++ b/package/build.lua @@ -18,9 +18,3 @@ local encodeOption = { } print('生成 package.json') fsu.saveFile(ROOT / 'package.json', json.beautify(package, encodeOption) .. '\r\n') - -print('生成 package.nls.json') -fsu.saveFile(ROOT / 'package.nls.json', json.beautify(require 'package.nls', encodeOption)) - -print('生成 package.nls.zh-cn.json') -fsu.saveFile(ROOT / 'package.nls.zh-cn.json', json.beautify(require 'package.nls-zh-cn', encodeOption)) -- GitLab