WordPress.org

Ready to get started?Download WordPress

Forums

Ceceppa Multilingua
[resolved] How to translate custom menus ? (13 posts)

  1. ProgenicRo
    Member
    Posted 9 months ago #

    Hello.

    On my site, i'm using custom menu widget, and I can't figure it out how can I translate the menu from there.

    Can you give me a point ?

    Thanks in advance,
    Mihai

    http://wordpress.org/extend/plugins/ceceppa-multilingua/

  2. Alessandro Senese
    Member
    Plugin Author

    Posted 9 months ago #

    Hi,
    if you use the function "wp_nav_menu" items should be translated automatically.
    If that doesn't happen, you can use the function "cml_get_menu()" for get which menu to show.

    Example:

    $menu = cml_get_menu();
    wp_nav_menu(array('theme_location' => $menu));

  3. skublaka
    Member
    Posted 9 months ago #

    Hi,
    I have problem with starting, i managed to chose the languages English, Indonesian.
    But then noting i cant see flags in my menu, i cant even use widget.
    my web page is modistehawa.allalla.com
    please help me.
    P.S. i watched tutorial if u can make step by step one would be really nice thanks.

  4. Alessandro Senese
    Member
    Plugin Author

    Posted 9 months ago #

    If you want show available languages in you site you must edit your theme and add manually this function:

    <?php cml_show_langs() ?>

    I know it is not easy to do for beginner, but I'm working on next release and you can:

    1. Add flags in a float div and specify position via CSS
    2. Add language chooser to menu

    The next version will be available in a few days, I think Tuesday.

    Contact me if you need more help :)

  5. ProgenicRo
    Member
    Posted 9 months ago #

    Where should I add this code ? :

    $menu = cml_get_menu();
    wp_nav_menu(array('theme_location' => $menu));

  6. Alessandro Senese
    Member
    Plugin Author

    Posted 9 months ago #

    I need more info.

    Which is theme and which is the "custom menu widget" that are you using?

    For @skublaka

    with version 1.0 you can add flags also to menu, the options are available in settings page.

  7. skublaka
    Member
    Posted 9 months ago #

    hi,
    The them is responsive, widget menus sorry i did not understand.
    Did you ment all widget that i am using or the menu i created ?
    I just inserted langues i wish to have English and Indonesian,
    Next step i am to totally confused what to do.

  8. Alessandro Senese
    Member
    Plugin Author

    Posted 9 months ago #

    Hi, skublaka
    first part of my last message isn't for you but for ProgenicRo :).

    If you want to show flags in your menu, you must enable option in "Settings" page of my plugin.
    The option is "Add flags to menu:"

    Let me know if you need more help :)

  9. ProgenicRo
    Member
    Posted 9 months ago #

    Hi there.
    I use Gantry Framework, and the Custom menu widget is actually Gantry Menu Widget, is a bit modified..

    Thanks in advance.

  10. skublaka
    Member
    Posted 9 months ago #

    yes i want to know how to make a translation page for example.
    if i want to translate english, serbian ....
    hello is zdravo i wish to that be on my page if i click the falag plese can u make tutorial how to make a multylangage page step by step thank you

  11. Alessandro Senese
    Member
    Plugin Author

    Posted 9 months ago #

    For ProgenicRo, please contact me here: http://www.ceceppa.eu/chi-sono

    For skublaka.
    Here you can find the videotutorial: http://www.ceceppa.eu/en/tutorials/wp/ceceppa-multilingua-how-to-use-and-configure-the-plugin/
    In the video I have used an old version of plugin because now when you choose to translate an post or page you must assign corrent language in the field:

    "Language of this post" or "Language of this page"...

    in the next few days I will update the tutorial and videos.
    If you need help you can contact me here: http://www.ceceppa.eu/chi-sono

  12. Alessandro Senese
    Member
    Plugin Author

    Posted 9 months ago #

    If you use Gantry Menu Widget:

    1) you must create a menu for each language.
    2) you must edit the file "plugins/gantry/widgets/menu.php". Replace the function "initializeMenu" with this:

    protected function initializeMenu($instance = null)
            {
                    $menu = null;
                    if (null == $instance) {
                            $instance = $this->getInstance();
                    }
                    if (array_key_exists("nav_menu", $instance) && function_exists('cml_get_menu_name')) {
                      $nav_menu = cml_get_menu_name($instance['nam_menu']);
                      $instance['nav_menu'] = $nav_menu;
                    }
                    if (array_key_exists($instance['theme'], self::$themes)) {
                            $theme_info = self::$themes[$instance['theme']];
                            $theme      = new $theme_info['class'];
                            $menu       = new GantryMenu($theme, $instance);
                            $menu->initialize();
                    } else {
                            $this->error_message = _g('MISSING_MENU_THEME_MESSAGE');
                    }
                    return $menu;
            }

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    Now all works correctly :)

  13. arseloni
    Member
    Posted 1 week ago #

    Hello Alessandro,
    Plugin through ceceppa Multilingua I can not figure out to translate featured posts.
    Can you help me, if you have any ideas?

    Best Regards,
    Arseloni.

Reply

You must log in to post.

About this Plugin

About this Topic