Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 질의응답게시판 누락된 번역 적용 #436

Merged
merged 2 commits into from
Mar 3, 2025
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
31 changes: 22 additions & 9 deletions src/components/Board/BoardSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { cn } from '@/libs/utils';
import { Category } from '../Category';
import { useTranslation } from 'react-i18next';
import { qnaMajorCodesData, qnaMemberCodeData } from '@/pages/qna-notice/collegesData';
import { QnaMajorCode, QnaMemberCode } from '@/pages/qna-notice/types';

interface BoardSelectorProps<T> {
subcategories: T[];
Expand All @@ -18,15 +20,26 @@ export function BoardSelector<T extends string>({
const { t } = useTranslation();
return (
<div className={cn(`flex flex-wrap gap-2`, className)}>
{subcategories.map((category) => (
<Category
key={category}
isActive={selectedSubcategory === category}
onClick={() => onSubcategorySelect(category)}
>
{t(`board-selector.${category}`)}
</Category>
))}
{subcategories.map((category) => {
let translateType = 'board-selector';

if (qnaMemberCodeData.includes(category as QnaMemberCode)) {
translateType = 'faculties';
}
if (qnaMajorCodesData.includes(category as QnaMajorCode)) {
translateType = 'departments';
}

return (
<Category
key={category}
isActive={selectedSubcategory === category}
onClick={() => onSubcategorySelect(category)}
>
{t(`${translateType}.${category}`)}
</Category>
);
})}
</div>
);
}
Expand Down
9 changes: 6 additions & 3 deletions src/translate/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
"접수완료": "Received",
"답변완료": "Answered",
"종료됨": "Closed",
"답변대기": "Pending Response"
"답변대기": "Pending Response",
"IT지원위원회": "IT Support Committee"
},
"faculties": {
"인문대학": "College of Humanities",
Expand All @@ -111,7 +112,8 @@
"국제대학": "International College",
"베어드학부대학": "Baird University College",
"차세대반도체학과": "Department of Next-Generation Semiconductor",
"융합특성화자유전공학부": "School of Convergence Specialization"
"융합특성화자유전공학부": "School of Convergence Specialization",
"총학생회": "Student Council"
},
"departments": {
"융합특성화자유전공학부": "School of Convergence Specialization",
Expand Down Expand Up @@ -179,7 +181,8 @@
"한국학과": "Department of Korean Studies",
"자유전공학부(인문)": "School of Liberal Studies (Humanities unit)",
"자유전공학부(자연)": "School of Liberal Studies (Natural Science Unit)",
"문예창작전공": "Major in Creative Writing"
"문예창작전공": "Major in Creative Writing",
"총학생회": "Student Council"
},
"onboarding": {
"제65대 총학생회": "65th Student Council",
Expand Down
9 changes: 6 additions & 3 deletions src/translate/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
"접수완료": "접수완료",
"답변완료": "답변완료",
"종료됨": "종료됨",
"답변대기": "답변대기"
"답변대기": "답변대기",
"IT지원위원회": "IT지원위원회"
},
"faculties": {
"인문대학": "인문대학",
Expand All @@ -111,7 +112,8 @@
"국제대학": "국제대학",
"베어드학부대학": "베어드학부대학",
"차세대반도체학과": "차세대반도체학과",
"융합특성화자유전공학부": "융합특성화자유전공학부"
"융합특성화자유전공학부": "융합특성화자유전공학부",
"총학생회": "총학생회"
},
"departments": {
"문예창작전공": "문예창작전공",
Expand Down Expand Up @@ -179,7 +181,8 @@
"정보보호학과": "정보보호학과",
"한국학과": "한국학과",
"자유전공학부(인문)": "자유전공학부(인문)",
"자유전공학부(자연)": "자유전공학부(자연)"
"자유전공학부(자연)": "자유전공학부(자연)",
"총학생회": "총학생회"
},
"onboarding": {
"제65대 총학생회": "제65대 총학생회",
Expand Down