We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25910
    • 26 Posts
    Babel creates linked documents cross your different contexts. So you can easily navigate through your translations. You can also configure the template variables (TV) you want to «follow» when saving the document in the main context. For example, when you modify the value of a TV in a context, modifications will also occur in the other contexts.



    Download here:
    http://modxcms.com/extras/package/?package=757

    please test it, love or hate it, and comment here:
    http://modxcms.com/forums/index.php?topic=57291
      • 19534
      • 183 Posts
      A new totally reenginered version of this great extra is now available

      Extras: http://modxcms.com/extras/package/?package=781
      GitHub: https://github.com/mikrobi/babel

      Cheers,
      Jakob
        Add-On to easily manage your multilingual sites: Babel
        • 37582
        • 65 Posts
        Hey,

        this is really a great plugin! MODx is outstanding and with a good language support it will stand even more out of the crowd because most CMS do not support multiple languages.

        Now, I want to offer my help in the development of Babel. The company I work for is currently expanding and what we need is a localized and internationalized website that is easy to maintain. I think Babel is a good start, but we need localization support also. Therefore I am going to have a look at this topic very soon.

        Would be great if we could collaborate.

        Greetings
        Chris
          • 38599
          • 3 Posts
          I,ve lost 2 days for cofigure Babel and Login snippets. I started with cofigure Babel with folders: website.com/en website.com/de for multilingual. Babel was working, but Login worked just in one language.
          After 2 days Googling i didn't make it working together and change it to subdomains en.website.com de.website.com and Login works for both...

          So dont waste your time for subfolders smiley [ed. note: gconcept last edited this post 12 years, 2 months ago.]
            • 18985
            • 29 Posts
            I created a snipped that works almost exaclty like BabelTranslation.
            The difference...

            input id's comma-seperated, output translated id's comma-seperated.
            Other parameters are the same.

            Example: [[BabelResourceIdArray? &resourceIds=`1,2,3,4,5` &contextKey=`[[++cultureKey]]`]]

            Code:
            <?php
            $babel = $modx->getService('babel', 'Babel', $modx->getOption('babel.core_path', null, $modx->getOption('core_path') . 'components/babel/') . 'model/babel/', $scriptProperties);
            
            if (!($babel instanceof Babel))
                return;
            
            /* be sure babel TV is loaded */
            if (!$babel->babelTv)
                return;
            
            /* if context is NL (default language, here it's nl) return resourceIds */
            if ($contextKey == 'nl') 
                return $scriptProperties['resourceIds'];
            
            /* get snippet properties */
            if (!empty($scriptProperties['resourceIds'])) {
            
                $contextKey = $modx->getOption('contextKey', $scriptProperties, '');
                $showUnpublished = $modx->getOption('showUnpublished', $scriptProperties, 0);
            
                $ids_array = explode(',', $scriptProperties['resourceIds']);
            
                $resourceId = '';
                foreach ($ids_array as $id) {
                    $id = intval($modx->getOption('resourceId', $scriptProperties, $id)) . ',';
                    $linkedResources = $babel->getLinkedResources($id);
            
                    if (isset($linkedResources[$contextKey])) {
                        $resource = $modx->getObject('modResource', $linkedResources[$contextKey]);
                        if ($resource && ($showUnpublished || $resource->get('published') == 1)) {
                            $resourceId .= $resource->get('id') . ',';
                        }
                    }
                }
                $resourceId = rtrim($resourceId, ',');
                return $resourceId;    
            } else {
                return null;
            }