En and es versions of pages


(Nic Hubbard) #1

Matrix Version: 5.4.3.1

I am looking for the best way to have two versions of a page, English and Spanish. Ideally the Spanish versions would be under /es and English under /en.

Does Matrix have a built in way of doing this? Or is this what Personas are for as a way to change the content for the user based on their language settings?


(Nic Hubbard) #2

No one else is doing this?


(Tbaatar) #3

I use the context detection based on user language.


#4

Did a dual language site back before we had Persona support so cannot advise directly on that. It might be difficult to create a Persona based on the accept language header given you need to parse it, not sure if that is native to Personas whereas it definitely is for contexts: https://matrix.squiz.net/manuals/contexts/chapters/context-configuration-screen

I believe at the time I looked into it I decided to not use contexts as it was an instance wide setting when we only needed it on one (relatively small) site, it had caching implications, and added editorial complexity. It was easier in my instance to just duplicate the content (/en and /fr roots). YMMV

Each language root used a separate design customisation with any language specific elements customised.
I also added a language switcher on each page to its equivalent, which was just a hyperlink to a Related asset metadata. This wasn’t a chore as the site was small, on a larger site I would simply link to the other language root.