Skip to content

Commit

Permalink
add translation for ribbon widgets: script_executor.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Nriver committed Aug 6, 2024
1 parent b7809a7 commit a8bb064
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/public/app/widgets/ribbon_widgets/script_executor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import NoteContextAwareWidget from "../note_context_aware_widget.js";
import keyboardActionService from "../../services/keyboard_actions.js";
import { t } from "../../services/i18n.js";

const TPL = `
<div class="script-runner-widget">
Expand Down Expand Up @@ -37,7 +38,7 @@ export default class ScriptExecutorWidget extends NoteContextAwareWidget {
return {
show: this.isEnabled(),
activate: true,
title: this.isTriliumSqlite() ? 'Query' : 'Script',
title: this.isTriliumSqlite() ? t('script_executor.query') : t('script_executor.script'),
icon: 'bx bx-run'
};
}
Expand All @@ -52,7 +53,7 @@ export default class ScriptExecutorWidget extends NoteContextAwareWidget {

async refreshWithNote(note) {
const executeTitle = note.getLabelValue('executeButton')
|| (this.isTriliumSqlite() ? 'Execute Query' : 'Execute Script');
|| (this.isTriliumSqlite() ? t('script_executor.execute_query') : t('script_executor.execute_script'));

this.$executeButton.text(executeTitle);
this.$executeButton.attr('title', executeTitle);
Expand Down
6 changes: 6 additions & 0 deletions src/public/translations/cn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -746,5 +746,11 @@
"unknown_attribute_type": "未知的属性类型 '{{type}}'",
"add_new_attribute": "添加新属性",
"remove_this_attribute": "移除此属性"
},
"script_executor": {
"query": "查询",
"script": "脚本",
"execute_query": "执行查询",
"execute_script": "执行脚本"
}
}
6 changes: 6 additions & 0 deletions src/public/translations/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -747,5 +747,11 @@
"unknown_attribute_type": "Unknown attribute type '{{type}}'",
"add_new_attribute": "Add new attribute",
"remove_this_attribute": "Remove this attribute"
},
"script_executor": {
"query": "Query",
"script": "Script",
"execute_query": "Execute Query",
"execute_script": "Execute Script"
}
}

0 comments on commit a8bb064

Please sign in to comment.