Hi Nirmal and CdiEll,
Great plugin.
Here are some modifications to support several languaages (tested with Polylang).
In admin.php file, replace the wprmenu_general_settings_menu() function with the following code
function wprmenu_general_settings_menu() {
$options = get_option('wprmenu_options');
$menus = get_terms('nav_menu',array('hide_empty'=>false));
$languages = get_terms('language',array('hide_empty'=>false)); // get list available languages
foreach ($languages as $l){ // display a list box for each language
echo $l->name;
?>
<select name="wprmenu_options[menu<?php echo $l->term_id; ?>]" >
<?php foreach( $menus as $m ): ?>
<option <?php if($m->term_id == $options['menu'][$l->term_id]) echo 'selected="selected"'; ?> value="<?php echo $m->term_id ?>"><?php echo $m->name ?></option>
<?php endforeach; ?>
</select>
<?php
}
}
In the wprmenu_options_validate($input) function, change the commented lines below by the joined code :
//enabled / dispabled
//if(isset($input['menu'])) {
//$options['enabled'] = $input['enabled'];
//}
//section "General", option "menu"
//if(isset($input['menu'])) {
// $options['menu'] = $input['menu'];
// if($options['menu'] == false || $options['menu'] == null || $options['menu'] == 0 || $options['menu'] == '') $options['menu'] = '';
//}
$languages = get_terms('language',array('hide_empty'=>false)); // get list available languages
foreach ($languages as $l){
$var[$l->term_id] = $input['menu'.$l->term_id];
}
$options['menu']=$var;
if(isset($input['menu_symbol_pos'])) {
$options['menu_symbol_pos'] = $input['menu_symbol_pos'];
}
And to finish, update the wp-responsive-menu.php file, replace the
<ul id="wprmenu_menu_ul">
(from <ul ...>
to </ul>
) code with the folowing one :
<ul id="wprmenu_menu_ul">
<?php
$active_language_long = get_bloginfo('language');
$active_language = substr ( $active_language_long , 0, 2);
$available_languages = get_terms('language',array('hide_empty'=>false));
foreach ($available_languages as $l){
if ($l->slug == $active_language){
$active_language_term_id = $l->term_id;
}
}
$menus = get_terms('nav_menu',array('hide_empty'=>false));
if($menus) : foreach($menus as $m) :
if($m->term_id == $options['menu'][$active_language_term_id]) $menu = $m;
endforeach; endif;
if(is_object($menu)) :
wp_nav_menu( array('menu'=>$menu->name,'container'=>false,'items_wrap'=>'%3$s'));
endif;
?>
</ul>