Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require("path");

module.exports = {
i18n: {
locales: ["en", "bg", "es", "hr", "ko", "zh"],
locales: ["en", "bg", "es", "hr", "ko", "zh", "jp"],
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Potential issue

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 array
  • src/constants/locales.ts: Change "jp" to "ja" in LOCALES array
  • src/constants/languages.ts: Change "jp" to "ja" in languages object key

Apply this fix across all files:

- "jp": "Japanese"
+ "ja": "Japanese"

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:

- locales: ["en", "bg", "es", "hr", "ko", "zh", "jp"],
+ locales: ["en", "bg", "es", "hr", "ko", "zh", "ja"],

Let's verify the usage of this incorrect code across other files:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for usage of incorrect 'jp' locale code across the codebase
# Expected: Should find instances where we need to update 'jp' to 'ja'

echo "Checking for 'jp' usage in language/locale related files..."
rg -l "jp" --type ts --type js src/constants/

Length of output: 232


Script:

#!/bin/bash
# Let's check the actual content of these files to see how 'jp' is used
echo "Content of src/constants/locales.ts:"
cat src/constants/locales.ts

echo -e "\nContent of src/constants/languages.ts:"
cat src/constants/languages.ts

Length of output: 510

defaultLocale: "en",
},
localePath: path.resolve("./public/locales"),
Expand Down
1 change: 1 addition & 0 deletions src/constants/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export const languages: { [key: string]: string } = {
hr: "Croatian",
ko: "Korean",
zh: "Chinese",
jp: "Japanese",
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Potential issue

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:

  • src/constants/languages.ts: Change jp: "Japanese" to ja: "日本語"
  • next-i18next.config.js: Update locale array to use ja instead of jp
  • src/constants/locales.ts: Update locale array to use ja instead of jp

Additionally, ensure the locale files under public/locales/ are named correctly using the 'ja' code instead of 'jp'.

🔗 Analysis chain

Update Japanese language entry to use correct ISO code and native name

There are two issues with the Japanese language entry:

  1. The language code 'jp' is incorrect. According to ISO 639-1 standards, the correct code for Japanese is 'ja'. Note that 'jp' is often confused with Japanese but actually refers to the country code (Japan), not the language code.

  2. For consistency with entries like "Español", consider using the native name "日本語" (Nihongo) instead of "Japanese".

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 executed

The 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

};
2 changes: 1 addition & 1 deletion src/constants/locales.ts
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"];
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Potential issue

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":

  • src/constants/locales.ts:
-export const LOCALES = ["en", "bg", "es", "hr", "ko", "zh", "jp"];
+export const LOCALES = ["en", "bg", "es", "hr", "ko", "zh", "ja"];
  • next-i18next.config.js:
-    locales: ["en", "bg", "es", "hr", "ko", "zh", "jp"],
+    locales: ["en", "bg", "es", "hr", "ko", "zh", "ja"],
  • src/constants/languages.ts:
-  jp: "Japanese",
+  ja: "Japanese",
🔗 Analysis chain

Critical: 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:

  • next-i18next.config.js
  • src/constants/languages.ts

Let's verify the usage of this locale code across the codebase:

🏁 Scripts executed

The 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;