Jump to content

best way to do language urls (/en, /nl) without "multi-language page names"?


joe_g
 Share

Recommended Posts

Hi,

I'm doing a bilingual site, but I'm trying to avoid multi-language page names. I don't want the editor to be able to unpublish things per language, and one url is enough per page.

If i uninstall multi-language page names, the possibility for language urls disappear (/en/url, /nl/url) – what would be the best way to get these urls without multi-language page names?

I'm aware of the old method by having gateway templates and pages (/en and /nl) but this method complicates url segments, so I was hoping there was a more 'core' way of doing it.

thanks

J

Link to comment
Share on other sites

But you still use language fields, so 1 page has multiple languages?

The "best" way to modify the urls is to hook Page::path and prepend the lang segment. But this will only modify urls you spit out with echo $page->url and PW will not recognize these urls, so you'd have to implement another code to request the right page depending on the new url. Kinda what LanguageSupportPageNames does, so why removing it?

Link to comment
Share on other sites

Thanks, main reasons are

- i don't want the editor to be able to unpublish per language (because it makes language-switching easier when everything is available in all languages, and I rather display a message "text is missing in english" with the un-translated text in dutch than not having a page at all)

- Usability-wise: What happens when you want to switch from Dutch to English on a page that doesnt exist in English? (the EN button disappears? EN button is disabled? You get redirected to the home page? You get a message "page missing") Not good usability in any of these options, as far as I can see.

- a page is either unpublished or published (for all languages, not per language). Conceptually simple.

- the additional complexity for multiple urls, and what they mean, is confusing for the editor. The concept of having to care for the URLs at all is already a barrier.

- avoid this issue https://processwire.com/talk/topic/5979-allow-new-pages-to-be-created-from-field-only-creates-in-default-language-when-using-multiple-page-names-module/

I'll look into the hook thing, but I have a feeling I might end up with the language-gateway solution in the end   ... : P

j

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...