-
Notifications
You must be signed in to change notification settings - Fork 7
feat: adapt to the japanese languange #1311
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
base: dev
Are you sure you want to change the base?
Changes from 1 commit
ad61fb2
b6a95bc
3660059
2ca7ff1
4b51cb8
f81f44d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ export const languages: { [key: string]: string } = { | |
hr: "Croatian", | ||
ko: "Korean", | ||
zh: "Chinese", | ||
jp: "Japanese", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Update Japanese locale code from 'jp' to 'ja' across configuration files The incorrect ISO code 'jp' is indeed used in multiple files. Here are all the locations that need to be updated:
Additionally, ensure the locale files under 🔗 Analysis chainUpdate Japanese language entry to use correct ISO code and native name There are two issues with the Japanese language entry:
Apply this change: - jp: "Japanese",
+ ja: "日本語", This change will require corresponding updates in other files where the locale code is used (e.g., next-i18next.config.js and locales.ts). Let's verify other files that need to be updated: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for 'jp' locale usage across the codebase
rg -l '\bjp\b' --type ts --type js --type json
Length of output: 123 Script: #!/bin/bash
# Check the content of these files to see how 'jp' is used
echo "=== next-i18next.config.js ==="
cat next-i18next.config.js
echo -e "\n=== src/constants/locales.ts ==="
cat src/constants/locales.ts
Length of output: 564 |
||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const LOCALES = ["en", "bg", "es", "hr", "ko", "zh"]; | ||
export const LOCALES = ["en", "bg", "es", "hr", "ko", "zh", "jp"]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Critical: Incorrect Japanese locale code used across multiple files The incorrect locale code "jp" for Japanese is consistently used across three files. This needs to be changed to the ISO 639-1 standard "ja":
-export const LOCALES = ["en", "bg", "es", "hr", "ko", "zh", "jp"];
+export const LOCALES = ["en", "bg", "es", "hr", "ko", "zh", "ja"];
- locales: ["en", "bg", "es", "hr", "ko", "zh", "jp"],
+ locales: ["en", "bg", "es", "hr", "ko", "zh", "ja"],
- jp: "Japanese",
+ ja: "Japanese", 🔗 Analysis chainCritical: Use correct ISO language code for Japanese The locale code "jp" is incorrect for Japanese. According to ISO 639-1 standards, the correct language code for Japanese is "ja". While "jp" is the country code (ISO 3166-1), for language localization we should use the language code "ja". Apply this fix: -export const LOCALES = ["en", "bg", "es", "hr", "ko", "zh", "jp"];
+export const LOCALES = ["en", "bg", "es", "hr", "ko", "zh", "ja"]; This change should also be reflected in:
Let's verify the usage of this locale code across the codebase: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for any hardcoded usage of 'jp' locale
# to ensure we catch all instances that need updating
echo "Checking for 'jp' locale usage..."
rg -l '"jp"' --type ts --type js --type json
echo "Checking for Japanese language configuration..."
rg -l 'Japanese' --type ts --type js --type json
Length of output: 358 Script: #!/bin/bash
# Let's check the actual content of these files to confirm the usage
echo "Content of next-i18next.config.js:"
cat next-i18next.config.js
echo -e "\nContent of src/constants/languages.ts:"
cat src/constants/languages.ts
Length of output: 673 |
||
|
||
export default LOCALES; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Critical: Incorrect ISO language code needs to be updated in multiple files
The incorrect "jp" language code is consistently used across three files that need to be updated:
next-i18next.config.js
: Change "jp" to "ja" in locales arraysrc/constants/locales.ts
: Change "jp" to "ja" in LOCALES arraysrc/constants/languages.ts
: Change "jp" to "ja" in languages object keyApply this fix across all files:
The ISO 639-1 language code "ja" must be used for Japanese localization to work correctly.
🔗 Analysis chain
Critical: Incorrect ISO language code for Japanese
The locale code "jp" is incorrect. The ISO 639-1 language code for Japanese is "ja". While "jp" is the country code for Japan, "ja" is the correct language code that should be used for internationalization.
Apply this fix:
Let's verify the usage of this incorrect code across other files:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 232
Script:
Length of output: 510