feat: added French support

This commit is contained in:
Xiaohan-Tian
2026-05-30 23:37:51 -07:00
parent 4c82f514d7
commit e263b1cc41
25 changed files with 862 additions and 29 deletions
+8 -1
View File
@@ -3,6 +3,7 @@ import { beforeAll, describe, expect, it, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
import ChatBox from './ChatBox';
import { I18nContext } from '../i18n/I18nProvider';
import type { ResolvedLocaleCode } from '../i18n/types';
import { translate } from '../i18n/translate';
vi.mock('./chat', () => ({
@@ -113,7 +114,7 @@ vi.mock('./common/KGDropdown', () => ({
default: () => null,
}));
function renderWithLocale(resolvedLocale: 'en_us' | 'zh_cn') {
function renderWithLocale(resolvedLocale: ResolvedLocaleCode) {
return render(
<I18nContext.Provider
value={{
@@ -144,4 +145,10 @@ describe('ChatBox', () => {
expect(screen.getByRole('heading', { level: 3, name: 'K.G.Studio 音乐创作助手' })).toBeTruthy();
});
it('renders the French assistant title under fr_fr', () => {
renderWithLocale('fr_fr');
expect(screen.getByRole('heading', { level: 3, name: 'Assistant musical K.G.Studio' })).toBeTruthy();
});
});