Answer the question
In order to leave comments, you need to log in
Multilanguage in modx?
You need to make a site on modx - there is no problem with this, since the engine is absolutely wonderful, flexible and everything. But here's the problem with making it multilingual.
The easiest option is to duplicate resources, for example, we created the avalon.html page in the ru/ subsection and then we make the de/avalon.html page. But this is easy for me, but not for the future owner of the site, for him it will be an unnecessary trouble. Therefore, it must be done kosherly.
Found three options:
Answer the question
In order to leave comments, you need to log in
as an option (I would not bother and do so)
I would simply create tv en, into which I would shove the translation into English, into tv de - I would shove Deutsch.
I would make a snippet that the user agent looks at. Depending on the language of the user's browser, you can give the desired TV. and if you need to switch the language, then do something like site.com/page.html?lang=de
so if there is a lang variable, then we give the language that is in lang, if not, then the one that the browser reported. if it was not possible to recognize the browser language, then we give the default language. By the way, yes, site.com/page.html?lang=de with the help of simple rewrite rules turns into some kind of site.com/lang/de/page.html thread and search engines love it))
Lingua is a great plugin.
Or localizator from our compatriot.
In the first one, you can manage additional fields.
In the second, only content and pagetilte and other standard fields.
I understand that the question is outdated for the author of the topic, but maybe it will be useful to someone.
My task was a little more difficult - to make multi-site in the admin panel and multi-language on each site. How did I implement it (in this I admire the flexibility of MODX, because there was even a choice - how to do it)
Multi-domain is implemented through contexts - this is an internal feature of the system. But multisite through Xlexicon. It just adds field translations to each page and shows the correct translation depending on which language is selected by the user. And the templates and all plugins/snippets are used the same, service translations are stored in dictionaries - this is also a built-in MODX feature.
"Babel and xlexicon - there is a problem with contexts"
I would not say that there are a lot of problems. I set up multilanguage always in conjunction with Babel + Contexts. It is very convenient to work with such a site in the future. Here is a detailed instruction on setting up contexts and creating multilingualism in general.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question