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

    I saw the Articles does not comes with a FR lexicon. I made some translations and uploads a FR folder to the Lexicon folder.
    The Manager now shows a FR choice in the lexicon menu for Articles.

    How can use it ?? I mean to setup the use BY DEFAULT of my FR lexicon

    Plus: according to the i18n doc :
    [[%key? &topic=`topicname` &namespace=`namespace_name` &language=`en`]]

    I tried in my chunks :
    [[%articles.posted_by &language=`[[++cultureKey]]
    and so on for each necessary keys.
    This is not interpreted (it outputs literally "%articles.posted_by &language=`fr" ).

    For the moment I have only web and manager contexts.
    web should be FR. If I add BABEL, I'll will add EN context.

    Thank you
      • 33976 ☆ A M B ☆
      • 571 Posts
      Salut smiley

      That might be a copy/paste mistake but you did not close your lexicon tag (`]] is missing after cultureKey).

      Hope that might help

      Edit :
      by the way, you might skip the cultureKey part. See a Login example that might "en-light" you [ed. note: romain last edited this post 14 years, 4 months ago.]
        • 36604
        • 268 Posts
        Thank you Romain but I don't know because it "felt in function".
        I created a EN context (like I was installing Babel) + a Lang gway plugin I used in a previous project (initialy found in an online Babel tutorial I'm not able to find again)

        Here's this gway code:
        <?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, 'cultureKey');  
                    if ( isset( $_REQUEST[$cntxt_param] ) && $_REQUEST[$cntxt_param] != '' ) {  
                        switch ( $_REQUEST[$cntxt_param] ) {  
              
                            case 'en':  
                            $modx->switchContext('English');  
                            break;  
              
                            //case 'de':  
                            //$modx->switchContext('Deutsch');  
                            //break;  
              
                            default:  
                            // nothing because web is default  
                            break;  
                        }  
                    }  
                }


        Now, for future purposes, Is Articles Babel compatible ??