We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36931
    • 206 Posts
    Dear all,
    I am back with modx and I have to install Babel on Revo 2.5
    I have once installed Babel on Rveo 2.2 but the manager panel has changed and I have a doubt it my babel setup is correct.

    I followed that exemple and my notes

    First
    I edited and add the followinf to my htaccess file:
    RewriteEngine On
    RewriteBase /
    
    # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www.mywebsite\.ch [NC]
    RewriteRule (.*) http://www.mywebsite.ch/$1 [R=301,L]
    
    # BABEL
    # redirect all requests to /de/favicon.ico and /nl/favicon.ico
    # to /favicon.ico
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(fr|it|de)/favicon.ico$ favicon.ico [L,QSA]
    							  
    # redirect all requests to /de/assets* and /nl/assets* to /assets*
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(fr|it|de)/assets(.*)$ assets$2 [L,QSA]
    							 
    # redirect all other requests to /de/* and /nl/*
    # to index.php and set the cultureKey parameter
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(fr|it|de)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]
    


    Seocndely
    I created two new context and I create 4 contect setting for each context (see picture)
    (the site_start has to be changed after creating the translating page)

    Third
    I add the gateway as a plugin and I replace nl with it en en with de
    <?php
    			if($modx->context->get('key') != "mgr"){
    				/* grab the current langauge from the cultureKey request var */
    				switch ($_REQUEST['cultureKey']) {
    					case 'it':
    						/* switch the context */
    						$modx->switchContext('it');
    						break;
    					case 'de':
    						/* switch the context */
    						$modx->switchContext('de');
    						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']);
    			}
    


    Forth
    I installed Babel and I saved 'web,it,de' as Contect key in option, before click on Install

    Finally
    I added this in my template
    <ul>[[BabelLinks]]</ul>
    <ul>[[BabelLinks? &showUnpublished=`1`]]</ul> <!-- for testing -->
    



    I have not created translated page from manager.

    Quastion 1
    If I read my note old of 2 years (may more), I wrote to edit the gateway plugin and select 'OnHandleRequest'. Must it be done on 2.5? The tutorial does not that!

    Question 2
    My web page does not display the menu language! Is because I have not created translate page or because I missed something to do?

    Question 3
    What baout 'Load only'?

    Last question
    Now, in Manager, the is a new menu 'Extras->Babel'. On my previous MODx 2.2 there is not that menu.
    What is that new menu? Is a central point to see all translated pages? etc.. Should I create my translated page from that menu or it's the same if I create from a ressource?

    Many thank for your help and have a nice evening

    Cheers
      • 36931
      • 206 Posts
      Regarding the htaccess file, we have to comment those line
      # The Friendly URLs part
      
      # 3 line are comment because of babal
      #RewriteCond %{REQUEST_FILENAME} !-f
      #RewriteCond %{REQUEST_FILENAME} !-d
      #RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

      becauase we added new line for babel.

      But my language menu is still not displayed shocked(