Jump to content

Country specific content in a multi-language site?


Recommended Posts

Hi guys

Maybe someone can point me in the right direction. I have my multi-language site with german, french, english and dutch. I now want to exclude certain contents in certain countries. The thing is, countries like Switzerland and France share French, and Switzerland also shares German with Germany. I guessed I need country-language pairs like de-DE, de-CH, fr-CH, fr-FR, en-INT or something. Based on those I can output different content, that's easy. But I only want one translation for each language. I also use Fluency/Deepl translation, so this is most likely going to be a mess with too many copies of a language.

Do you see another solution than these language-country pairs resulting in something like /fr/fr/ and /ch/fr or so? Or leave the languages as they are and add geoID detection and output content based on that? I still want users to be able to choose their country and language. And it should after all be a straight forward and simple solution.

Thanks,

Nuél

Link to comment
Share on other sites

Never done that myself, but my quick feeling says having both in the url is the best solution. I don't like geo detection at all. I hate it whenever I go to the nette framework docs and get the german version of the docs as I'm always reading docs in english, for example. And does geo detection even work well with ProCache (if you are using it...)?

One thing to make it maybe look a bit nicer is to use a 3-letter-code for the region and a 2-letter-code for the language? example.com/aut/en or maybe even example.com/oesterreich/en ? Not sure if longer/shorter urls impact SEO somehow?

Link to comment
Share on other sites

Hi @bernhard, thanks for your answer. I know what you mean. With geo detection, people would still be able to choose the language, only certain contents like a text element or a subpage, would be hidden, without their actual knowing.

I still wonder how I would set up an URL segment like /che or /ger before the language segment /de or /fr set by the multilanguage support module, without altering the page tree?!

Link to comment
Share on other sites

I think even if that is not a scenario that's built into PW you have many options to solve it. It all depends on your exact needs.

One option could be to reflect the geographic entities in the page tree, so you'd have a page /germany for the german part and /france for the french part etc. That would have the benefit that routing is built in, but if you had pages to share across several countries you'd have to either copy content or use a workaround. For example you could create a page of type "reflectionpage" or similar with only a single page reference field and then you could make /germany/foo reflect the content from /france/foo; I'm not sure how to handle different languages then in this case, but there's always a way in PW 🙂 

Another option could be to use the same pages with an identical pagetree and then assign pages to different units/regions. That would mean you create a page /foo and you assign it to "Germany" and "France". Then you could alter the page path with hooks and build custom menus and custom routing reflecting that differences. See https://processwire.com/talk/topic/1799-routes-and-rewriting-urls/ for example.

I think you have to carefully analyse the exact requirements and weigh pros and cons of each approach and then decide wich route to take 🙂 Good luck, sounds like an interesting project! 

 

Link to comment
Share on other sites

These are some good inputs, thank you @bernhard. I'm evaluating all options with my customer. Also on board is the option «Sparfux» where I ask users to choose their country and language in the menu and then simply add an url parameter like ?home=fr.

If I learn how to build modules one day this could be my first project =D

By the way, here's a good example of what I'm talking about (Switzerland has two options ch-de and ch-fr, Austria has none = at): https://www.siemens-healthineers.com/de-ch

Link to comment
Share on other sites

3 minutes ago, nuel said:

Actually that site does not work 😄 I chose AT first, then visited https://www.siemens-healthineers.com/at/clinical-specialities (AT), then changed back to DE-CH https://www.siemens-healthineers.com/de-ch/clinical-specialities and there all menu items lead me back to AT 😛 

7 minutes ago, nuel said:

Also on board is the option «Sparfux» where I ask users to choose their country and language in the menu and then simply add an url parameter like ?home=fr.

Such a complex project/setup combined with a sparfux/quick-and-dirty solution sounds like trouble in the long run 😉 It sounds like this project is one of those where all the time and effort that you put into it upfront will pay off later.

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...