qtranslate custom menu

for anyone having problem with qtranslate and wordpress menu with custom links reverting to the default language you can solve the problem like this:
in used theme's file functions.php add below code before
in used theme's file functions.php add below code before
- Cod: Selectaţi tot
?>
- Cod: Selectaţi tot
function vmf_menu_links($items, $args) {
$arraymeniuri=array(64,65,66,67); //menu ids with language problem
if(qtrans_getlanguage() == 'en)
{
return $items; //if is default en language then return as is
}
foreach ($items as $item) {
if (in_array($item->ID,$arraymeniuri))
{
$item->url = $item->url.'&lang=ro'; //add lang parameter to url
}
}
return $items;
}
add_filter('wp_nav_menu_objects', 'vmf_menu_links', 10, 2);