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

    I repost a specific question here because the WebloginPE original thread is quit filled.

    As I do not see the real interest of $lang parameter because it seams to concern only the registration process and nothing else
    When jul says :

    you can either translate the whole webloginpe.templates.xx.php
    I just can’t see which file you’re talking about.
    I can see only webloginpe.templates.php but nothing else.

    Do you mean I can write a webloginpe.templates.fr.php ?and it will be used if I call the snippet with &lang=`fr` ?
    (seams not).

    thank you

      Schtroumpf Grognon - Grouchy Smurf
      ---------------------------------
      Faites pas attention.. - Don't pay attention
      http://www.dzi-neo.net
      • 15001
      • 697 Posts
      Do you mean I can write a webloginpe.templates.fr.php Huh and it will be used if I call the snippet with &lang=`fr` ?

      Yes.
      At line 28 of webloginpe.snippet.php, check that you have:
      include MODX_BASE_PATH.'assets/snippets/webloginpe/webloginpe.templates.'.$lang.'.php';


      The "xx" in webloginpe.templates.xx.php represents the two-letters language code.

      Against a small contribution to translation costs, I can send you a frenchified version of WebLoginPE. You can contact me by email if interested.
        • 8790
        • 526 Posts
        I have this code at line 52.

        (As got from the svn release 2 days ago 1.31 instance3)

        In the snippet code their’s strictly nothing that deal with a &lang parameter regarding a potential localized webloginpe.template.XX.php files.
        only the basic include of :lang/XX.php but I nerver been able to see a simple word of tranlation in register form.

        So I hacked the instance3 file (around lien 50) with something like this:
         include_once MODX_BASE_PATH.'assets/snippets/webloginpe/webloginpe.class.php';
            //  CHANGE include MODX_BASE_PATH.'assets/snippets/webloginpe/webloginpe.templates.php';
                if (file_exists(MODX_BASE_PATH.'assets/snippets/webloginpe/webloginpe.templates.'.$lang.'.php'))
                {
                    include MODX_BASE_PATH.'assets/snippets/webloginpe/webloginpe.templates.'.$lang.'.php';
                }
                else
                {
                    include MODX_BASE_PATH.'assets/snippets/webloginpe/webloginpe.templates.php';
                }
           //END OF CHANGE     
            if (file_exists(MODX_BASE_PATH.'assets/snippets/webloginpe/lang/'.$lang.'.php'))
                {
                    include_once MODX_BASE_PATH.'assets/snippets/webloginpe/lang/'.$lang.'.php';
                }
                else
                {
                    include_once MODX_BASE_PATH.'assets/snippets/webloginpe/lang/en.php';
                    $modx->setPlaceholder($id.'wlpe.message', $wlpe_lang[105]);
                    print '[+'.$id.'wlpe.message+]';
                }
                
        

        in order to call a localized full template file.
          Schtroumpf Grognon - Grouchy Smurf
          ---------------------------------
          Faites pas attention.. - Don't pay attention
          http://www.dzi-neo.net