Skip to content

Commit b35cac3

Browse files
committed
fix: use i18n language instead of browser language in mock getSystemSettings
The mock getSystemSettings() always returned navigator.language (browser locale), ignoring the in-app language toggle. This caused fetchVibeInfo() to override the user's language selection back to the browser default whenever a new app was initialized. Read from i18next.language first so that the app-level language switch is respected, falling back to navigator.language only when i18n has not yet been initialized.
1 parent 91ec4d6 commit b35cac3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/webuiapps/src/lib/vibeContainerMock.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* File operations are delegated to IndexedDB; Actions communicate via a local event bus.
66
*/
77

8+
import i18next from 'i18next';
89
import * as idb from './indexedDbStorage';
910
import { isReportUserActionsEnabled } from './action';
1011

@@ -307,7 +308,7 @@ const mockManager = {
307308

308309
getSystemSettings: (): Promise<SystemSettingsResponse> =>
309310
Promise.resolve({
310-
language: { current: navigator.language, options: ['en', 'zh'] },
311+
language: { current: i18next.language || navigator.language, options: ['en', 'zh'] },
311312
}),
312313
};
313314

0 commit comments

Comments
 (0)