Skip to content

Commit 3da7bc4

Browse files
committed
fix(i18n): add missing translation keys for editor, visualization, theme toggle
- LessonCodePanel: replace hardcoded Korean "에디터" with t('lesson.editor') - ThemeToggle: use i18n keys instead of hardcoded Korean theme labels - Add lesson.editor, lesson.visualization keys to EN/ZH/KO - Add theme.soft/dark/minimal/change keys to EN/ZH/KO
1 parent 24fab95 commit 3da7bc4

5 files changed

Lines changed: 36 additions & 4 deletions

File tree

packages/frontend/src/components/ThemeToggle.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
* 클릭할 때마다 테마 순환: soft → dark → minimal → soft
55
*/
66

7+
import { useTranslation } from 'react-i18next';
78
import { Palette } from 'lucide-react';
89
import { useThemeStore } from '@/stores/themeStore';
9-
import { themeLabels } from '@/config/themes';
1010

1111
export function ThemeToggle() {
12+
const { t } = useTranslation();
1213
const { theme, cycleTheme } = useThemeStore();
1314

15+
const labelKey = `theme.${theme}` as const;
16+
1417
return (
1518
<button
1619
onClick={cycleTheme}
@@ -20,10 +23,10 @@ export function ThemeToggle() {
2023
color: theme === 'dark' ? '#e5e7eb' : '#4b5563',
2124
border: `1px solid ${theme === 'dark' ? '#4b5563' : '#d1d5db'}`,
2225
}}
23-
title="테마 변경"
26+
title={t('theme.change')}
2427
>
2528
<Palette size={14} />
26-
<span>{themeLabels[theme]}</span>
29+
<span>{t(labelKey)}</span>
2730
</button>
2831
);
2932
}

packages/frontend/src/features/courses/components/LessonCodePanel.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
import { useState, useRef, useCallback } from 'react';
10+
import { useTranslation } from 'react-i18next';
1011
import { Code2 } from 'lucide-react';
1112

1213
import { CodeMirrorEditor, type CodeSelection } from '@/features/visualizers/shared/components/CodeMirrorEditor';
@@ -37,6 +38,7 @@ export function LessonCodePanel({
3738
className,
3839
style,
3940
}: LessonCodePanelProps) {
41+
const { t } = useTranslation();
4042
const [codeRatio, setCodeRatio] = useState(defaultRatio);
4143
const isDragging = useRef(false);
4244
const containerRef = useRef<HTMLDivElement>(null);
@@ -97,7 +99,7 @@ export function LessonCodePanel({
9799
}}
98100
>
99101
<Code2 className="w-3 h-3 mr-1.5" />
100-
에디터
102+
{t('lesson.editor')}
101103
</div>
102104
)}
103105
<div className="flex-1 overflow-y-auto" style={{ minHeight: 0 }}>

packages/frontend/src/locales/en/translation.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@
160160
"no_explanation": "No explanation available",
161161
"expand": "Show more",
162162
"collapse": "Show less",
163+
"editor": "Editor",
164+
"visualization": "Visualization",
163165
"c_code": "C Code",
164166
"python_code": "Python Code",
165167
"java_code": "Java Code",
@@ -435,5 +437,12 @@
435437
"send": "Send",
436438
"success": "Sent successfully! Thank you.",
437439
"error": "Failed to send. Please try again later."
440+
},
441+
442+
"theme": {
443+
"change": "Change theme",
444+
"soft": "Soft",
445+
"dark": "Dark",
446+
"minimal": "Minimal"
438447
}
439448
}

packages/frontend/src/locales/ko/translation.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@
160160
"no_explanation": "설명이 없습니다",
161161
"expand": "더보기",
162162
"collapse": "접기",
163+
"editor": "에디터",
164+
"visualization": "시각화",
163165
"c_code": "C 코드",
164166
"python_code": "Python 코드",
165167
"java_code": "Java 코드",
@@ -435,5 +437,12 @@
435437
"send": "전송",
436438
"success": "전송 완료! 감사합니다.",
437439
"error": "전송 실패. 잠시 후 다시 시도해주세요."
440+
},
441+
442+
"theme": {
443+
"change": "테마 변경",
444+
"soft": "소프트",
445+
"dark": "다크",
446+
"minimal": "미니멀"
438447
}
439448
}

packages/frontend/src/locales/zh/translation.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@
160160
"no_explanation": "暂无讲解",
161161
"expand": "展开",
162162
"collapse": "收起",
163+
"editor": "编辑器",
164+
"visualization": "可视化",
163165
"c_code": "C 代码",
164166
"python_code": "Python 代码",
165167
"java_code": "Java 代码",
@@ -432,5 +434,12 @@
432434
"col_problem": "题目",
433435
"col_result": "结果",
434436
"col_submitted_at": "提交时间"
437+
},
438+
439+
"theme": {
440+
"change": "切换主题",
441+
"soft": "柔和",
442+
"dark": "暗黑",
443+
"minimal": "简约"
435444
}
436445
}

0 commit comments

Comments
 (0)