Switch modx formIt language

339 Views Asked by At

Site has multiple contexts and languages (ru, en, de,...).

<form action="/" method="post" name="video" class="ajax_form white-popup-block">
    <input type="text" name="name" id="name" value="[[!+fi.name]]" />
    <span class="error error_name">[[!+fi.error.name]]</span>
    <input type="text" name="email" id="email" value="[[!+fi.email]]" />
    <span class="error error_email">[[!+fi.error.email]]</span>
    <input type="submit" value="[[%form.send?Topic=`label`]]" class="f-bu f-bu-default" name="video-yes" id="yes_btn" />
</form>

How to do that in all contexts, except 'ru'? The language form was in English initially. Thanks.

1

There are 1 best solutions below

0
On

Maybe you can create a snippet and call this in the top of your page:

$modx->setOption('locale', '[[++cultureKey]]');

Now, add a context key to every context named 'cultureKey' and set the desired language code (en, de, ru)