Skip to content

SSR Generation & Dynamic Routes with multiple languages #2893

Closed Answered by Pfenya
Pfenya asked this question in Q&A
Discussion options

You must be logged in to vote

I ended up doing separate docker containers per domain to be generated and setting the locales for each via environmental variables so that i can re-use the docker image but generate the different versions and also limit the dynamic routes to those for each domain by iterating over the locales I actively need.

const locales = process.env.LOCALES;
const localesArray = locales.split(",");


function getLocales(){
   let localesOut = locales.split(",");
  return localesOut;
}

  i18n: {
    customRoutes: 'config',
    strategy: 'prefix_except_default',
    defaultLocale: localesArray[0],
    detectBrowserLanguage: false,
    dynamicRouteParams: true,
    differentDomains: false,
    locales:…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Pfenya
Comment options

You must be logged in to vote
2 replies
@Pfenya
Comment options

@WaldemarEnns
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants