kalwalt / gatsby-starter-i18n-bulma

A gatsby multilanguage template with bulma and i18n: it is a work in progress...
https://gatsby-starter-i18n-bulma.netlify.app/
MIT License
23 stars 17 forks source link

default language without lang prefix #123

Open makho-kit opened 4 years ago

makho-kit commented 4 years ago

How is it possible to have a default language without language path prefix? For example:

https://gatsby-starter-i18n-bulma.netlify.com/ < English default https://gatsby-starter-i18n-bulma.netlify.com/it/ < Italy

kalwalt commented 4 years ago

Hi @makhokey It was possible with the gatsby-plugin-i18n honestly i don't know if you can with my modifies, at least i need to check, because i never tried.

wc-lei commented 4 years ago

@makhokey I think if you look at the documentation of gatsby-browser.js you will see how you can automatically redirect any "/" to "/defaultLocale". Here is an example: exports.onClientEntry = () => { if (window.location.pathname === '/') { window.location.pathname =/en } }