1. Go to ' Extras ', download and install ' Babel '.
2. Set up '. htaccess ' file, currently, and we Set up three languages:
Find ' # The friendly URLs part ' in your. htaccess/ht.access file, replace the existing code with:
# The friendly URLs part# Redirect all requests to/de/favicon.ico and/NL/favicon.ico# to/Favicon.icorewritecond%{request_filename}!-Drewritecond%{request_filename}!-Frewriterule^ (en|NL|DE)/favicon.ico$ Favicon.ico [L,QSA] # REDIRECT all requests to/de/assets* and/NL/assets* to/assets*Rewritecond%{request_filename}!-Drewritecond%{request_filename}!-Frewriterule^ (en|NL|de)/assets (. *) $ assets$2[L,QSA] # REDIRECT all and requests to/de/*and/nl/*# to index.php and set the Culturekey parameterrewritecond%{request_filename}!-frewritecond%{REQUEST_FILE NAME}!-drewriterule ^ (en|nl|de)? (. *) $ index.php?culturekey=$1&q=$2 [L,QSA]
Basicly, it just redirect to Favicon, assets folder & index.php to root directory.
Then if you have the ht.access, you need to the delete it and replace with. htaccess.
3. Go to System setting, set ' use friendly URL ' to ' YES ':
4. Create a new plugin call ' Gateway ':
<?PHPif($modx->context->get (' key ')! = "Mgr"){ /*Grab the current langauge from the Culturekey request Var*/ Switch($_request[' Culturekey ']) { Case' NL ':/*Switch the context*/ $modx->switchcontext (' Nederlands '); Break; Case' De ':/*Switch the context*/ $modx->switchcontext (' Deutsch '); Break; default:/*Set The default context here*/ $modx->switchcontext (' web '); Break; } /*unset GET var to avoid * appending culturekey=xy to URLs by*/ unset($_get[' Culturekey ']); }
5. Then click on ' System Events ' tab, scroll down to ' onhandlerequest ', select the checkbox.
6. Go to System ' contexts ', add contexts ' Deutsch ' & ' Nedelands ':
7. In the context, right click on ' Web ', select ' Update Context ', then Clicik ' Context Settings ' tab:
8. Add setting to it:
7. In ' Access Control List ', right click the ' (AnonyMouse) ', select ' Update user group ':
8. Reinstall the Babel to add de & NL into the language.
[MODx] 10. Using Babel for Muti-languages support