We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49846
    • 22 Posts
    Hello,

    I have 3 different contexts, and I would like to create a bilingual replicate of each using the babel plugin. I have successfully done so for the first context in my root directory. The other contexts are in sub folders. I have created the gateway plugin as instructed from this tutorial: http://designfromwithin.com/blog/modx-multilingual

    I was wondering, do I just add the other contexts into the plugin, or do I need to create a separate one for each contexts?

    <?php
    if($modx->context->get('key') != "mgr"){
    /* grab the current langauge from the cultureKey request var */
    switch ($_REQUEST['cultureKey']) {
    case 'zh':
    /* switch the context */
    $modx->switchContext('chinese');
    break;
    default:
    /* Set the default context here */
    $modx->switchContext('web');
    break;
    }
    /* unset GET var to avoid
    * appending cultureKey=xy to URLs by other components */
    unset($_GET['cultureKey']);
    }
      • 29597 ☆ A M B ☆
      • 350 Posts
      In the tutorial I have a excemple for 3 languages and as you can see you can add more then one rule on the Plugin.

      Please post more info (htaccess and config settings for more help.
        MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
        DESIGNfromWITHIN, MPThemes and Any Screen Size
        Follow me on Twitter | Read my blog | My code on GitHub