mirror of
https://github.com/MCSManager/MCSManager.git
synced 2025-03-07 16:26:45 +08:00
feat: i18n code
This commit is contained in:
parent
ec2963e29d
commit
31d7637d67
@ -55,7 +55,7 @@ const cancel = async () => {
|
||||
const submit = async () => {
|
||||
try {
|
||||
await saveTags();
|
||||
message.success(t("保存成功"));
|
||||
message.success(t("TXT_CODE_a7907771"));
|
||||
await cancel();
|
||||
} catch (error) {
|
||||
reportErrorMsg(error);
|
||||
@ -76,7 +76,7 @@ defineExpose({ openDialog });
|
||||
<AppConfigProvider>
|
||||
<a-modal
|
||||
v-model:open="open"
|
||||
:title="t('实例标签')"
|
||||
:title="t('TXT_CODE_a2544278')"
|
||||
centered
|
||||
:confirm-loading="saveLoading"
|
||||
@ok="submit"
|
||||
@ -88,7 +88,7 @@ defineExpose({ openDialog });
|
||||
<a-typography-text type="secondary">
|
||||
{{
|
||||
t(
|
||||
"实例拥有标签之后,MCSManager 在显示这些实例时,将自动按照标签名字对实例进行分类供用户筛选,标签名字支持任何语言。"
|
||||
"TXT_CODE_f84ae54f"
|
||||
)
|
||||
}}
|
||||
</a-typography-text>
|
||||
@ -96,12 +96,12 @@ defineExpose({ openDialog });
|
||||
<div>
|
||||
<a-typography-paragraph>
|
||||
<a-typography-text>
|
||||
{{ t("此实例的标签列表") }}
|
||||
{{ t("TXT_CODE_2c1337d") }}
|
||||
</a-typography-text>
|
||||
</a-typography-paragraph>
|
||||
<a-typography-paragraph>
|
||||
<a-typography-text type="secondary">
|
||||
{{ t("请勿创建过多新标签,这可能会导致界面上元素混乱和面板性能下降。") }}
|
||||
{{ t("TXT_CODE_e26d53d5") }}
|
||||
</a-typography-text>
|
||||
</a-typography-paragraph>
|
||||
<div class="tag-container">
|
||||
@ -128,7 +128,7 @@ defineExpose({ openDialog });
|
||||
/>
|
||||
<a-tag v-else class="m-4 my-tag" style="border-style: dashed" @click="showInput">
|
||||
<plus-outlined />
|
||||
{{ t("新标签") }}
|
||||
{{ t("TXT_CODE_3dd66d98") }}
|
||||
</a-tag>
|
||||
</div>
|
||||
</div>
|
||||
@ -136,14 +136,14 @@ defineExpose({ openDialog });
|
||||
<div v-if="instanceTagsTips?.length > 0" class="mt-20">
|
||||
<a-typography-paragraph>
|
||||
<a-typography-text>
|
||||
{{ t("部分可选标签") }}
|
||||
{{ t("TXT_CODE_67d1ea21") }}
|
||||
</a-typography-text>
|
||||
</a-typography-paragraph>
|
||||
<a-typography-paragraph>
|
||||
<a-typography-text type="secondary">
|
||||
{{
|
||||
t(
|
||||
"这些可选择的标签由当前页实例列表计算而来,并不包含所有已存在的标签,此处最多展示 30 个"
|
||||
"TXT_CODE_3ecee271"
|
||||
)
|
||||
}}
|
||||
</a-typography-text>
|
||||
|
@ -461,7 +461,7 @@ onMounted(async () => {
|
||||
<a-col :span="24">
|
||||
<div v-if="tagTips && tagTips?.length > 0" class="instances-tag-container">
|
||||
<a-tag v-if="selectedTags.length > 0" color="red" class="my-tag" @click="clearTags">
|
||||
{{ t("清空") }}
|
||||
{{ t("TXT_CODE_7333c7f7") }}
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-for="item in tagTips"
|
||||
|
@ -139,8 +139,8 @@ const instanceOperations = computed(() =>
|
||||
click: (event: MouseEvent) => {
|
||||
event.stopPropagation();
|
||||
Modal.confirm({
|
||||
title: t("二次确认"),
|
||||
content: t("确定向实例发出关闭指令吗?"),
|
||||
title: t("TXT_CODE_893567ac"),
|
||||
content: t("TXT_CODE_6da85509"),
|
||||
onOk: async () => {
|
||||
execInstanceAction(event, "stop");
|
||||
}
|
||||
@ -157,8 +157,8 @@ const instanceOperations = computed(() =>
|
||||
click: async (event: MouseEvent) => {
|
||||
event.stopPropagation();
|
||||
Modal.confirm({
|
||||
title: t("二次确认"),
|
||||
content: t("确定重启实例吗?"),
|
||||
title: t("TXT_CODE_893567ac"),
|
||||
content: t("TXT_CODE_f6bd907d"),
|
||||
onOk: async () => {
|
||||
execInstanceAction(event, "restart");
|
||||
}
|
||||
@ -185,8 +185,8 @@ const instanceOperations = computed(() =>
|
||||
click: async (event: MouseEvent) => {
|
||||
event.stopPropagation();
|
||||
Modal.confirm({
|
||||
title: t("二次确认"),
|
||||
content: t("确认强制终止运行实例吗?这可能会造成实例数据损坏。"),
|
||||
title: t("TXT_CODE_893567ac"),
|
||||
content: t("TXT_CODE_ec08484"),
|
||||
onOk: async () => {
|
||||
execInstanceAction(event, "kill");
|
||||
}
|
||||
@ -200,7 +200,7 @@ const instanceOperations = computed(() =>
|
||||
area: true
|
||||
},
|
||||
{
|
||||
title: t("标签分组"),
|
||||
title: t("TXT_CODE_78e88c3f"),
|
||||
icon: TagsOutlined,
|
||||
click: async (event: MouseEvent) => {
|
||||
event.stopPropagation();
|
||||
|
@ -1928,5 +1928,20 @@
|
||||
"TXT_CODE_b52cb76c": "Please select network mode",
|
||||
"TXT_CODE_2ab036a4": "Please enter the game server port",
|
||||
"TXT_CODE_c5b38d90": "The instance specifications for renewal do not match, and the renewal operation cannot be completed!",
|
||||
"TXT_CODE_13411df7": "SSO login failed, please return to the original page and try to log in again!"
|
||||
"TXT_CODE_13411df7": "SSO login failed, please return to the original page and try to log in again!",
|
||||
"TXT_CODE_a2544278": "Instance tag",
|
||||
"TXT_CODE_f84ae54f": "After an instance has a tag, MCSManager will automatically classify the instance by tag name for users to filter when displaying these instances. Tag names support any language.",
|
||||
"TXT_CODE_2c1337d": "Tag list of this instance",
|
||||
"TXT_CODE_e26d53d5": "Do not create too many new tags, which may cause confusion of elements on the interface and degrade panel performance.",
|
||||
"TXT_CODE_3dd66d98": "New tag",
|
||||
"TXT_CODE_67d1ea21": "Some optional tags",
|
||||
"TXT_CODE_3ecee271": "These selectable tags are calculated from the instance list of the current page and do not include all existing tags. A maximum of 30 are displayed here",
|
||||
"TXT_CODE_893567ac": "Second confirmation",
|
||||
"TXT_CODE_6da85509": "Are you sure you want to send a shutdown command to the instance?",
|
||||
"TXT_CODE_f6bd907d": "Are you sure you want to restart the instance?",
|
||||
"TXT_CODE_ec08484": "Are you sure you want to forcefully terminate the running instance? This may cause instance data corruption.",
|
||||
"TXT_CODE_78e88c3f": "Tag grouping",
|
||||
"TXT_CODE_7333c7f7": "Clear",
|
||||
"TXT_CODE_6d8bc58d": "Failed to save. A single tag only supports up to 9 characters!",
|
||||
"TXT_CODE_dc9fb6ce": "Failed to save. A single instance only supports up to 6 tags!"
|
||||
}
|
||||
|
@ -1928,5 +1928,20 @@
|
||||
"TXT_CODE_b52cb76c": "请选择网络模式",
|
||||
"TXT_CODE_2ab036a4": "请输入游戏服务器端口",
|
||||
"TXT_CODE_c5b38d90": "续费的实例规格不匹配,无法完成续费操作!",
|
||||
"TXT_CODE_13411df7": "SSO 登录失败,请重新回到原页面尝试重新跳转登录!"
|
||||
"TXT_CODE_13411df7": "SSO 登录失败,请重新回到原页面尝试重新跳转登录!",
|
||||
"TXT_CODE_a2544278": "实例标签",
|
||||
"TXT_CODE_f84ae54f": "实例拥有标签之后,MCSManager 在显示这些实例时,将自动按照标签名字对实例进行分类供用户筛选,标签名字支持任何语言。",
|
||||
"TXT_CODE_2c1337d": "此实例的标签列表",
|
||||
"TXT_CODE_e26d53d5": "请勿创建过多新标签,这可能会导致界面上元素混乱和面板性能下降。",
|
||||
"TXT_CODE_3dd66d98": "新标签",
|
||||
"TXT_CODE_67d1ea21": "部分可选标签",
|
||||
"TXT_CODE_3ecee271": "这些可选择的标签由当前页实例列表计算而来,并不包含所有已存在的标签,此处最多展示 30 个",
|
||||
"TXT_CODE_893567ac": "二次确认",
|
||||
"TXT_CODE_6da85509": "确定向实例发出关闭指令吗?",
|
||||
"TXT_CODE_f6bd907d": "确定重启实例吗?",
|
||||
"TXT_CODE_ec08484": "确认强制终止运行实例吗?这可能会造成实例数据损坏。",
|
||||
"TXT_CODE_78e88c3f": "标签分组",
|
||||
"TXT_CODE_7333c7f7": "清空",
|
||||
"TXT_CODE_6d8bc58d": "保存失败,单个标签最多只支持9个字符!",
|
||||
"TXT_CODE_dc9fb6ce": "保存失败,单个实例最多只支持6个标签!"
|
||||
}
|
||||
|
@ -375,11 +375,11 @@ router.put(
|
||||
if (config.tag instanceof Array && isTopPermissionByUuid(getUserUuid(ctx))) {
|
||||
instanceTags = (config.tag as any[]).map((tag: any) => {
|
||||
const tmp = String(tag).trim();
|
||||
if (tmp.length > 9) throw new Error($t("保存失败,单个标签最多只支持9个字符!"));
|
||||
if (tmp.length > 9) throw new Error($t("TXT_CODE_6d8bc58d"));
|
||||
return tmp;
|
||||
});
|
||||
if (instanceTags.length > 6) {
|
||||
throw new Error($t("保存失败,单个实例最多只支持6个标签!"));
|
||||
throw new Error($t("TXT_CODE_dc9fb6ce"));
|
||||
}
|
||||
instanceTags = instanceTags!.sort((a, b) => (a > b ? 1 : -1));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user