From 2e8fd8dd3a0b97d573328f5b540056359fa85777 Mon Sep 17 00:00:00 2001 From: cweijan Date: Mon, 4 Jan 2021 15:14:54 +0800 Subject: [PATCH] Add i18n of chinese. --- CHANGELOG.md | 1 + README.md | 1 - i18n.js | 10 ++++ package.json | 116 ++++++++++++++++++++--------------------- package.nls.json | 59 +++++++++++++++++++++ package.nls.zh-cn.json | 59 +++++++++++++++++++++ 6 files changed, 187 insertions(+), 59 deletions(-) create mode 100644 i18n.js create mode 100644 package.nls.json create mode 100644 package.nls.zh-cn.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e14de6..1a637f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Better result view border color. - Remember page size. - Fix sql formatter could not be detect comment correctly. +- Add i18n of chinese. # 2.9.0 2020/12/31 diff --git a/README.md b/README.md index ba7da65..2ecbc7d 100644 --- a/README.md +++ b/README.md @@ -91,4 +91,3 @@ OpenSetting -> extensions -> Mysql - Sync table struct from diffrent connection. - Better Intetllisense sql. -- Add i18n. diff --git a/i18n.js b/i18n.js new file mode 100644 index 0000000..1e473b9 --- /dev/null +++ b/i18n.js @@ -0,0 +1,10 @@ +const p=require('./package.json') +const content={} +for (const command of p.contributes.commands) { + const key = command.command.replace("mysql", 'command'); + content[key]=command.title; + command.title=`%${key}%` +} +console.log(JSON.stringify(content)) +console.log('--------------------------------------------') +console.log(JSON.stringify(p.contributes.commands)) \ No newline at end of file diff --git a/package.json b/package.json index 4d7501a..a39a778 100644 --- a/package.json +++ b/package.json @@ -60,19 +60,19 @@ "commands": [ { "command": "mysql.history.open", - "title": "Open History", + "title": "%command.history.open%", "category": "MySQL", "icon": "resources/icon/history.svg" }, { "command": "mysql.setting.open", - "title": "Open Setting", + "title": "%command.setting.open%", "category": "MySQL", "icon": "resources/icon/settings.svg" }, { "command": "mysql.refresh", - "title": "Refresh", + "title": "%command.refresh%", "category": "MySQL", "icon": { "light": "resources/light/refresh.svg", @@ -81,17 +81,17 @@ }, { "command": "mysql.host.copy", - "title": "Copy Host", + "title": "%command.host.copy%", "category": "MySQL" }, { "command": "mysql.name.copy", - "title": "Copy Name", + "title": "%command.name.copy%", "category": "MySQL" }, { "command": "mysql.diagram.add", - "title": "Create Diagram", + "title": "%command.diagram.add%", "icon": { "light": "resources/light/add.svg", "dark": "resources/dark/add.svg" @@ -100,7 +100,7 @@ }, { "command": "mysql.query.add", - "title": "Create Query", + "title": "%command.query.add%", "icon": { "light": "resources/light/add.svg", "dark": "resources/dark/add.svg" @@ -109,23 +109,23 @@ }, { "command": "mysql.query.rename", - "title": "Rename Query", + "title": "%command.query.rename%", "category": "MySQL" }, { "command": "mysql.diagram.open", - "title": "Open Diagram", + "title": "%command.diagram.open%", "category": "MySQL" }, { "command": "mysql.diagram.drop", - "title": "Drop Diagram", + "title": "%command.diagram.drop%", "category": "MySQL", "icon": "resources/icon/criss-cross.svg" }, { "command": "mysql.connection.add", - "title": "Add Connection", + "title": "%command.connection.add%", "icon": { "light": "resources/light/add.svg", "dark": "resources/dark/add.svg" @@ -134,22 +134,22 @@ }, { "command": "mysql.connection.edit", - "title": "Edit Connection", + "title": "%command.connection.edit%", "category": "MySQL" }, { "command": "mysql.server.info", - "title": "Server Status", + "title": "%command.server.info%", "category": "MySQL" }, { "command": "mysql.connection.delete", - "title": "Delete Connection", + "title": "%command.connection.delete%", "category": "MySQL" }, { "command": "mysql.database.add", - "title": "New Database", + "title": "%command.database.add%", "icon": { "light": "resources/light/add.svg", "dark": "resources/dark/add.svg" @@ -158,17 +158,17 @@ }, { "command": "mysql.db.overview", - "title": "Overview", + "title": "%command.db.overview%", "category": "MySQL" }, { "command": "mysql.db.drop", - "title": "Drop Database", + "title": "%command.db.drop%", "category": "MySQL" }, { "command": "mysql.runQuery", - "title": "Run MySQL Query", + "title": "%command.runQuery%", "category": "MySQL", "icon": { "light": "resources/light/run.png", @@ -177,7 +177,7 @@ }, { "command": "mysql.query.switch", - "title": "Open Query", + "title": "%command.query.switch%", "category": "MySQL", "icon": { "light": "resources/light/query.svg", @@ -186,63 +186,63 @@ }, { "command": "mysql.template.sql", - "title": "Select SQL", + "title": "%command.template.sql%", "category": "MySQL" }, { "command": "mysql.template.delete", - "title": "Delete SQL", + "title": "%command.template.delete%", "category": "MySQL" }, { "command": "mysql.data.import", - "title": "Import Sql", + "title": "%command.data.import%", "category": "MySQL" }, { "command": "mysql.data.export", - "title": "Export Data", + "title": "%command.data.export%", "category": "MySQL" }, { "command": "mysql.struct.export", - "title": "Export Struct", + "title": "%command.struct.export%", "category": "MySQL" }, { "command": "mysql.copy.insert", - "title": "Insert SQL", + "title": "%command.copy.insert%", "category": "MySQL" }, { "command": "mysql.copy.update", - "title": "Update SQL", + "title": "%command.copy.update%", "category": "MySQL" }, { "command": "mysql.db.active", - "title": "Change Active Database", + "title": "%command.db.active%", "category": "MySQL" }, { "command": "mysql.table.truncate", - "title": "Truncate Table", + "title": "%command.table.truncate%", "category": "MySQL" }, { "command": "mysql.db.truncate", - "title": "Truncate Database", + "title": "%command.db.truncate%", "category": "MySQL" }, { "command": "mysql.table.drop", - "title": "Drop table", + "title": "%command.table.drop%", "category": "MySQL", "icon": "resources/icon/criss-cross.svg" }, { "command": "mysql.mock.run", - "title": "Start Generate", + "title": "%command.mock.run%", "category": "MySQL", "icon": { "light": "resources/light/run.png", @@ -251,12 +251,12 @@ }, { "command": "mysql.mock.table", - "title": "Generate Mock Data", + "title": "%command.mock.table%", "category": "MySQL" }, { "command": "mysql.changeTableName", - "title": "Change Name", + "title": "%command.changeTableName%", "category": "MySQL", "icon": { "light": "resources/light/edit.svg", @@ -265,12 +265,12 @@ }, { "command": "mysql.index.template", - "title": "Index Manage", + "title": "%command.index.template%", "category": "MySQL" }, { "command": "mysql.column.changeName", - "title": "Change Column Name", + "title": "%command.column.changeName%", "category": "MySQL", "icon": { "light": "resources/light/edit.svg", @@ -279,12 +279,12 @@ }, { "command": "mysql.column.add", - "title": "Add Column", + "title": "%command.column.add%", "category": "MySQL" }, { "command": "mysql.column.up", - "title": "Move Column Up", + "title": "%command.column.up%", "category": "MySQL", "icon": { "light": "resources/light/up.png", @@ -293,7 +293,7 @@ }, { "command": "mysql.column.down", - "title": "Move Column Down", + "title": "%command.column.down%", "category": "MySQL", "icon": { "light": "resources/light/down.png", @@ -302,38 +302,38 @@ }, { "command": "mysql.table.source", - "title": "Show Table Source", + "title": "%command.table.source%", "category": "MySQL" }, { "command": "mysql.view.source", - "title": "Show View Source", + "title": "%command.view.source%", "category": "MySQL" }, { "command": "mysql.count.sql", - "title": "Show Count", + "title": "%command.count.sql%", "category": "MySQL" }, { "command": "mysql.table.show", - "title": "Open In New Panel", + "title": "%command.table.show%", "category": "MySQL", "icon": "resources/icon/analysis.svg" }, { "command": "mysql.column.update", - "title": "Modify Column", + "title": "%command.column.update%", "category": "MySQL" }, { "command": "mysql.column.drop", - "title": "Drop column", + "title": "%command.column.drop%", "category": "MySQL" }, { "command": "mysql.template.table", - "title": "Create New Table", + "title": "%command.template.table%", "category": "MySQL", "icon": { "light": "resources/light/add.svg", @@ -342,7 +342,7 @@ }, { "command": "mysql.template.view", - "title": "Create New View", + "title": "%command.template.view%", "category": "MySQL", "icon": { "light": "resources/light/add.svg", @@ -351,7 +351,7 @@ }, { "command": "mysql.template.procedure", - "title": "Create New Procedure", + "title": "%command.template.procedure%", "category": "MySQL", "icon": { "light": "resources/light/add.svg", @@ -360,7 +360,7 @@ }, { "command": "mysql.template.trigger", - "title": "Create New Trigger", + "title": "%command.template.trigger%", "category": "MySQL", "icon": { "light": "resources/light/add.svg", @@ -369,7 +369,7 @@ }, { "command": "mysql.template.function", - "title": "Create New Function", + "title": "%command.template.function%", "category": "MySQL", "icon": { "light": "resources/light/add.svg", @@ -378,7 +378,7 @@ }, { "command": "mysql.template.user", - "title": "Create New User", + "title": "%command.template.user%", "category": "MySQL", "icon": { "light": "resources/light/add.svg", @@ -387,37 +387,37 @@ }, { "command": "mysql.delete.user", - "title": "Drop User", + "title": "%command.delete.user%", "category": "MySQL" }, { "command": "mysql.user.grant", - "title": "Grant Privileges", + "title": "%command.user.grant%", "category": "MySQL" }, { "command": "mysql.change.user", - "title": "Change User Password", + "title": "%command.change.user%", "category": "MySQL" }, { "command": "mysql.delete.view", - "title": "Drop View", + "title": "%command.delete.view%", "category": "MySQL" }, { "command": "mysql.delete.procedure", - "title": "Drop Procedure", + "title": "%command.delete.procedure%", "category": "MySQL" }, { "command": "mysql.delete.function", - "title": "Drop Function", + "title": "%command.delete.function%", "category": "MySQL" }, { "command": "mysql.delete.trigger", - "title": "Drop Trigger", + "title": "%command.delete.trigger%", "category": "MySQL" } ], @@ -937,4 +937,4 @@ "publisherDisplayName": "cweijan", "publisherId": "3f28829b-0cc9-47bb-90db-7c05baa399ec" } -} +} \ No newline at end of file diff --git a/package.nls.json b/package.nls.json new file mode 100644 index 0000000..44ae647 --- /dev/null +++ b/package.nls.json @@ -0,0 +1,59 @@ +{ + "command.history.open": "Open History", + "command.setting.open": "Open Setting", + "command.refresh": "Refresh", + "command.host.copy": "Copy Host", + "command.name.copy": "Copy Name", + "command.diagram.add": "Create Diagram", + "command.query.add": "Create Query", + "command.query.rename": "Rename Query", + "command.diagram.open": "Open Diagram", + "command.diagram.drop": "Drop Diagram", + "command.connection.add": "Add Connection", + "command.connection.edit": "Edit Connection", + "command.server.info": "Server Status", + "command.connection.delete": "Delete Connection", + "command.database.add": "New Database", + "command.db.overview": "Overview", + "command.db.drop": "Drop Database", + "command.runQuery": "Run MySQL Query", + "command.query.switch": "Open Query", + "command.template.sql": "Select SQL Template", + "command.template.delete": "Delete SQL Template", + "command.data.import": "Import Sql", + "command.data.export": "Export Data", + "command.struct.export": "Export Struct", + "command.copy.insert": "Insert SQL Template", + "command.copy.update": "Update SQL Template", + "command.db.active": "Change Active Database", + "command.table.truncate": "Truncate Table", + "command.db.truncate": "Truncate Database", + "command.table.drop": "Drop table", + "command.mock.run": "Start Generate", + "command.mock.table": "Generate Mock Data", + "command.changeTableName": "Change Name", + "command.index.template": "Index Manage", + "command.column.changeName": "Change Column Name", + "command.column.add": "Add Column", + "command.column.up": "Move Column Up", + "command.column.down": "Move Column Down", + "command.table.source": "Show Table Source", + "command.view.source": "Show View Source", + "command.count.sql": "Show Count", + "command.table.show": "Open In New Panel", + "command.column.update": "Modify Column", + "command.column.drop": "Drop column", + "command.template.table": "Create New Table", + "command.template.view": "Create New View", + "command.template.procedure": "Create New Procedure", + "command.template.trigger": "Create New Trigger", + "command.template.function": "Create New Function", + "command.template.user": "Create New User", + "command.delete.user": "Drop User", + "command.user.grant": "Grant Privileges", + "command.change.user": "Change User Password", + "command.delete.view": "Drop View", + "command.delete.procedure": "Drop Procedure", + "command.delete.function": "Drop Function", + "command.delete.trigger": "Drop Trigger" +} \ No newline at end of file diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json new file mode 100644 index 0000000..844a9f1 --- /dev/null +++ b/package.nls.zh-cn.json @@ -0,0 +1,59 @@ +{ + "command.history.open": "打开查询历史", + "command.setting.open": "打开设置", + "command.refresh": "刷新", + "command.host.copy": "复制Host", + "command.name.copy": "复制名称", + "command.diagram.add": "新建实体图", + "command.query.add": "新建查询", + "command.query.rename": "重命名查询", + "command.diagram.open": "打开实体图", + "command.diagram.drop": "删除实体图", + "command.connection.add": "连接数据库", + "command.connection.edit": "编辑数据库连接", + "command.server.info": "数据库状态", + "command.connection.delete": "删除连接", + "command.database.add": "新建数据库", + "command.db.overview": "Overview", + "command.db.drop": "删除数据库", + "command.runQuery": "执行Sql", + "command.query.switch": "打开查询", + "command.template.sql": "Select SQL模板", + "command.template.delete": "Delete SQL模板", + "command.data.import": "导入Sql文件", + "command.data.export": "备份数据库", + "command.struct.export": "备份数据库结构", + "command.copy.insert": "Insert SQL模板", + "command.copy.update": "Update SQL模板", + "command.db.active": "修改活动数据库", + "command.table.truncate": "清空表", + "command.db.truncate": "清空数据库", + "command.table.drop": "删除表", + "command.mock.run": "开始生成", + "command.mock.table": "生成Mock数据", + "command.changeTableName": "修改表名称", + "command.index.template": "索引管理", + "command.column.changeName": "修改列名", + "command.column.add": "新建列", + "command.column.up": "上移列", + "command.column.down": "下移列", + "command.table.source": "查看表源码", + "command.view.source": "查看视图源码", + "command.count.sql": "查询数据总数", + "command.table.show": "在新的面板打开", + "command.column.update": "修改列", + "command.column.drop": "删除列", + "command.template.table": "新建表", + "command.template.view": "新建视图", + "command.template.procedure": "新建存储过程", + "command.template.trigger": "新建触发器", + "command.template.function": "新建函数", + "command.template.user": "新建用户", + "command.delete.user": "删除用户", + "command.user.grant": "授权", + "command.change.user": "修改用户密码", + "command.delete.view": "删除视图", + "command.delete.procedure": "删除存储过程", + "command.delete.function": "删除函数", + "command.delete.trigger": "删除触发器" +} \ No newline at end of file