mirror of
https://github.com/joomla/joomla-cms.git
synced 2024-05-28 16:01:28 +00:00
[4.4] Shorten the menu title to 16 for language suffix (#41846)
* Shorten the menu title to 16 for language suffix * language suffix after shortening * Update plugins/sampledata/blog/src/Extension/Blog.php * add lanuage suffix to the title * Update plugins/sampledata/blog/src/Extension/Blog.php * Fix PHPCS empty line after for loop start --------- Co-authored-by: Quy <quy@nomonkeybiz.com> Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
This commit is contained in:
parent
5fae4e0300
commit
b43df5b4ea
|
@ -799,16 +799,16 @@ final class Blog extends CMSPlugin
|
|||
$menuTypes = [];
|
||||
|
||||
for ($i = 0; $i <= 2; $i++) {
|
||||
$title = $this->getApplication()->getLanguage()->_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_' . $i . '_TITLE');
|
||||
|
||||
$menu = [
|
||||
'id' => 0,
|
||||
'title' => $this->getApplication()->getLanguage()->_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_' . $i . '_TITLE') . $langSuffix,
|
||||
'title' => $title . ' ' . $langSuffix,
|
||||
'description' => $this->getApplication()->getLanguage()->_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_' . $i . '_DESCRIPTION'),
|
||||
];
|
||||
|
||||
// Calculate menutype. The number of characters allowed is 24.
|
||||
$type = HTMLHelper::_('string.truncate', $menu['title'], 23, true, false);
|
||||
|
||||
$menu['menutype'] = $i . $type;
|
||||
// Calculate menutype. The maximum number of characters allowed is 24.
|
||||
$menu['menutype'] = $i . HTMLHelper::_('string.truncate', $title, 16, true, false) . $langSuffix;
|
||||
|
||||
try {
|
||||
$menuTable->load();
|
||||
|
|
Loading…
Reference in New Issue
Block a user