Skip to content

Commit 00cd9a3

Browse files
committed
[fix] locale path casing bugs
Adds config options to next-i18next.config.js to look for translation files using lowercase lang codes. Allows codes with region-specificity (i.e. pt-br, zh-tw, or hy-am) to be agnostic to capitalization of the region (i.e. pt-BR or pt-br will work in the URL)
1 parent 2107fe3 commit 00cd9a3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

next-i18next.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,10 @@ module.exports = {
1717
localePath: "./src/intl",
1818
// see updates to your translation JSON files without having to restart your development server each time
1919
reloadOnPrerender: true,
20+
// Language codes to lookup, given set language is 'en-US': 'all' --> ['en-US', 'en', 'dev'], 'currentOnly' --> 'en-US', 'languageOnly' --> 'en'
21+
load: "currentOnly",
22+
// Language will be lowercased EN --> en while leaving full locales like en-US
23+
cleanCode: true,
24+
// Language will be lowercased eg. en-US --> en-us
25+
lowerCaseLng: true,
2026
}

0 commit comments

Comments
 (0)