Hi!
I wan’t to add multilingual support to my site, so I have cloned my current website into a new one, and changed the frontity.settings.js file to the following:
const settings =
[
{
"name": "norwegian",
"state": {
"frontity": {
"url": "https://aamodtgroup2.vercel.app",
"title": "Aamodt Group",
"description": "Konsulenter innen utvikling og drift"
},
"theme": {
"menuUrl": "menu",
"lang": "no"
}
},
"packages": [
{
"name": "@aamodtgroup/agtech",
},
{
"name": "@frontity/wp-source",
"state": {
"source": {
"url": "https://backend2.aamodtgroup.com",
"homepage": "/hjem",
}
}
},
"@frontity/tiny-router",
"@frontity/html2react"
]
},
{
"name": "english",
"match": [".*aamodtgroup2.vercel.app\/en(\/.*)?$"],
"state": {
"frontity": {
"url": "https://aamodtgroup2.vercel.app/en",
"title": "Aamodt Group",
"description": "Consultants within development and operations"
},
"theme": {
"menuUrl": "menu-en",
"lang": "en"
}
},
"packages": [
{
"name": "@aamodtgroup/agtech",
},
{
"name": "@frontity/wp-source",
"state": {
"source": {
"url": "https://backend2.aamodtgroup.com",
"homepage": "/home"
}
}
},
"@frontity/tiny-router",
"@frontity/html2react"
]
}
];
export default settings;
The site is live here:
https://aamodtgroup2.vercel.app
Repo:
As you can see, the Norwegian part of the site works fine, but if you click on EN in the top right corner, it can’t find the homepage of the english version. Another problem is that on the EN version, the Link component does not seem to be working, it just takes you to the wp-install links. In the NO verison it works fine, but I had the same problem there as well, untill I removed the “match” prop from the Norwegian package.
The plugin I use is Polylang, and it is set so that the urls of the page adds a /en for the EN version.
Have I done something wrong with the setup?