Skip to content

Commit

Permalink
Merge pull request #857 from pano9000/feat_i18n-kdb-tags-#820
Browse files Browse the repository at this point in the history
i18n: make <kbd> tags translatable
  • Loading branch information
eliandoran authored Dec 29, 2024
2 parents e722b65 + 28bbbae commit 42c6c44
Show file tree
Hide file tree
Showing 15 changed files with 126 additions and 128 deletions.
4 changes: 2 additions & 2 deletions src/public/app/menus/launcher_context_menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export default class LauncherContextMenu implements SelectMenuItemEventListener<
isVisibleItem ? { title: t("launcher_context_menu.move-to-available-launchers"), command: "moveLauncherToAvailable", uiIcon: "bx bx-hide", enabled: true } : null,
(isVisibleItem || isAvailableItem) ? { title: "----" } : null,

{ title: `${t("launcher_context_menu.duplicate-launcher")} <kbd data-command="duplicateSubtree">`, command: "duplicateSubtree", uiIcon: "bx bx-outline", enabled: isItem },
{ title: `${t("launcher_context_menu.delete")} <kbd data-command="deleteNotes"></kbd>`, command: "deleteNotes", uiIcon: "bx bx-trash destructive-action-icon", enabled: canBeDeleted },
{ title: `${t("launcher_context_menu.duplicate-launcher")}`, command: "duplicateSubtree", uiIcon: "bx bx-outline", enabled: isItem },
{ title: `${t("launcher_context_menu.delete")}`, command: "deleteNotes", uiIcon: "bx bx-trash destructive-action-icon", enabled: canBeDeleted },

{ title: "----" },

Expand Down
2 changes: 1 addition & 1 deletion src/public/app/menus/tree_context_menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree
const insertNoteAfterEnabled = isNotRoot && !isHoisted && parentNotSearch;

