Comments (5)
Hi;
When you click on the flag and visit http://127.0.0.1:8000/it/ than click on the English flag to return to the English version it end with a double slash
http://127.0.0.1:8000/en//
note the same thing happen when you are at http://127.0.0.1:8000/en/ and click on the Italian flag.
Yes @JOduMonT i saw this, but hadn't the time to fix.
I think i need to add another check in this function
gatsby-starter-i18n-bulma/src/components/Layout.js
Lines 51 to 58 in 5107c97
to not add the extra /
if the link is the root /it/
or /en/
.
from gatsby-starter-i18n-bulma.
I suppose something like this (not tested at all):
const setLangsMenu = ( langsMenu, id, basePath, jsonData) => {
if(id !== 'undefined'){
if (id=='01') {
langsMenu[0].link = `/en/`;
langsMenu[1].link = `/it/`;
} else {
langsMenu[0].link = `/en/${basePath}` + getIdJsonUrl(id, 'en', jsonData) + '/';
langsMenu[1].link = `/it/${basePath}` + getIdJsonUrl(id, 'it', jsonData) + '/';
}
}else{ console.log("missed id in the setLangsMenu() function!"); }
};
from gatsby-starter-i18n-bulma.
@JOduMonT i'm working on this branch https://github.com/kalwalt/gatsby-starter-i18n-bulma/tree/fix-lang-switch if you want to test, it seems that be3a25b fix the issue.
from gatsby-starter-i18n-bulma.
Should be solved with #145, closing for now.
from gatsby-starter-i18n-bulma.
I have tested in different situations and don't completely solve the issue: the solution in the last commit works for the home page but not if you change the page from a page like /artworks
to /home
it will add an extra /
. This happens clicking on the logo. I will open a new issue for this.
from gatsby-starter-i18n-bulma.
Related Issues (20)
- Contact form do not send message to Netlify service HOT 1
- Portfolio did not works, only glitching! HOT 2
- npm install fails installing alias HOT 2
- Adding Amp feature to the template HOT 2
- lorempixel.com is down need an alternative HOT 1
- The netlify-cms package is deprecated, please install netlify-cms-app instead HOT 1
- Dependabot can't parse your package.json HOT 2
- upgrading react-intl npm package HOT 1
- default language without lang prefix HOT 2
- National flags HOT 4
- Dependabot can't parse your package.json HOT 1
- developing a gatsby-theme for the starter
- form contact is broken
- ERESOLVE unable to resolve dependency tree HOT 11
- named exports will cause Fast Refresh to not preserve local component state and do a full refresh HOT 2
- Webpack compilation error HOT 1
- picsum photos not displayed on artworks page HOT 1
- alternative to react-photo-gallery
- Change default language - defaultLangKey HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-starter-i18n-bulma.