chore: i18n

This commit is contained in:
dap 2024-09-10 08:57:38 +08:00
parent 93f9388f96
commit 29d1e38843
3 changed files with 16 additions and 3 deletions

View File

@ -9,6 +9,7 @@ import { useRouter } from 'vue-router';
import { useAccess } from '@vben/access';
import { DEFAULT_HOME_PATH } from '@vben/constants';
import { useTabs } from '@vben/hooks';
import { $t } from '@vben/locales';
import { message, Select } from 'ant-design-vue';
import { storeToRefs } from 'pinia';
@ -64,7 +65,9 @@ const onSelected: SelectHandler = async (tenantId: string, option: any) => {
}
await tenantDynamicToggle(tenantId);
lastSelected.value = tenantId;
message.success(`切换当前租户为: ${option.companyName}`);
message.success(
`${$t('component.tenantToggle.switch')} ${option.companyName}`,
);
close(true);
// (unknown)
setTimeout(() => dictStore.resetCache());
@ -73,7 +76,7 @@ const onSelected: SelectHandler = async (tenantId: string, option: any) => {
async function onDeselect() {
await tenantDynamicClear();
dictStore.resetCache();
message.success('还原为默认租户');
message.success($t('component.tenantToggle.reset'));
lastSelected.value = '';
close(false);
// (unknown)
@ -97,9 +100,9 @@ function filterOption(input: string, option: TenantOption) {
:field-names="{ label: 'companyName', value: 'tenantId' }"
:filter-option="filterOption"
:options="tenantList"
:placeholder="$t('component.tenantToggle.placeholder')"
allow-clear
class="w-60"
placeholder="选择租户"
show-search
@deselect="onDeselect"
@select="onSelected"

View File

@ -20,6 +20,11 @@
"btn_zoom_in": "Zoom in",
"btn_zoom_out": "Zoom out",
"preview": "Preview"
},
"tenantToggle": {
"placeholder": "Please select a tenant",
"switch": "Switch to tenant: ",
"reset": "Reset to default tenant"
}
},
"pages": {

View File

@ -20,6 +20,11 @@
"btn_zoom_in": "放大",
"btn_zoom_out": "缩小",
"preview": "预览"
},
"tenantToggle": {
"placeholder": "选择租户",
"switch": "切换当前租户为: ",
"reset": "还原为默认租户"
}
},
"pages": {