Daandelange / k3-translations

Translations menu replacement, field and section for Kirby 3.
29 stars 0 forks source link

[BUG] Visit this page in... links are not correct when using dedicated urls per language #4

Open wout opened 2 years ago

wout commented 2 years ago

I'm using a dedicated hostname per language. The Visit this page in ... always link to the hostname of the currently selected language.

malvese commented 2 years ago

Language is indeed correct only for the active tab: If the French tab is active and you choose "Visit this page in French" it will correctly open the French page. If the English tab is active and you use "Visit this page in French" from dropdown in the French tab, it will open the English page.

Daandelange commented 1 year ago

I'm not sure to understand, can you provide a way to reproduce ? What's your config line that breaks it ? I guess the plugin uses a hardcoded URL, maybe it needs to be hooked to a panel variable that contains the right config ?

Daandelange commented 1 year ago

Closing until more information is available, feel free to reopen.

wout commented 1 year ago

This happens when languages have custom domains or paths. The Path or domain for the currently selected language is used in the menu.

Daandelange commented 1 year ago

Ok, so you referring to Different domains for each language. Language Specific urls might be affected too. The issue is that the previewUrl always links to the active language url/domain.

Indeed, in such a setup, the Kirby Panel doesn't know about the other translation URL, serving the current model previewUrl. It seems that Kirby only sends the previewUrl for the current language, so this extra information should be send manually as prop or computed.

Daandelange commented 1 year ago

Should be fixed now, I didn't test in-depth so there might be some bugs.

malvese commented 1 year ago

Thanks! I didn't have time to recheck, but will hopefully be able to test the fix in coming days.