diff --git a/app/commands/command.js b/app/commands/command.js index d17c933f..825d949d 100644 --- a/app/commands/command.js +++ b/app/commands/command.js @@ -2,6 +2,7 @@ import { COMMAND_ACTIVATE, COMMAND_COMMAND, COMMAND_DEACTIVATE, COMMAND_DEPLOY, COMMAND_DOC, COMMAND_VERSION, } from '../../constants/command.js'; import { SETTING_AI_ACTIVATED } from '../../constants/setting.js'; +import { t } from '../../languages/index.js'; import storage from '../../storage/index.js'; import { MessageAction } from '../actions/index.js'; import Context from '../context.js'; @@ -18,15 +19,12 @@ const isCommand = (context) => context.isCommand(COMMAND_COMMAND); */ const execCommandCommand = async (context) => { const buttons = [ - new MessageAction(COMMAND_DOC), new MessageAction(COMMAND_VERSION), - new MessageAction(COMMAND_COMMAND), - ]; - const actions = [ + new MessageAction(COMMAND_DOC), new MessageAction(await storage.getItem(SETTING_AI_ACTIVATED) ? COMMAND_DEACTIVATE : COMMAND_ACTIVATE), - new MessageAction(COMMAND_DEPLOY), + new MessageAction(COMMAND_COMMAND), ]; - context.pushTemplate(COMMAND_COMMAND.label, buttons, actions); + context.pushTemplate(t('__TEMPLATE_TITLE_COMMAND'), buttons); return context; }; diff --git a/languages/en.js b/languages/en.js index e2cd1502..690902a5 100644 --- a/languages/en.js +++ b/languages/en.js @@ -23,6 +23,7 @@ const en = { __COMMAND_RESTART_REPLY: 'Restarting', __COMMAND_VERSION_LABEL: 'Version', __COMMAND_VERSION_TEXT: 'Version', + __TEMPLATE_TITLE_COMMAND: 'Commands', __COMPLETION_INIT_MESSAGE: 'Hello!', }; diff --git a/languages/ja.js b/languages/ja.js index 23637bea..6ea7a61b 100644 --- a/languages/ja.js +++ b/languages/ja.js @@ -23,6 +23,7 @@ const ja = { __COMMAND_RESTART_REPLY: '再起動しています', __COMMAND_VERSION_LABEL: 'バージョン', __COMMAND_VERSION_TEXT: 'バージョン', + __TEMPLATE_TITLE_COMMAND: 'コマンド', __COMPLETION_INIT_MESSAGE: 'こんにちは!', }; diff --git a/languages/zh.js b/languages/zh.js index c9b0a181..8f3458d3 100644 --- a/languages/zh.js +++ b/languages/zh.js @@ -10,19 +10,20 @@ const zh = { __COMMAND_CONFIGURE_LABEL: '設置', __COMMAND_CONFIGURE_TEXT: '設置', __COMMAND_CONFIGURE_REPLY: '已設置', - __COMMAND_COMMAND_LABEL: '指令', + __COMMAND_COMMAND_LABEL: '查看指令', __COMMAND_COMMAND_TEXT: '指令', __COMMAND_CONTINUE_LABEL: '繼續', __COMMAND_CONTINUE_TEXT: '繼續', - __COMMAND_DOC_LABEL: '文件', + __COMMAND_DOC_LABEL: '查看文件', __COMMAND_DOC_TEXT: '文件', __COMMAND_DRAW_LABEL: '請畫', __COMMAND_DRAW_TEXT: '請畫', __COMMAND_RESTART_LABEL: '重新啟動', __COMMAND_RESTART_TEXT: '重新啟動', __COMMAND_RESTART_REPLY: '正在重新啟動', - __COMMAND_VERSION_LABEL: '版本', + __COMMAND_VERSION_LABEL: '查看版本', __COMMAND_VERSION_TEXT: '版本', + __TEMPLATE_TITLE_COMMAND: '指令', __COMPLETION_INIT_MESSAGE: '哈囉!', };