mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(i18n): default interface language to english
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { DEFAULT_INTERFACE_LANGUAGE, INTERFACE_LANGUAGE_STORAGE_KEY } from '../constants';
|
||||
|
||||
const testState = vi.hoisted(() => {
|
||||
const i18next = {
|
||||
@@ -47,10 +48,15 @@ describe('init-translations', () => {
|
||||
expect(testState.i18next.use).toHaveBeenNthCalledWith(3, testState.reactPlugin);
|
||||
expect(testState.i18next.init).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
fallbackLng: 'en',
|
||||
fallbackLng: DEFAULT_INTERFACE_LANGUAGE,
|
||||
ns: ['default'],
|
||||
defaultNS: 'default',
|
||||
backend: { loadPath: './translations/{{lng}}/{{ns}}.json' },
|
||||
detection: {
|
||||
order: ['localStorage'],
|
||||
caches: ['localStorage'],
|
||||
lookupLocalStorage: INTERFACE_LANGUAGE_STORAGE_KEY,
|
||||
},
|
||||
}),
|
||||
);
|
||||
expect(testState.i18next.init.mock.calls[0]?.[0]?.supportedLngs).toContain('en');
|
||||
|
||||
Reference in New Issue
Block a user