From 35a95d9ee217cccf44cbe4fe066fe706cf84eac2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Oct 2008 00:24:56 +0000 Subject: [PATCH] Fix: Duplicate translation in menu --- htdocs/core/menubase.class.php | 38 ++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/htdocs/core/menubase.class.php b/htdocs/core/menubase.class.php index 8816392237d..724b68fadcf 100644 --- a/htdocs/core/menubase.class.php +++ b/htdocs/core/menubase.class.php @@ -594,22 +594,30 @@ class Menubase // Define $chaine $chaine=""; $title=$langs->trans($objm->titre); - if ($title == $objm->titre && ! empty($objm->langs)) - { - $langs->load($objm->langs); - $title=$langs->trans($objm->titre); + if ($title == $objm->titre) // Translation not found + { + if (! empty($objm->langs)) + { + // If it seems there no translation, we load language file defined in menu entry table + $langs->load($objm->langs); + } + + if (eregi("/",$title)) + { + $tab_titre = explode("/",$title); + $chaine = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]); + } + else + { + $chaine = $langs->trans($title); + } + } + else + { + $chaine=$title; } - if (eregi("/",$title)) - { - $tab_titre = explode("/",$title); - $chaine = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]); - } - else - { - $chaine = $langs->trans($title); - } //print "x".$objm->titre."-".$chaine; - + // Define $right $perms = true; if ($objm->perms) @@ -626,7 +634,7 @@ class Menubase if ($objm->rowid != $oldrowid && $oldrowid) $b++; // Break on new entry $oldrowid=$objm->rowid; - + $tabMenu[$b]['rowid'] = $objm->rowid; $tabMenu[$b]['mainmenu'] = $objm->mainmenu; $tabMenu[$b]['titre'] = $chaine; // Title