diff --git a/src/components/settings-v2/account/profile/index.tsx b/src/components/settings-v2/account/profile/index.tsx
index cd269b26e..7ba6d3bfc 100644
--- a/src/components/settings-v2/account/profile/index.tsx
+++ b/src/components/settings-v2/account/profile/index.tsx
@@ -654,7 +654,7 @@ export function ProfileSettings() {
{t("settings.profile.hero.tags", {
- count: tagsCountLabel,
+ count: tags.length,
defaultValue: "标签:{{count}}",
})}
@@ -737,7 +737,7 @@ export function ProfileSettings() {
{extraTagCount > 0 && (
{t("settings.profile.avatar.extraTags", {
- count: extraTagCountLabel,
+ count: extraTagCount,
defaultValue: "+{{count}} 个标签",
})}
@@ -792,7 +792,7 @@ export function ProfileSettings() {
{t("settings.profile.basic.itemCount", {
- count: profileFieldCountLabel,
+ count: profileFields.length,
defaultValue: "{{count}} 项",
})}
@@ -859,7 +859,7 @@ export function ProfileSettings() {
{t("settings.profile.tags.selectedCount", {
- count: tagsCountLabel,
+ count: tags.length,
defaultValue: "{{count}} 个已选",
})}
diff --git a/src/components/settings-v2/account/user-center-session/index.test.tsx b/src/components/settings-v2/account/user-center-session/index.test.tsx
index 17855463b..c595ef728 100644
--- a/src/components/settings-v2/account/user-center-session/index.test.tsx
+++ b/src/components/settings-v2/account/user-center-session/index.test.tsx
@@ -315,7 +315,7 @@ describe("UserCenterSessionSettings", () => {
it("应按当前 locale 格式化会话时间与能力数量", () => {
mockUseTranslation.mockImplementationOnce((_namespace?: string) => ({
i18n: { language: "en-US" },
- t: (key: string, options?: unknown) => {
+ t: vi.fn((key: string, options?: unknown) => {
if (typeof options === "string") {
return options;
}
@@ -330,7 +330,7 @@ describe("UserCenterSessionSettings", () => {
}
return key;
- },
+ }),
}));
mockUseOemCloudAccess.mockReturnValue(
createAccessState({
diff --git a/src/components/workspace/document/editor/slashCommandItems.tsx b/src/components/workspace/document/editor/slashCommandItems.tsx
index fec227c9f..731cace0e 100644
--- a/src/components/workspace/document/editor/slashCommandItems.tsx
+++ b/src/components/workspace/document/editor/slashCommandItems.tsx
@@ -53,7 +53,8 @@ const SLASH_COMMAND_I18N_PREFIX = "workspace.document.editor.slashCommand";
function getWorkspaceTranslator(): WorkspaceTranslator {
const instance = i18next.isInitialized ? i18next : initLimeI18n();
- return (key: string) => String(instance.t(key, { ns: "workspace" }));
+ const t = instance.getFixedT(instance.language, "workspace");
+ return (key: string) => String(t(key as never));
}
function getWorkspaceText(key: string): string {
diff --git a/src/pages/update-notification.test.tsx b/src/pages/update-notification.test.tsx
index 519ffc80d..90766ebd4 100644
--- a/src/pages/update-notification.test.tsx
+++ b/src/pages/update-notification.test.tsx
@@ -143,8 +143,8 @@ describe("UpdateNotificationPage", () => {
let resolveDownload: (() => void) | undefined;
mockDownloadUpdate.mockImplementationOnce(
() =>
- new Promise((resolve) => {
- resolveDownload = resolve;
+ new Promise((resolve) => {
+ resolveDownload = () => resolve(undefined);
}),
);
const container = await renderUpdateNotification(