Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Support only building language for Internationalized Routing #28410

Closed
JohnDeved opened this issue Aug 23, 2021 · 2 comments
Closed

Support only building language for Internationalized Routing #28410

JohnDeved opened this issue Aug 23, 2021 · 2 comments

Comments

@JohnDeved
Copy link

JohnDeved commented Aug 23, 2021

Describe the feature you'd like to request

Trying to build an international site with nextjs.
Requirements and SEO reasons force me to support 250 countries and 6 languages.
that is 1500 different locales in "en-GB" format.

nextjs will refuse to build with that amount of locales with the message:
Error: Received 1500 i18n.locales items which exceeds the max of 100, please reduce the number of items to continue.

In all honesty, the site really only needs to build 6 locales for each supported language, the content doesn't change.
The country is only important meta since it is an e-commerce online shop.

Describe the solution you'd like

A setting that lets you only build each page for each language, not each country + lang.
(or some other solution?)

Describe alternatives you've considered

maybe it would be also ok to have the languages in the i18n config and have a dynamic prefix for the country for all URLs (global base URL?), I hear Uber and Apple do it this way (if that is possible in nextjs)
/en/gb/

another possible solution was to try to rewrite "en-GB" => "en"
trying to do this as a workarround, sadly causes issues with links on the site, these will redirect to "/en"

  async rewrites() {
    return {
      beforeFiles: [
        {
          source: '/:lang(\\w{2})-:country(\\w{2})/:path*',
          destination: '/:lang/:path*',
        },      
      ],
    }
  }
@ijjk
Copy link
Member

ijjk commented Aug 23, 2021

Closing as a duplicate of #28157

@JohnDeved
Copy link
Author

@ijjk can we reopen this? since #28429 doesn't really solve my issue.
building all 1500 locales would still be not optimal for me

@ijjk ijjk reopened this Aug 24, 2021
@JohnDeved JohnDeved changed the title Support large amounts of locales for Internationalized Routing Support only building language for Internationalized Routing Aug 24, 2021
@vercel vercel locked and limited conversation to collaborators Aug 24, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants