Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions e2e/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ test.describe('Core User Flows', () => {
await expect(page.getByRole('button', { name: /crear nuevo juego|create new game/i })).toBeVisible()
})

test('should support multiple languages including German and Dutch', async ({ page }) => {
test('should support multiple languages including Korean, German, and Dutch', async ({ page }) => {
await page.goto('/')

// Verify language toggle is available (use aria-haspopup to target dropdown trigger specifically)
const languageButton = page.locator('button[aria-haspopup="menu"]').first()
await expect(languageButton).toBeVisible()

// Verify welcome description is visible (use paragraph element to avoid matching button text)
const welcomeDesc = page.locator('p').getByText(/organize|organiza|organisez|organizza|ギフト|轻松|organisieren|organiseer/i)
const welcomeDesc = page.locator('p').getByText(/organize|organiza|organisez|organizza|ギフト|쉽고 재미있게|轻松|organisieren|organiseer/i)
await expect(welcomeDesc).toBeVisible()
})

Expand Down Expand Up @@ -201,6 +201,13 @@ test.describe('Core User Flows', () => {
await enPage.goto('/?lang=en')
await expect(enPage.getByRole('button', { name: /create new game/i })).toBeVisible()
await enContext.close()

// Test Korean
const koContext = await browser.newContext()
const koPage = await koContext.newPage()
await koPage.goto('/?lang=ko')
await expect(koPage.getByRole('button', { name: /새 게임 만들기/i })).toBeVisible()
await koContext.close()
})

test('should navigate directly to guide pages via URL parameter', async ({ page }) => {
Expand Down
22 changes: 11 additions & 11 deletions src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface CreateGameData {
organizerEmail?: string
participants: Array<{ name: string; email?: string; desiredGift: string; wish: string }>
sendEmails?: boolean
language?: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'zh' | 'de' | 'nl'
language?: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'ko' | 'zh' | 'de' | 'nl'
}
Comment on lines +83 to 84
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The language union is duplicated in multiple API payload/signature types in this file, which required updating many call sites just to add ko. To reduce future drift/omissions, consider importing and reusing the Language type from src/lib/types.ts (you already import Game from there) and referencing it here instead of repeating the union.

Copilot uses AI. Check for mistakes.
Comment on lines +83 to 84
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ko is now allowed in the client-side language field, but the backend email pipeline does not support it today. api/src/shared/types.ts’s Language union excludes ko, and several email template generators index translations via translations[language] without a fallback (e.g. api/src/shared/email-service.ts:371), so sending emails while language='ko' will likely throw at runtime and fail game creation / email sends. Either add ko support server-side (types + templates or robust fallback), or avoid sending ko to the API until the backend can safely handle it (e.g., normalize to en for email-related calls).

Copilot uses AI. Check for mistakes.

export interface CreateGameResponse extends Game {
Expand Down Expand Up @@ -128,7 +128,7 @@ export async function updateGameAPI(
code: string,
action: 'requestReassignment',
participantId: string,
language?: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'zh' | 'de' | 'nl'
language?: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'ko' | 'zh' | 'de' | 'nl'
): Promise<Game> {
const response = await fetch(`${API_BASE_URL}/games/${code}`, {
method: 'PATCH',
Expand Down Expand Up @@ -244,7 +244,7 @@ export async function updateWishAPI(
code: string,
participantId: string,
wish: string,
language?: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'zh' | 'de' | 'nl'
language?: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'ko' | 'zh' | 'de' | 'nl'
): Promise<Game> {
const response = await fetch(`${API_BASE_URL}/games/${code}`, {
method: 'PATCH',
Expand All @@ -271,7 +271,7 @@ export async function updateParticipantEmailAPI(
code: string,
participantId: string,
email: string,
language?: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'zh' | 'de' | 'nl'
language?: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'ko' | 'zh' | 'de' | 'nl'
): Promise<Game> {
const response = await fetch(`${API_BASE_URL}/games/${code}`, {
method: 'PATCH',
Expand Down Expand Up @@ -332,7 +332,7 @@ export async function updateParticipantDetailsAPI(
export async function confirmAssignmentAPI(
code: string,
participantId: string,
language?: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'zh' | 'de' | 'nl'
language?: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'ko' | 'zh' | 'de' | 'nl'
): Promise<Game> {
const response = await fetch(`${API_BASE_URL}/games/${code}`, {
method: 'PATCH',
Expand Down Expand Up @@ -546,7 +546,7 @@ export interface SendEmailResponse {
export async function sendOrganizerEmailAPI(
code: string,
organizerToken: string,
language: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'zh' | 'de' | 'nl' = 'es'
language: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'ko' | 'zh' | 'de' | 'nl' = 'es'
): Promise<SendEmailResponse> {
const response = await fetch(`${API_BASE_URL}/email/send`, {
method: 'POST',
Expand Down Expand Up @@ -598,7 +598,7 @@ export async function sendParticipantEmailAPI(
export async function sendAllParticipantEmailsAPI(
code: string,
organizerToken: string,
language: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'zh' | 'de' | 'nl' = 'es'
language: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'ko' | 'zh' | 'de' | 'nl' = 'es'
): Promise<SendEmailResponse> {
const response = await fetch(`${API_BASE_URL}/email/send`, {
method: 'POST',
Expand All @@ -625,7 +625,7 @@ export async function sendReminderEmailAPI(
code: string,
organizerToken: string,
participantId: string,
language: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'zh' | 'de' | 'nl' = 'es',
language: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'ko' | 'zh' | 'de' | 'nl' = 'es',
customMessage?: string
): Promise<SendEmailResponse> {
const response = await fetch(`${API_BASE_URL}/email/send`, {
Expand Down Expand Up @@ -654,7 +654,7 @@ export async function sendReminderEmailAPI(
export async function sendReminderToAllAPI(
code: string,
organizerToken: string,
language: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'zh' | 'de' | 'nl' = 'es',
language: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'ko' | 'zh' | 'de' | 'nl' = 'es',
customMessage?: string
): Promise<SendEmailResponse> {
const response = await fetch(`${API_BASE_URL}/email/send`, {
Expand Down Expand Up @@ -716,7 +716,7 @@ export interface RecoverOrganizerLinkResponse {
export async function recoverOrganizerLinkAPI(
code: string,
email: string,
language: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'zh' | 'de' | 'nl' = 'es'
language: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'ko' | 'zh' | 'de' | 'nl' = 'es'
): Promise<RecoverOrganizerLinkResponse> {
const response = await fetch(`${API_BASE_URL}/email/send`, {
method: 'POST',
Expand Down Expand Up @@ -750,7 +750,7 @@ export async function recoverOrganizerLinkAPI(
export async function recoverParticipantLinkAPI(
code: string,
email: string,
language: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'zh' | 'de' | 'nl' = 'es'
language: 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'ko' | 'zh' | 'de' | 'nl' = 'es'
): Promise<RecoverOrganizerLinkResponse> {
const response = await fetch(`${API_BASE_URL}/email/send`, {
method: 'POST',
Expand Down
1 change: 1 addition & 0 deletions src/lib/translations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Each language has its own file:
- `fr.ts` - French (Français)
- `it.ts` - Italian (Italiano)
- `ja.ts` - Japanese (日本語)
- `ko.ts` - Korean (한국어)
- `zh.ts` - Chinese (中文)
- `de.ts` - German (Deutsch)
- `nl.ts` - Dutch (Nederlands)
Expand Down
2 changes: 2 additions & 0 deletions src/lib/translations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { pt } from './pt'
import { fr } from './fr'
import { it } from './it'
import { ja } from './ja'
import { ko } from './ko'
import { zh } from './zh'
import { de } from './de'
import { nl } from './nl'
Expand All @@ -15,6 +16,7 @@ export const translations = {
fr,
it,
ja,
ko,
zh,
de,
nl
Expand Down
26 changes: 26 additions & 0 deletions src/lib/translations/ko.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { en } from './en'

export const ko = {
...en,
appName: 'Zava 선물 교환',
welcome: '환영합니다!',
welcomeDesc: '쉽고 재미있게 선물 교환을 준비하세요',
createGame: '새 게임 만들기',
joinGame: '게임 참가하기',
Comment on lines +3 to +9
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ko.ts is implemented as a partial override (...en) and leaves most strings in English. This conflicts with the translations README guidance for adding a new language (“Translate all strings”) and will result in a mixed Korean/English UI once users select Korean. Either complete the Korean translations before exposing ko in the language toggle, or explicitly document/label Korean as a partial/beta translation and keep the fallback approach intentional.

Copilot uses AI. Check for mistakes.
enterCode: '코드를 입력하세요',
codePlaceholder: '6자리 코드',
continue: '계속',
back: '뒤로',
next: '다음',
finish: '완료',
cancel: '취소',
confirm: '확인',
language: '언어',
darkMode: '다크 모드',
lightMode: '라이트 모드',
privacyLink: '개인정보 처리방침',
guideOrganizerLink: '주최자 가이드',
guideParticipantLink: '참가자 가이드',
guideOrganizerTitle: '주최자 가이드',
guideParticipantTitle: '참가자 가이드'
Comment on lines +1 to +25
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style in src/lib/translations/* appears consistent (double quotes + no en import/spread in existing language files like de.ts, es.ts). ko.ts currently uses single quotes and different formatting, which makes the translations directory inconsistent and harder to maintain. Consider matching the existing translation file formatting for consistency.

Suggested change
import { en } from './en'
export const ko = {
...en,
appName: 'Zava 선물 교환',
welcome: '환영합니다!',
welcomeDesc: '쉽고 재미있게 선물 교환을 준비하세요',
createGame: '새 게임 만들기',
joinGame: '게임 참가하기',
enterCode: '코드를 입력하세요',
codePlaceholder: '6자리 코드',
continue: '계속',
back: '뒤로',
next: '다음',
finish: '완료',
cancel: '취소',
confirm: '확인',
language: '언어',
darkMode: '다크 모드',
lightMode: '라이트 모드',
privacyLink: '개인정보 처리방침',
guideOrganizerLink: '주최자 가이드',
guideParticipantLink: '참가자 가이드',
guideOrganizerTitle: '주최자 가이드',
guideParticipantTitle: '참가자 가이드'
export const ko = {
appName: "Zava 선물 교환",
welcome: "환영합니다!",
welcomeDesc: "쉽고 재미있게 선물 교환을 준비하세요",
createGame: "새 게임 만들기",
joinGame: "게임 참가하기",
enterCode: "코드를 입력하세요",
codePlaceholder: "6자리 코드",
continue: "계속",
back: "뒤로",
next: "다음",
finish: "완료",
cancel: "취소",
confirm: "확인",
language: "언어",
darkMode: "다크 모드",
lightMode: "라이트 모드",
privacyLink: "개인정보 처리방침",
guideOrganizerLink: "주최자 가이드",
guideParticipantLink: "참가자 가이드",
guideOrganizerTitle: "주최자 가이드",
guideParticipantTitle: "참가자 가이드"

Copilot uses AI. Check for mistakes.
}
3 changes: 2 additions & 1 deletion src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface Game {
archivedAt?: number // Unix timestamp in milliseconds since epoch when the game was archived (Date.now())
}

export type Language = 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'zh' | 'de' | 'nl'
export type Language = 'en' | 'es' | 'pt' | 'fr' | 'it' | 'ja' | 'ko' | 'zh' | 'de' | 'nl'

export interface LanguageOption {
code: Language
Expand All @@ -96,6 +96,7 @@ export const LANGUAGES: LanguageOption[] = [
{ code: 'fr', name: 'French', nativeName: 'Français', flag: '🇫🇷' },
{ code: 'it', name: 'Italian', nativeName: 'Italiano', flag: '🇮🇹' },
{ code: 'ja', name: 'Japanese', nativeName: '日本語', flag: '🇯🇵' },
{ code: 'ko', name: 'Korean', nativeName: '한국어', flag: '🇰🇷' },
{ code: 'zh', name: 'Chinese', nativeName: '中文', flag: '🇨🇳' },
{ code: 'de', name: 'German', nativeName: 'Deutsch', flag: '🇩🇪' },
{ code: 'nl', name: 'Dutch', nativeName: 'Nederlands', flag: '🇳🇱' },
Expand Down
Loading