refactor: remove LocaleSwitcher component and update locale handling
- Removed LocaleSwitcher from NavUser, SiteHeader, and WorkbenchHeader components. - Updated tests to reflect the removal of LocaleSwitcher. - Changed default locale from "en-US" to "zh-CN" in i18n configuration. - Refactored locale resolution logic to read configured locale without relying on browser language detection. - Updated AgentDesk SDK to support language configuration from public API. - Cleaned up unused auth options fetching in the auth API.
This commit is contained in:
@@ -5,10 +5,10 @@ import { describe, it } from "node:test";
|
||||
const source = await readFile(new URL("./site-header.tsx", import.meta.url), "utf8");
|
||||
|
||||
describe("site header preferences", () => {
|
||||
it("renders locale, palette, and theme controls in the dashboard header", () => {
|
||||
assert.match(source, /import \{ LocaleSwitcher \} from "@\/components\/locale-switcher"/);
|
||||
it("renders palette and theme controls without a locale switcher", () => {
|
||||
assert.doesNotMatch(source, /LocaleSwitcher/);
|
||||
assert.match(source, /import \{ PaletteToggle \} from "@\/components\/palette-toggle"/);
|
||||
assert.match(source, /import \{ ThemeToggle \} from "@\/components\/theme-toggle"/);
|
||||
assert.match(source, /<LocaleSwitcher \/>[\s\S]*<PaletteToggle \/>[\s\S]*<ThemeToggle \/>/);
|
||||
assert.match(source, /<PaletteToggle \/>[\s\S]*<ThemeToggle \/>/);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user