MODX Community

Login/register multilingual site

Hello there!

I’m building a multi-language site with more than 10 different languages.
I’m using the Login extra to login/register users, my first set up includes the following resources:

Login
Members Page
Register
Request Pending
Registration Handler
View Profile
Update Profile
Forgot Password
Reset Password Handler

All my templates are build with lexicon parameters.

My question is: do I need to duplicate all this resources on every context?
If (the answer is yes) {
what about the handlers? do I need to duplicate the handlers pages too?
}
Or there is any way to use the same resources for all context?

Thanks!

What we’ve done is use a symlink for context specific pages and use lexicon strings to translate them on the fly.

But in that case once you see the page, that page should be inside a context (for example: web) and the lexicon are going to be displayed in that context language.

How can you modify the language of the forms if they are attach to one context?

Well, on my particular situation, I had to duplicate the pages with the login / register pages and used lexicon entries as explained by himmdesign.

Regarding the handlers, I created them on web context as the Login snippet redirects to the page you defined on it. Meaning that on each language you can define the landing id after login.

Mind that I am using XRouting. The web context just has a page that uses a browser language detector, and redirects to the correct language context, or to the English context if none is detected. Meaning that you can use web context for these kind of specific processors that are language agnostic.

Hope that helped somehow.
Cheers

Look at lexicons https://docs.modx.com/current/en/extending-modx/internationalization

Here is an example of how we handle the phone number field in a form. Then in the lexicons we have definitions for everything. Then a single chunk is used on all form pages on different contexts.

	<div class="column large-4">
  [[!field? 
&name=`phone` 
&class=`medium input-text`
&label=`[[%form-phone? &namespace=`languages`]]`
     ]]
</div>