Multilingual websites and content negotiation

We're looking at some development work where we plan to demonstrate the options for having content in the two written official New Zealand languages - English and Te Reo Maori.


In the past we've used content negotiation with Apache to supply a page in the appropriate language dependant on the browser language setting. If I setup content negotiation for languages on our dev instance of Matrix, does anyone have advice or experience on how to get Matrix to serve the appropriate content?

[quote]
We're looking at some development work where we plan to demonstrate the options for having content in the two written official New Zealand languages - English and Te Reo Maori.



In the past we've used content negotiation with Apache to supply a page in the appropriate language dependant on the browser language setting. If I setup content negotiation for languages on our dev instance of Matrix, does anyone have advice or experience on how to get Matrix to serve the appropriate content?

[/quote]



Have you looked into using the Context Functionality, that came into Matrix in version 3.24.x it allows you to have all of your assets in multiple languages

http://matrix.squiz.net/__data/assets/file/0004/55462/MySource-Matrix-Contexts-Manual_v3.26a.pdf

There's a couple of ways you could approach this.


If you have exactly the same site structure and you just want to maintain one website where everything is identical apart from the content text, then you can use a relatively new feature of Matrix: contexts.



This feature allows you to have different values for everything in your system. You can create different "contexts" for each language. When you switch contexts (in the backend), any changes you make to assets in terms of content and attributes will be saved only in that context.



You can then serve different contexts based on site URL, HTTP headers or whatever you like. But note that you can't create separate assets or IA in different contexts.



Alternatively, if you need a different site structure or may need to have different IA's for different language sites in the future, then you should steer away from contexts and stick with the creation of separate sites with different content. Ensure your system is in UTF8 encoding, and Matrix is very capable of having content in different languages.



Regardless of how you choose to approach it, it is easy to ensure that the right content comes up based on the browser's setting. You can do this from within Matrix if you use contexts, but I'd recommend doing this in Apache and redirecting users to the right language URL based on the request headers. This can be done easily with mod_rewrite by checking the HTTP request's "Accept-Language" header.



For example, you could have the redirect on your home page (www.foo.com), and then redirect users like:



  • http://www.foo.com/en/
    [*]http://www.foo.com/de/
    [*]http://www.foo.com/fr/


Where each one of those is either a different Site asset in Matrix, or a single site with different base-contexts.

Thanks for the responses - Contexts sound interesting and worth investigating, although we'll need to have our Matrix instances updated first (they're both on 3.22).