Add complete English locale files matching Korean translations#92
Add complete English locale files matching Korean translations#92dioo1461 wants to merge 1 commit intofeature/group-join-requestfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the application's internationalization capabilities by completing the English translation set. The changes ensure that the English locale now fully mirrors the Korean locale, preventing any missing keys or runtime errors when users switch between languages. This provides a more robust and consistent user experience for English-speaking users. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request does a great job of adding comprehensive English translations to match the Korean ones. My review focuses on improving consistency in localization key naming conventions, enhancing maintainability of the index file, and correcting a potential pluralization issue. I've identified a few areas where key naming is inconsistent across related files (e.g., camelCase vs. kebab-case). Adopting a single convention will make the keys easier to manage. Additionally, I've suggested sorting the namespaces in index.ts for better readability and proposed a fix for pluralization in unit.json to ensure grammatical correctness.
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "person": "people" | |||
There was a problem hiding this comment.
The current mapping "person": "people" doesn't handle singular vs. plural forms correctly. This will result in grammatically incorrect text like "1 people". i18next has built-in support for pluralization that should be used here.
After this change, you'll need to update the call site to use t('unit.person', { count: ... }), and i18next will automatically select the correct singular or plural form.
"person_one": "person",
"person_other": "people"| "createGoal": "Create Goal", | ||
| "goalName": "Goal name", | ||
| "goalNameHint": "Please enter the name of the goal you want to create", | ||
| "goalDescription": "Goal description", | ||
| "goalDescriptionHint": "Please enter a description of the goal", | ||
| "goalTimeLabel": "Goal time", | ||
| "goalTimeHint": "Please enter the daily goal time for the new goal", | ||
| "selectDayBelong": "Select days", | ||
| "selectDayBelongHint": "Please select the days to work on this goal", | ||
| "goalTimeValue": "{{hours}}h {{minutes}}min" |
There was a problem hiding this comment.
The keys in this file use camelCase (e.g., createGoal, goalName), while most other new locale files, including related ones for goals (manageCategory.json, editCategory.json), use kebab-case. To ensure consistency across localization files, it's recommended to use kebab-case for all keys.
Note that this is a breaking change and will require updating all usages in the codebase (e.g., t('createGoal.goalName') would need to be changed to t('createGoal.goal-name')).
| "createGoal": "Create Goal", | |
| "goalName": "Goal name", | |
| "goalNameHint": "Please enter the name of the goal you want to create", | |
| "goalDescription": "Goal description", | |
| "goalDescriptionHint": "Please enter a description of the goal", | |
| "goalTimeLabel": "Goal time", | |
| "goalTimeHint": "Please enter the daily goal time for the new goal", | |
| "selectDayBelong": "Select days", | |
| "selectDayBelongHint": "Please select the days to work on this goal", | |
| "goalTimeValue": "{{hours}}h {{minutes}}min" | |
| "create-goal": "Create Goal", | |
| "goal-name": "Goal name", | |
| "goal-name-hint": "Please enter the name of the goal you want to create", | |
| "goal-description": "Goal description", | |
| "goal-description-hint": "Please enter a description of the goal", | |
| "goal-time-label": "Goal time", | |
| "goal-time-hint": "Please enter the daily goal time for the new goal", | |
| "select-day-belong": "Select days", | |
| "select-day-belong-hint": "Please select the days to work on this goal", | |
| "goal-time-value": "{{hours}}h {{minutes}}min" |
| "leftTimeToAchieveGoal": "{{time}} left to hit your goal time", | ||
| "studyingWithPetName": "Studying with {{petName}}", | ||
| "studying": "in progress...", | ||
| "today-goal-complete": "Goal time achieved!" |
There was a problem hiding this comment.
This file mostly uses camelCase for keys, but today-goal-complete uses kebab-case. For consistency within this file, it's better to use camelCase.
This change will require updating its usage in the code from t('home.today-goal-complete') to t('home.todayGoalComplete').
| "today-goal-complete": "Goal time achieved!" | |
| "todayGoalComplete": "Goal time achieved!" |
| const translationEN = { | ||
| tasks: tasksEN, | ||
| home: homeEN, | ||
| settings: settingsEN, | ||
| signUp: signUpAccountEN, | ||
| general: generalEN, | ||
| createGoal: createCategoryEN, | ||
| groups: groupsEN, | ||
| groupDetail: groupDetailEN, | ||
| unit: unitEN, | ||
| groupSearch: groupSearchEN, | ||
| groupEntryCodeSubmit: groupEntryCodeSubmitEN, | ||
| groupSetting: groupSettingEN, | ||
| groupRanking: groupRankingEN, | ||
| groupChat: groupChatEN, | ||
| stats: statsEN, | ||
| manageCategory: manageCategoryEN, | ||
| editCategory: editCategoryEN, | ||
| signUpBirthDate: signUpBirthDateEN, | ||
| signUpPosition: signUpPositionEN, | ||
| signUpProfileImage: signUpProfileImageEN, | ||
| signUpProfileComplete: signUpProfileCompleteEN, | ||
| signUpAccountComplete: signUpAccountCompleteEN, | ||
| createGroupEntryCode: createGroupEntryCodeEN, | ||
| login: loginEN, | ||
| createGroup: createGroupEN, | ||
| editProfile: editProfileEN, | ||
| components: componentsEN, | ||
| createGroupCategory: createGroupCategoryEN, | ||
| editGroupCategory: editGroupCategoryEN, | ||
| pendingGroupJoinRequest: pendingGroupJoinRequestEN, | ||
| }; |
There was a problem hiding this comment.
The properties in the translationEN object are not alphabetically sorted. Sorting them makes the code more readable and helps developers find namespaces more easily as the project grows.
const translationEN = {
components: componentsEN,
createGoal: createCategoryEN,
createGroup: createGroupEN,
createGroupCategory: createGroupCategoryEN,
createGroupEntryCode: createGroupEntryCodeEN,
editCategory: editCategoryEN,
editGroupCategory: editGroupCategoryEN,
editProfile: editProfileEN,
general: generalEN,
groupChat: groupChatEN,
groupDetail: groupDetailEN,
groupEntryCodeSubmit: groupEntryCodeSubmitEN,
groupRanking: groupRankingEN,
groupSearch: groupSearchEN,
groupSetting: groupSettingEN,
groups: groupsEN,
home: homeEN,
login: loginEN,
manageCategory: manageCategoryEN,
pendingGroupJoinRequest: pendingGroupJoinRequestEN,
settings: settingsEN,
signUp: signUpAccountEN,
signUpAccountComplete: signUpAccountCompleteEN,
signUpBirthDate: signUpBirthDateEN,
signUpPosition: signUpPositionEN,
signUpProfileComplete: signUpProfileCompleteEN,
signUpProfileImage: signUpProfileImageEN,
stats: statsEN,
tasks: tasksEN,
unit: unitEN,
};
Motivation
enmirrors the existingkonamespaces for consistent i18n coverage across the app.koanden.Description
src/locales/en/*.jsonfiles and filled them with English translations corresponding to everysrc/locales/ko/*.jsonnamespace.src/locales/en/home.jsonandsrc/locales/en/tasks.jsonso their keys fully match the Korean sources.src/locales/en/index.tsto import all new English namespaces and register them intranslationENso the structure matchestranslationKO.Testing
src/locales/koandsrc/locales/enusing the script:node - <<'NODE' ... NODE, which reportedlocale keys match.Codex Task