const items: (MenuItem<TreeCommandNames> | null)[] = [
{ title: `${t("tree-context-menu.open-in-a-new-tab")} <kbd>Ctrl+Click</kbd>`, command: "openInTab", uiIcon: "bx bx-link-external", enabled: noSelectedNotes },
{ title: `${t("tree-context-menu.open-in-a-new-tab")}`, command: "openInTab", uiIcon: "bx bx-link-external", enabled: noSelectedNotes },

{ title: t("tree-context-menu.open-in-a-new-split"), command: "openNoteInSplit", uiIcon: "bx bx-dock-right", enabled: noSelectedNotes },

Expand Down
2 changes: 1 addition & 1 deletion src/public/app/widgets/dialogs/add_link.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const TPL = `
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">${t('add_link.add_link')} <kbd>enter</kbd></button>
<button type="submit" class="btn btn-primary">${t('add_link.button_add_link')}</button>
</div>
</form>
</div>
Expand Down
14 changes: 7 additions & 7 deletions src/public/app/widgets/dialogs/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ const TPL = `
<p class="card-text">
<ul>
<li><kbd>UP</kbd>, <kbd>DOWN</kbd> - ${t('help.goUpDown')}</li>
<li><kbd>LEFT</kbd>, <kbd>RIGHT</kbd> - ${t('help.collapseExpand')}</li>
<li>${t('help.goUpDown')}</li>
<li>${t('help.collapseExpand')}</li>
<li><kbd data-command="backInNoteHistory">${t('help.notSet')}</kbd>, <kbd data-command="forwardInNoteHistory">${t('help.notSet')}</kbd> - ${t('help.goBackForwards')}</li>
<li><kbd data-command="jumpToNote">${t('help.notSet')}</kbd> - ${t('help.showJumpToNoteDialog')}</li>
<li><kbd data-command="scrollToActiveNote">${t('help.notSet')}</kbd> - ${t('help.scrollToActiveNote')}</li>
<li><kbd>Backspace</kbd> - ${t('help.jumpToParentNote')}</li>
<li>${t('help.jumpToParentNote')}</li>
<li><kbd data-command="collapseTree">${t('help.notSet')}</kbd> - ${t('help.collapseWholeTree')}</li>
<li><kbd data-command="collapseSubtree">${t('help.notSet')}</kbd> - ${t('help.collapseSubTree')}</li>
</ul>
Expand All @@ -37,7 +37,7 @@ const TPL = `
<p class="card-text">
<ul>
<li><kbd>CTRL+click</kbd> ${t('help.newTabNoteLink')}</li>
<li>${t('help.newTabNoteLink')}</li>
</ul>
${t('help.onlyInDesktop')}:
Expand Down Expand Up @@ -75,7 +75,7 @@ const TPL = `
<li><kbd data-command="moveNoteUpInHierarchy">${t('help.notSet')}</kbd>, <kbd data-command="moveNoteDownInHierarchy">${t('help.notSet')}</kbd> - ${t('help.moveNoteUpHierarchy')}</li>
<li><kbd data-command="addNoteAboveToSelection">${t('help.notSet')}</kbd>, <kbd data-command="addNoteBelowToSelection">${t('help.notSet')}</kbd> - ${t('help.multiSelectNote')}</li>
<li><kbd data-command="selectAllNotesInParent">${t('help.notSet')}</kbd> - ${t('help.selectAllNotes')}</li>
<li><kbd>Shift+click</kbd> - ${t('help.selectNote')}</li>
<li>${t('help.selectNote')}</li>
<li><kbd data-command="copyNotesToClipboard">${t('help.notSet')}</kbd> - ${t('help.copyNotes')}</li>
<li><kbd data-command="cutNotesToClipboard">${t('help.notSet')}</kbd> - ${t('help.cutNotes')}</li>
<li><kbd data-command="pasteNotesFromClipboard">${t('help.notSet')}</kbd> - ${t('help.pasteNotes')}</li>
Expand All @@ -92,7 +92,7 @@ const TPL = `
<p class="card-text">
<ul>
<li><kbd data-command="editNoteTitle">${t('help.notSet')}</kbd> ${t('help.editNoteTitle')}</li>
<li><kbd>Ctrl+K</kbd> - ${t('help.createEditLink')}</li>
<li>${t('help.createEditLink')}</li>
<li><kbd data-command="addLinkToText">${t('help.notSet')}</kbd> - ${t('help.createInternalLink')}</li>
<li><kbd data-command="followLinkUnderCursor">${t('help.notSet')}</kbd> - ${t('help.followLink')}</li>
<li><kbd data-command="insertDateTimeToText">${t('help.notSet')}</kbd> - ${t('help.insertDateTime')}</li>
Expand All @@ -108,7 +108,7 @@ const TPL = `
<p class="card-text">
<ul>
<li><kbd>##</kbd>, <kbd>###</kbd>, <kbd>####</kbd> ${t('help.headings')}</li>
<li>${t('help.headings')}</li>
<li>${t('help.bulletList')}</li>
<li>${t('help.numberedList')}</li>
<li>${t('help.blockQuote')}</li>
Expand Down
2 changes: 1 addition & 1 deletion src/public/app/widgets/dialogs/include_note.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const TPL = `
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">${t('include_note.button_include')} <kbd>enter</kbd></button>
<button type="submit" class="btn btn-primary">${t('include_note.button_include')}</button>
</div>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/public/app/widgets/dialogs/sort_child_notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const TPL = `<div class="sort-child-notes-dialog modal mx-auto" tabindex="-1" ro
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">${t("sort_child_notes.sort")} <kbd>enter</kbd></button>
<button type="submit" class="btn btn-primary">${t("sort_child_notes.sort")}</button>
</div>
</form>
</div>
Expand Down
4 changes: 1 addition & 3 deletions src/public/app/widgets/ribbon_widgets/search_definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ const TPL = `
<div style="display: flex; justify-content: space-evenly">
<button type="button" class="btn btn-sm search-button">
<span class="bx bx-search"></span>
${t('search_definition.search')}
<kbd>${t('search_definition.enter')}</kbd>
${t('search_definition.search_button')}
</button>
<button type="button" class="btn btn-sm search-and-execute-button">
Expand Down
2 changes: 1 addition & 1 deletion src/public/app/widgets/type_widgets/protected_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const TPL = `
<input class="protected-session-password-in-detail form-control protected-session-password" type="password">
</div>
<button class="btn btn-primary">${t('protected_session.start_session_button')} <kbd>enter</kbd></button>
<button class="btn btn-primary">${t('protected_session.start_session_button')}</button>
</form>
</div>`;

Expand Down
30 changes: 15 additions & 15 deletions src/public/translations/cn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"search_note": "按名称搜索笔记",
"link_title_mirrors": "链接标题跟随笔记标题变化",
"link_title_arbitrary": "链接标题可随意修改",
"link_title": "链接标题"
"link_title": "链接标题",
"button_add_link": "添加链接 <kbd>回车</kbd>"
},
"branch_prefix": {
"edit_branch_prefix": "编辑分支前缀",
Expand Down Expand Up @@ -109,17 +110,17 @@
"fullDocumentation": "帮助(完整<a class=\"external\" href=\"https://triliumnext.github.io/Docs/\">在线文档</a>)",
"close": "关闭",
"noteNavigation": "笔记导航",
"goUpDown": "在笔记列表中向上/向下移动",
"collapseExpand": "折叠/展开节点",
"goUpDown": "<kbd>UP</kbd>, <kbd>DOWN</kbd> - 在笔记列表中向上/向下移动",
"collapseExpand": "<kbd>LEFT</kbd>, <kbd>RIGHT</kbd> - 折叠/展开节点",
"notSet": "未设置",
"goBackForwards": "在历史记录中前后移动",
"showJumpToNoteDialog": "显示<a class=\"external\" href=\"https://triliumnext.github.io/Docs/Wiki/note-navigation.html#jump-to-note\">\"跳转到\" 对话框</a>",
"scrollToActiveNote": "滚动到活动笔记",
"jumpToParentNote": "跳转到父笔记",
"jumpToParentNote": "<kbd>Backspace</kbd> - 跳转到父笔记",
"collapseWholeTree": "折叠整个笔记树",
"collapseSubTree": "折叠子树",
"tabShortcuts": "标签快捷键",
"newTabNoteLink": "在笔记链接上使用CTRL+点击(或中键点击)在新标签中打开笔记",
"newTabNoteLink": "<kbd>CTRL+click</kbd> - 在笔记链接上使用CTRL+点击(或中键点击)在新标签中打开笔记",
"onlyInDesktop": "仅在桌面版(电子构建)中",
"openEmptyTab": "打开空白标签页",
"closeActiveTab": "关闭活动标签页",
Expand All @@ -134,20 +135,20 @@
"moveNoteUpHierarchy": "在层级结构中向上移动笔记",
"multiSelectNote": "多选上/下笔记",
"selectAllNotes": "选择当前级别的所有笔记",
"selectNote": "选择笔记",
"selectNote": "<kbd>Shift+click</kbd> - 选择笔记",
"copyNotes": "将活动笔记(或当前选择)复制到剪贴板(用于<a class=\"external\" href=\"https://triliumnext.github.io/Docs/Wiki/cloning-notes.html#cloning-notes\">克隆</a>)",
"cutNotes": "将当前笔记(或当前选择)剪切到剪贴板(用于移动笔记)",
"pasteNotes": "将笔记粘贴为活动笔记的子笔记(根据是复制还是剪切到剪贴板来决定是移动还是克隆)",
"deleteNotes": "删除笔记/子树",
"editingNotes": "编辑笔记",
"editNoteTitle": "在树形笔记树中,焦点会从笔记树切换到笔记标题。按下 Enter 键会将焦点从笔记标题切换到文本编辑器。按下 <kbd>Ctrl+.</kbd> 会将焦点从编辑器切换回笔记树。",
"createEditLink": "创建/编辑外部链接",
"createEditLink": "<kbd>Ctrl+K</kbd> - 创建/编辑外部链接",
"createInternalLink": "创建内部链接",
"followLink": "跟随光标下的链接",
"insertDateTime": "在插入点插入当前日期和时间",
"jumpToTreePane": "跳转到树面板并滚动到活动笔记",
"markdownAutoformat": "类Markdown自动格式化",
"headings": " 等,后跟空格,自动转换为标题",
"headings": "<kbd>##</kbd>, <kbd>###</kbd>, <kbd>####</kbd> 等,后跟空格,自动转换为标题",
"bulletList": "<kbd>*</kbd> 或 <kbd>-</kbd> 后跟空格,自动转换为项目符号列表",
"numberedList": "<kbd>1.</kbd> or <kbd>1)</kbd> 后跟空格,自动转换为编号列表",
"blockQuote": "一行以 <kbd>></kbd> 开头并后跟空格,自动转换为块引用",
Expand Down Expand Up @@ -185,7 +186,7 @@
"box_size_small": "小型 (显示大约10行)",
"box_size_medium": "中型 (显示大约30行)",
"box_size_full": "完整显示(完整文本框)",
"button_include": "包含笔记"
"button_include": "包含笔记 <kbd>回车</kbd>"
},
"info": {
"modalTitle": "信息消息",
Expand Down Expand Up @@ -280,7 +281,7 @@
"sort_with_respect_to_different_character_sorting": "根据不同语言或地区的字符排序和排序规则排序。",
"natural_sort_language": "自然排序语言",
"the_language_code_for_natural_sort": "自然排序的语言代码,例如中文的 \"zh-CN\"",
"sort": "排序"
"sort": "排序 <kbd>Enter</kbd>"
},
"upload_attachments": {
"upload_attachments_to_note": "上传附件到笔记",
Expand Down Expand Up @@ -816,8 +817,7 @@
"debug": "调试",
"debug_description": "调试将打印额外的调试信息到控制台,以帮助调试复杂查询",
"action": "操作",
"search": "搜索",
"enter": "输入",
"search_button": "搜索 <kbd>回车</kbd>",
"search_execute": "搜索并执行操作",
"save_to_note": "保存到笔记",
"search_parameters": "搜索参数",
Expand Down Expand Up @@ -1315,7 +1315,7 @@
"button-tree-map": "树形地图"
},
"tree-context-menu": {
"open-in-a-new-tab": "在新标签页中打开",
"open-in-a-new-tab": "在新标签页中打开 <kbd>Ctrl+Click</kbd>",
"open-in-a-new-split": "在新分栏中打开",
"insert-note-after": "在后面插入笔记",
"insert-child-note": "插入子笔记",
Expand Down Expand Up @@ -1510,11 +1510,11 @@
"add-script-launcher": "添加脚本启动器",
"add-custom-widget": "添加自定义小部件",
"add-spacer": "添加间隔",
"delete": "删除",
"delete": "删除 <kbd data-command=\"deleteNotes\"></kbd>",
"reset": "重置",
"move-to-visible-launchers": "移动到可见启动器",
"move-to-available-launchers": "移动到可用启动器",
"duplicate-launcher": "复制启动器"
"duplicate-launcher": "复制启动器 <kbd data-command=\"duplicateSubtree\">"
},
"editable-text": {
"auto-detect-language": "自动检测"
Expand Down
Loading

0 comments on commit 42c6c44

Please sign in to comment.