wintercms / wn-translate-plugin

Translate plugin for Winter CMS
MIT License
13 stars 18 forks source link

Error code: 404 if you try to directly access page in different language #3

Closed ghost closed 3 years ago

ghost commented 3 years ago

I don't understand how everyone missed this when they designed this plugin. This is important for multilingual pages. If my client has opened the page in language 1 and I send him the link to page on language 2 url he will receive error 404.

Will this be fixed in the future or what is your advice how to deal with this?

Example below:

This is so it will display menu in the top right corner: demo1 demo2 demo3

Everything will work fine if I switch languages via language picker from english to slovenian it will switch the url from https://example.com/blogslovenian to https://example.com/blogenglish without problems.

I have added different url for each language on page: demo4 demo5

This will work when I am switching languages via language picker: demo6 demo7

The problem is when I try to access different language url manually. For example the page is set to Slovenian (https://example.com/blogslovenian) via language picker and I access english url (https://example.com/blogenglish) manually it will 404. demo8

Here is the error log: demo9

demo10

mjauvin commented 3 years ago

Did you set "forceUrl = 1" in the localePicker component ?

ghost commented 3 years ago

Did you set "forceUrl = 1" in the localePicker component ?

It's the same either way. I have tested this so many different ways always the same error. I can't put a site like this into production...

mjauvin commented 3 years ago

I have many sites in production without this issue. Something is not properly configured.

Can you send me a link to the website so I can take a look? You can connect on our discord channel and PM me directly.

ghost commented 3 years ago

The sites are not public as they are still work in progress. I have to reconfigure the server so you will be able to have a look. Give me 30 minutes and I will PM you on discord.

mjauvin commented 3 years ago

Can you show me the full CMS page definition for a page having the problem? Did you properly set the slug in both languages?

ghost commented 3 years ago

Confirmed by mjauvin that what I am was trying to do is not supported. You need to reference the language suffix in the url so the site knows what language to load.