Thanks, can you help a bit more and tell me where I should load/place this snippet?
I broke my DEV by activating it on page load...
I already use a gateway plugin:
<?php
//make sure the plugin does not run on the mgr context (the manager)
if ( $modx->context->get( 'key' ) != 'mgr') {
/**
* grab the current context from the request "c" parameter (or context_param_alias from system settings)
* the alternative .htaccess friendly URL rewrite rule must be activated
*/
$cntxt_param = $modx->getOption('context_param_alias', null, 'c');
if ( isset( $_REQUEST[$cntxt_param] ) && $_REQUEST[$cntxt_param] != '' ) {
switch ( $_REQUEST[$cntxt_param] ) {
case 'en':
//switch the context
$modx->switchContext('web');
//set the cultureKey
$modx->setOption('cultureKey', 'en');
break;
case 'fr':
$modx->switchContext('fr');
$modx->setOption('cultureKey', 'fr');
break;
case 'de':
$modx->switchContext('de');
$modx->setOption('cultureKey', 'de');
break;
case 'it':
$modx->switchContext('it');
$modx->setOption('cultureKey', 'it');
break;
default:
// Set the default language/context here
break;
}
}
}
This works fine, Babel works, and if I change my browser language to German,
http://mysite.com gets redirected to
http://mysite.com/de/
The problem is that a link
http://mysite.com/signup always goes to
http://mysite.com/en/signup even if the language setting is German...
In Redirector the link signup is redirected to signup.html but it is always selecting the EN language....
[ed. note: ThaClown last edited this post 13 years, 10 months ago.]