Skip to content

Commit

Permalink
[bugfix] fix lack of i18n support for close/delete node in ctx-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
GarinZ committed Apr 11, 2023
1 parent a7d8d6d commit 48365be
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
12 changes: 12 additions & 0 deletions public/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,17 @@
},
"createNewTabByLevel": {
"message": "Create New Tab by Level"
},
"deleteNode": {
"message": "Delete Node"
},
"deleteSubtree": {
"message": "Delete Subtree"
},
"closeNode": {
"message": "Close Node"
},
"closeSubtree": {
"message": "Close Subtree"
}
}
12 changes: 12 additions & 0 deletions public/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,17 @@
},
"createNewTabByLevel": {
"message": "根据层级创建新标签"
},
"deleteNode": {
"message": "删除节点"
},
"deleteSubtree": {
"message": "删除子树"
},
"closeNode": {
"message": "关闭节点"
},
"closeSubtree": {
"message": "关闭子树"
}
}
8 changes: 4 additions & 4 deletions src/tree/features/tab-master-tree/plugins/context-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export const registerContextMenu = () => {
icon: () => 'iconfont icon-trash context-menu-icon',
items: {
deleteNode: {
name: 'Delete Node',
name: browser.i18n.getMessage('deleteNode'),
icon: () => 'iconfont icon-pointer context-menu-icon',
},
deleteSubTree: {
name: 'Delete Subtree',
name: browser.i18n.getMessage('deleteSubTree'),
icon: () => 'iconfont icon-node-multiple context-menu-icon',
},
},
Expand All @@ -36,11 +36,11 @@ export const registerContextMenu = () => {
icon: () => 'iconfont icon-roundclosefill context-menu-icon',
items: {
closeNode: {
name: 'Close Node',
name: browser.i18n.getMessage('closeNode'),
icon: () => 'iconfont icon-pointer context-menu-icon',
},
closeSubTree: {
name: 'Close Subtree',
name: browser.i18n.getMessage('closeSubTree'),
icon: () => 'iconfont icon-node-multiple context-menu-icon',
},
},
Expand Down

0 comments on commit 48365be

Please sign in to comment.