feat: i18n code

This commit is contained in:
YuMao 2024-12-01 12:17:42 +08:00
parent 5fd3564b47
commit e521258b9d
5 changed files with 29 additions and 13 deletions

View File

@ -231,7 +231,7 @@ const instanceOperations = computed(() =>
disabled: containerState.isDesignMode disabled: containerState.isDesignMode
}, },
{ {
title: t("删除实例"), title: t("TXT_CODE_a0e19f38"),
icon: DeleteOutlined, icon: DeleteOutlined,
click: async (event: MouseEvent) => { click: async (event: MouseEvent) => {
event.stopPropagation(); event.stopPropagation();
@ -240,7 +240,7 @@ const instanceOperations = computed(() =>
daemonId || "" daemonId || ""
); );
if (!deleteInstanceResult) return; if (!deleteInstanceResult) return;
message.success(t("实例删除成功")); message.success(t("TXT_CODE_f486dbb4"));
refreshList(); refreshList();
}, },
danger: true, danger: true,

View File

@ -49,9 +49,9 @@ const onCancel = () => {
const onDelete = async () => { const onDelete = async () => {
if (!deleteFiles.value) return await submit(); if (!deleteFiles.value) return await submit();
Modal.confirm({ Modal.confirm({
title: t("删除实例及相关文件"), title: t("TXT_CODE_584d786d"),
content: t("该操作会直接删除实例所在的整个目录,且文件无法恢复,是否继续?"), content: t("TXT_CODE_90508729"),
okText: t("确认删除"), okText: t("TXT_CODE_10088738"),
onOk: async () => { onOk: async () => {
await submit(); await submit();
Modal.destroyAll(); Modal.destroyAll();
@ -62,20 +62,20 @@ const onDelete = async () => {
</script> </script>
<template> <template>
<a-modal :visible="isOpen" :title="t('删除实例')" @cancel="onCancel"> <a-modal :visible="isOpen" :title="t('TXT_CODE_a0e19f38')" @cancel="onCancel">
<a-typography-paragraph> <a-typography-paragraph>
<a-typography-text> <a-typography-text>
{{ t("若选择同时删除实例相关文件,则会直接删除实例所在的整个目录。") }} {{ t("TXT_CODE_1981470a") }}
</a-typography-text> </a-typography-text>
</a-typography-paragraph> </a-typography-paragraph>
<a-checkbox v-model:checked="deleteFiles"> <a-checkbox v-model:checked="deleteFiles">
{{ t("同时删除实例相关文件") }} {{ t("TXT_CODE_7542201a") }}
</a-checkbox> </a-checkbox>
<template #footer> <template #footer>
<a-button key="back" @click="onCancel"> <a-button key="back" @click="onCancel">
{{ t("取消") }} {{ t("TXT_CODE_a0451c97") }}
</a-button> </a-button>
<a-button <a-button
key="submit" key="submit"
@ -84,7 +84,7 @@ const onDelete = async () => {
type="primary" type="primary"
@click="onDelete" @click="onDelete"
> >
{{ deleteFiles ? t("删除实例及相关文件") : t("删除实例") }} {{ deleteFiles ? t("TXT_CODE_584d786d") : t("TXT_CODE_a0e19f38") }}
</a-button> </a-button>
</template> </template>
</a-modal> </a-modal>

View File

@ -2011,5 +2011,13 @@
"TXT_CODE_60dd05d5": "Override default image working directory with data storage directory", "TXT_CODE_60dd05d5": "Override default image working directory with data storage directory",
"TXT_CODE_d9c73520": "Mount additional directories", "TXT_CODE_d9c73520": "Mount additional directories",
"TXT_CODE_3407250a": "Mount host instance directory to container for data persistence", "TXT_CODE_3407250a": "Mount host instance directory to container for data persistence",
"TXT_CODE_d4ad1dd": "Optional. Uses image default command if empty, otherwise runs specified command" "TXT_CODE_d4ad1dd": "Optional. Uses image default command if empty, otherwise runs specified command",
"TXT_CODE_584d786d": "Delete instance and related files",
"TXT_CODE_90508729": "This operation will directly delete the entire directory where the instance is located, and the files cannot be recovered. Do you want to continue?",
"TXT_CODE_10088738": "Confirm deletion",
"TXT_CODE_a0e19f38": "Delete instance",
"TXT_CODE_1981470a": "If you choose to delete the instance-related files at the same time, the entire directory where the instance is located will be directly deleted.",
"TXT_CODE_7542201a": "Delete instance-related files simultaneously",
"TXT_CODE_f486dbb4": "Instance deleted successfully",
"TXT_CODE_ed81f72d": "This instance was not purchased from the store and cannot be renewed. Please contact the merchant for processing!"
} }

View File

@ -2011,5 +2011,13 @@
"TXT_CODE_60dd05d5": "启动容器时,将自动忽略镜像默认的工作目录,强制切换到当前目录到“数据储存目录”", "TXT_CODE_60dd05d5": "启动容器时,将自动忽略镜像默认的工作目录,强制切换到当前目录到“数据储存目录”",
"TXT_CODE_d9c73520": "挂载更多目录", "TXT_CODE_d9c73520": "挂载更多目录",
"TXT_CODE_3407250a": "设置后,将挂载宿主机的实例工作目录到容器中,以实现数据持久化", "TXT_CODE_3407250a": "设置后,将挂载宿主机的实例工作目录到容器中,以实现数据持久化",
"TXT_CODE_d4ad1dd": "可选,如果不填写,则使用镜像自带的启动命令;如果填写启动命令,则会在容器运行时启动。" "TXT_CODE_d4ad1dd": "可选,如果不填写,则使用镜像自带的启动命令;如果填写启动命令,则会在容器运行时启动。",
"TXT_CODE_584d786d": "删除实例及相关文件",
"TXT_CODE_90508729": "该操作会直接删除实例所在的整个目录,且文件无法恢复,是否继续?",
"TXT_CODE_10088738": "确认删除",
"TXT_CODE_a0e19f38": "删除实例",
"TXT_CODE_1981470a": "若选择同时删除实例相关文件,则会直接删除实例所在的整个目录。",
"TXT_CODE_7542201a": "同时删除实例相关文件",
"TXT_CODE_f486dbb4": "实例删除成功",
"TXT_CODE_ed81f72d": "此实例并不是从商店购买的,无法进行续费,请联系商家处理!"
} }

View File

@ -187,7 +187,7 @@ export async function buyOrRenewInstance(
const config: IGlobalInstanceConfig = instanceInfo.config || {}; const config: IGlobalInstanceConfig = instanceInfo.config || {};
if (!config.category || isNaN(Number(config.category))) { if (!config.category || isNaN(Number(config.category))) {
throw new Error(t("此实例并不是从商店购买的,无法进行续费,请联系商家处理!")); throw new Error(t("TXT_CODE_ed81f72d"));
} }
if (config.category !== Number(params.category_id)) { if (config.category !== Number(params.category_id)) {