Plugin YammYamm

Big update ! A few bug corrections and now widget compatible !

Download : Plugin YammYamm 0.6 for Wordpress

YammYamm (yet another multilingual manager x2). You create a top category and a top level page for each language. In the options panel, you set the languages. When you create an article, make it under the language top category. When you create a page, make it under the language top page. Then you call the appropriate functions in your template for language selection and navigation display. That's it.

Usage :

  1. Unzip then upload the yammyamm folder in the "plugins" folder
  2. Create a top-level category for each language.
    Exemple : "Français" and "English".
  3. Create a top-level page for each language.
    Exemple : "Accueil" and "Welcome".
  4. Go to your space, then "Manage", then "YammYamm".
  5. For each language do something like this :
  6. Go to your space, then "Options", then "YammYamm" and set your options
  7. Then you must tell your template to use YammYamm :

There are 2 files to edit:

  1. sidebar.php :

    Edit your sidebar.php then call the function "yy_menu($args_page,$args_blog);" instead of "wp_list_cats" and/or "wp_list_pages" like this :

    <ul>

    <?php if(function_exists('yy_menu')) yy_menu('sort_column=menu_order&title_li=','title_li=&hierarchical=1'); ?>

    </ul>

    Explanation :

    The function will display the menu (with "ul/li" tags) automagically depending on whether the visitor is on a page or a post, and will guess the language too.

    1. The first argument is equivalent to the internal fonction "wp_list_pages"
    2. The second argument is equivalent to the internal fonction "wp_list_cats"

    Update : To show always and only the blog categories, dont fill the "$args_page" argument, and do the contrary to show only the pages :

    <ul>

    <?php if(function_exists('yy_menu')) yy_menu('','title_li=&hierarchical=1'); ?>

    </ul>

  2. header.php :
    1. At the very beginning add :

      <?php if(function_exists('yy_redirect')) yy_redirect(); ?>

      It will detect the language from the browser and redirect to the home page og this language.

      Update : In the options panel, you can choose whether to set the top page or the top category as the home of your website.

    2. When you want to add a language selection menu :

      <?php if(function_exists('yy_lang_menu')) yy_lang_menu("lang_menu"); ?>

      This will output :

      <li id="fr_FR" class="lang_menu current_page_item">

      <a href="http://www.jide.fr/francais/">

      <span>francais</span>

      </a>

      </li>

      (etc...)

One of the biggest part of this update is that there is now a sidepanel in the admin page :

When you write a blog post, if no langu_age is set for that post, all the categories will be shown. If you set a language, only the sub-categories will display :


That is the same for the pages. If no language is set, all the pages will be shown. If you choose a language, only the children pages will display :


Roadmap :

  • bug of "ALTER TABLE"
  • automatise categories and pages creation for languages
  • automatise languages creation + flags
  • make shortcuts to create modify etc in the sidepanel
  • link posts and pages in different languages
  • link categories
  • use options rather than a table
  • handle rss correctly with languages
  • make compatible with widgets

Download : Plugin YammYamm 0.6 for Wordpress