Skip to content

Commit

Permalink
update i18n for commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Benature committed May 24, 2024
1 parent 8c29d4f commit f5751a0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@
- [feature] command for open settings tab directly

## 3.0.2-beta
## 3.0.5
- [updated] Chinese: command translation and description of Upper/Lower heading level

## 3.0.4
- [PR] #96
- [updated] Chinese description of Upper/Lower heading level

## 3.0.3
- [fix] wrapper did not work in canvas

## 3.0.2
- [update] #93
- [feature] #90
- [feature] #89
Expand Down
6 changes: 3 additions & 3 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default class TextFormat extends Plugin {

this.addCommand({
id: "open-settings",
name: "Open preference settings tab",
name: getString(["command", "open-settings"]),
icon: "bolt",
callback: () => {
// @ts-ignore
Expand Down Expand Up @@ -164,7 +164,7 @@ export default class TextFormat extends Plugin {

this.addCommand({
id: "heading-upper",
name: { "en": "Heading upper", "zh": "调高标题级别", "zh-TW": "標題上升一級" }[lang],
name: getString(["command", "heading-upper"]),
icon: "indent-increase",
editorCallback: (editor: Editor, view: MarkdownView) => {
this.editorTextFormat(editor, view, "heading", { upper: true });
Expand All @@ -178,7 +178,7 @@ export default class TextFormat extends Plugin {
});
this.addCommand({
id: "heading-lower",
name: { "en": "Heading lower", "zh": "调低标题级别", "zh-TW": "標題下降一級" }[lang],
name: getString(["command", "heading-lower"]),
icon: "indent-decrease",
editorCallback: (editor: Editor, view: MarkdownView) => {
this.editorTextFormat(editor, view, "heading", { upper: false });
Expand Down
2 changes: 1 addition & 1 deletion manifest-beta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-text-format",
"name": "Text Format",
"version": "3.0.4",
"version": "3.0.5",
"minAppVersion": "0.9.7",
"description": "Format text such as lowercase/uppercase/capitalize/titlecase, converting order/bullet list, removing redundant spaces/newline characters.",
"author": "Benature",
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-text-format",
"name": "Text Format",
"version": "3.0.4",
"version": "3.0.5",
"minAppVersion": "0.9.7",
"description": "Format text such as lowercase/uppercase/capitalize/titlecase, converting order/bullet list, removing redundant spaces/newline characters.",
"author": "Benature",
Expand Down
8 changes: 7 additions & 1 deletion src/langs/langs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const EN = {
"remove-blank-line": "Remove blank line(s)",
"add-line-break": "Add extra line break between paragraphs",
"split-lines-by-blank": "Split line(s) by blanks",
"heading-upper": "Upper heading level (more #)",
"heading-lower": "Lower heading level (less #)",
"open-settings": "Open preference settings tab",
},
setting: {
"more-details": "More details in Github: ",
Expand Down Expand Up @@ -121,6 +124,9 @@ const ZH = {
"remove-blank-line": "移除空行",
"add-line-break": "在段落间添加额外换行",
"split-lines-by-blank": "按空格分行",
"heading-upper": "降级标题(加 #)",
"heading-lower": "升级标题(减 #)",
"open-settings": "打开插件设置选项卡",
},
setting: {
"more-details": "在 Github 查看更多详情:",
Expand All @@ -133,7 +139,7 @@ const ZH = {
"word-cases-desc": "转换为小写 / 转换为大写 / 标题式大小写 / 单词首字母大写 / 大小写循环切换",
"lowercase-before-capitalize": "在首字母大写之前转换为小写",
"lowercase-before-capitalize-desc": "执行首字母大写或标题式大小写命令前,先将选中文本转换为小写。",
"cycle-case-sequence": "大小写循环序列(单行)",
"cycle-case-sequence": "大小写循环变换(单行)",
"cycle-case-sequence-desc":
"支持以下大小写格式:`lowerCase`、`upperCase`、`capitalizeWord`、`capitalizeSentence`、`titleCase`。\n" +
"注意,在某些情况下,`capitalizeWord`与`titleCase`的效果可能相同," +
Expand Down

0 comments on commit f5751a0

Please sign in to comment.