Skip to content

Commit

Permalink
Front end menu items translated in error
Browse files Browse the repository at this point in the history
PR joomla#13606 introduced translatable admin menu item creation but the code didnt check if the menu item was for the frontend or the admin before doing the translation

### Test Instructions
1. Install any additional language eg italian
2. Create a menu item called "Sun"
3. On the list of all the menu items you will see it is displayed as "Dom" - the italian translation
4. Enable language debug
5. On the list of all the menu items you will see all your menu item titles are surrounded by ?? - to indicate no translation found -  except for "Dom" which has ** instead to show it has been translated
6. Apply this PR
7. Sun still says Sun
8. There are NO ?? or ** when in language debug mode
9. Bonus - check a custom admin menu item and you will see it can be translated
  • Loading branch information
brianteeman committed Feb 28, 2018
1 parent c8b2121 commit 33904bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions administrator/components/com_menus/models/items.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ public function getItems()
{
$items = parent::getItems();
$lang = JFactory::getLanguage();
$client = $this->state->get('filter.client_id');

if ($items)
{
Expand All @@ -531,7 +532,10 @@ public function getItems()
}

// Translate component name
if ($client === 1)
{
$item->title = JText::_($item->title);
}
}
}

Expand Down

0 comments on commit 33904bf

Please sign in to comment.