Multi-language support


#1

Good morning tyler, on monday morning I will talk with a potential new customer who needs a slightly larger multi language site. I guess anymod is rather not yet ready for that, am I right? We discussed this some 6 month ago and I remember there was some scope related issue with the solution you suggested. Have a nice start into the week!


#2

Hi Stefan, you can set up multi-language mods by adding separate fields for each ( content_de , content_en , etc). However it is somewhat manual as you may remember


#3

Hmm, no I dont really remember why it was a manual process to establish a language-switch. For three languages I will need to create each field three times, in oder to make sure three languages will be considered. That would be fine with me. I guess I might need to additionally inject some code into each Mod’s-JS-Section to ensure the window.url will be analysed: in oder for the language-switch to take effect. Is that correct? Or was there something more I would need to consider? I would probably want to create a cookie to ensure the language-Setting will remain persistend across all follow-up-Pages?


#4

Hi Stefan, yes you are exactly right. That is how you could accomplish multi-language editing. Here’s an example: https://anymod.com/mod/anrdm :+1:


#5

Another way (that avoids so much code in each mod) is to add an event listener, then you can broadcast to all mods at the same time. Here’s an example: https://anymod.com/mod/dbdnb