secondary menu translation

dev.xiligroup is being renovated Forums xili-language plugin secondary menu translation

This topic contains 5 replies, has 2 voices, and was last updated by  xiligroup dev 11 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3658

    xiligroup dev
    Keymaster

    what is your current theme ?

    #3659

    Anonymous

    I’m using your 2012 child theme.

    Also I noticed that on the ‘xili options’ admin page, the « Enable (or not) language instantiation for these registered menus » doesn’t work. No matter what combination of checkboxes I check, nothing changes. I have 2 checkboxes, ‘primary’ and ‘secondary.

    Thanks

    #3661

    xiligroup dev
    Keymaster

    Currently 2012 registers only one menu location (see functions.php). And the free child example is ready to clone this ‘primary’ only…
    Even if the xili-options detects that you have add one (secondary)… the default cloning function « clones » the first one…
    If you are php wp developer, it will be easy to improve this example…
    Apologize but free version offers limited features…

    If you need xili-language premium services, tell me via form at https://dev.xiligroup.com/?page_id=2436

    M.

    #3662

    Anonymous

    Thanks for your help. I managed to figure it out 🙂 If anyone else has this problem, all you need to do is find the function ‘xili_create_menu_locations’ in the child theme’s functions.php. Then just loop through the available menu locations before looping through the languages.

    Or, you can just paste the following after the existing foreach loop.

    $twoloc = $menu_locations_keys[1]; // primary
    foreach ( $language_slugs_list as $slug ) {
    $two_menu_location = $twoloc.'_'.$slug ;
    if ( $slug != $default ) {
    register_nav_menu ( $two_menu_location, sprintf( __('%s for %s','twentytwelve'), $menu_locations[$twoloc], $slug ) );
    }
    }

    Note that for a third menu location, you’d just copy this again and edit as necessary. Hope this helps

    #3668

    xiligroup dev
    Keymaster

    Excellent ! You can also make a loop with each $menu_locations_keys – so the code become more versatile !

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.