mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
fix(i18n): complete Simplified Chinese core and plugin translations (#1542)
* fix(i18n): complete Chinese onboarding and navigation labels * fix(i18n): translate remaining Chinese core and plugin interfaces * fix(i18n): translate host editor tab overflow controls * fix(i18n): use consistent Chinese fleet terminology * fix(i18n): localize hardcoded controls and plugin views * fix(i18n): translate built-in homepage widget catalog * test(homepage): follow translated timezone placeholder * fix(i18n): translate plugin-provided homepage widgets * fix(i18n): localize feature settings section titles
This commit is contained in:
1 parent
13f5736d8f
commit
0214a81e5d
78 files changed
+2423
-1833
No files matched your search
@@ -23,8 +23,15 @@ vi.mock("@/api/plugins-api", async (importOriginal) => ({
|
||||
}));
|
||||
|
||||
vi.mock("react-i18next", () => {
|
||||
const t = (key: string, options?: { name?: string }) =>
|
||||
options?.name ? `${key}:${options.name}` : key;
|
||||
const t = (
|
||||
key: string,
|
||||
options?: { name?: string; defaultValue?: string },
|
||||
) =>
|
||||
key === "ai:plugin.name"
|
||||
? "AI 助手"
|
||||
: options?.name
|
||||
? `${key}:${options.name}`
|
||||
: (options?.defaultValue ?? key);
|
||||
return { useTranslation: () => ({ t }) };
|
||||
});
|
||||
|
||||
@@ -112,10 +119,22 @@ describe("FeatureSettingsSection", () => {
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.getByText("AI Assistant")).toBeTruthy();
|
||||
expect(screen.getByText("AI 助手")).toBeTruthy();
|
||||
expect(api.getPluginUserSettings).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("falls back to the manifest name for plugins without a translated title", () => {
|
||||
render(
|
||||
<FeatureSettingsSection
|
||||
plugin={plugin({ id: "third-party", name: "Custom Feature" })}
|
||||
scope="admin"
|
||||
open={false}
|
||||
onToggle={vi.fn()}
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByText("Custom Feature")).toBeTruthy();
|
||||
});
|
||||
|
||||
it("loads and saves the scope's values once open", async () => {
|
||||
api.getPluginUserSettings.mockResolvedValue({ enabled: false });
|
||||
api.updatePluginUserSettings.mockResolvedValue({ enabled: true });
|
||||
@@ -179,7 +198,7 @@ describe("FeatureSettingsSection", () => {
|
||||
);
|
||||
|
||||
expect(
|
||||
await screen.findByText("settings.featureUnavailable:AI Assistant"),
|
||||
await screen.findByText("settings.featureUnavailable:AI 助手"),
|
||||
).toBeTruthy();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user