In Next.js 10.0, internationalized routing generates routes that expose exact locale values into generated routes, e.g. /en-US.
For ease of use by end-users and easier legibility, it should be possible to have routes generated with the entire locale part of routes generated in lowercase, e.g. /en-us. However, internally the formally correct capitalization e.g. en-US should transparently be injected so that retrieving data from external locale-aware systems (e.g. headless CMS) remains easy.
A (clumsy) alternative is to manually build a folder structure that implements the locale sub-path via dynamic routes, e.g. /[locale]/[slug].js where getStaticPaths() provides a locale converted to lowercase for locale and in getStaticProps() the correct capitalization is recalculated from the locale prop using custom code.
In cases where the site hosting service considers URLs case-sensitive, having mixed case locales is highly unintuitive for end users and will cause a lot of problems when they manually enter URLs without considering the possibility of case sensitivity.
Locales are already case insensitive.
Even if the hosting service matches case insensitive, routes are still generated with mixed case which reduces legibility for non-technical users.
@advancingu you can use any case for the routes you want, e.g:
module.exports = {
// ...
i18n: {
// ...
locales: [
"en-us",
"en-gb",
"en",
// ...
],
// ...
},
// ...
};
@rokinsky
facing the same issue.
when adding locale like en-us or en-US nextjs build fails creating pre-rendered 404 pages