This question has been answered by BobRay. See the first response.
<base href="[[!++site_url]]" />
Make sure that the base href tag in all your templates is called uncached:
<base href="[[!++site_url]]">
Is this for the Manager login or the Login snippet?
$this->modx->lexicon->load('login:default');
I think I see the problem. Surprisingly, the Login class does this:
$this->modx->lexicon->load('login:default');
There's no language specified, so it will use the current language. Have you created cultureKey Context Settings for each context?
<?php if($modx->context->get('key') != "mgr"){ switch ($_REQUEST['cultureKey']) { case 'zh': $modx->switchContext('zh'); break; case 'es': $modx->switchContext('es'); break; default: $modx->switchContext('web'); break; } }
$modx->lexicon->load('zh:login:default');
&language=`[++cultureKey]]`
$ck = $modx->getOption('cultureKey', null, 'en'); $lang = $modx->getOption('language', $scriptProperties, $ck, true); $modx->lexicon->load($lang . ':login:default');
How about adding a language load in the switch statement in your plugin:
$modx->lexicon->load('zh:login:default');
You might have to comment out the lexicon load line in the Login class file for it to work.
Would it solve your problem if the login snippet had a &language property to use like this?
&language=`[++cultureKey]]`
Come to think of it, I think this would work -- replace the lexicon->load line in the Login class file with this (untested):
$ck = $modx->getOption('cultureKey', null, 'en'); $lang = $modx->getOption('language', $scriptProperties, $ck, true); $modx->lexicon->load($lang . ':login:default');
If that works, you wouldn't need the &language property unless you needed override the context's cultureKey setting.
If this last solution works, the Login extra code could be updated to include it.