We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15001
    • 697 Posts
    Hello,
    As working on Easy2Gallery to make it multilingual,
    I would like to add a new parameter "lang" to e2g snippet calls (Easy 2 Gallery).
    [!easy2? &lang=`fr` &gid=`2` &rgid=`2` ...!]</div>
    [!easy2? &lang=`de` &gid=`2` &rgid=`3` ...!]</div>
    [!easy2? &lang=`en` &gid=`2` &rgid=`4` ...!]

    Around line 25 of file assets/modules/easy2/includes/configs/snippet.params.easy2gallery.php
    I added this:
    $e2gsnip_cfg['lang'] = (!empty($_GET['lang']))? $_GET['lang'] : 'fr';


    I also modified the code in assets/modules/easy2/includes/classes/e2g.snippet.class.php
    and could check that it was able to access $e2gsnip_cfg['lang'].

    The issue is that $e2gsnip_cfg['lang'] is always initialized with 'fr'.
    I also tried $_POST['lang'] instead of $_GET.

    How should I edit the code so that the snippet retrieves the value passed in parameter &lang?
    Thanks.

    This question has been answered by breezer. See the first response.

    • discuss.answer
      • 4041
      • 788 Posts
      Maybe try this:

      $e2gsnip_cfg['lang'] = (!empty($lang))? $lang : 'fr';
        xforum
        http://frsbuilders.net (under construction) forum for evolution
        • 15001
        • 697 Posts
        Quote from: breezer at Aug 29, 2015, 11:30 PM
        Maybe try this:
        $e2gsnip_cfg['lang'] = (!empty($lang))? $lang : 'fr';
        Thanks a lot, it works perfectly!