When I am using a menu item of com_users for people to login and I use in the menu title for instance COM_COMMUNITY_LOGIN it is not translated, i see COM_COMMUNITY_LOGIN in the page title and in the breadcrumbs.
The translated text.
Changes that I made to fix this issue:
1: In components\com_users_views\login\view.html.php line 100:
$title = ($this->params->get('page_title', '');
$title = JText::_($this->params->get('page_title', ''));
This must be done for all menu items of com_users.
2: In modules/mod_breadcrumbs/helper.php at line 55:
$crumbs[$i]->name = stripslashes(htmlspecialchars($items[$i]->name, ENT_COMPAT, 'UTF-8'));
$crumbs[$i]->name = stripslashes(htmlspecialchars(JText::_($items[$i]->name), ENT_COMPAT, 'UTF-8'));
Why should a general feature like using langauge strings in menu item titles be limited to com_users only just because this is your use case? It would cause an inconsistency in behavior of menu item titles, which could confuse backend users. It would make sense to establish language text resolving in menu item titles, but then for ALL menu item types. But this would be a big thing. For your use case you could simply make a template override, I think.
Is just my opinion, having experience with inconsistent user interfaces caused by punctual costumer requirements not being generalized by the engineers and so ending up with different logic for sloghtly different use cases of in general the same thing.
Thanks for the quick reply. Yes, I understand your issue and I agree with you on this point, if it is changed then it must be changed everywhere and this is a bigger pease of work.
In many third party components I see this behaviour, so I thought I send the question in the community.
If I am right, otherwise tell me, I can only change component/module template php files like 'view/login/tmpl/default.php' and not 'view/login/view.html.php'.
Also, translation of an inexisting constant forces the creation of a new string for each language possible via Languages->overrides. Not really convenient. Whether the site is multilingual or not.
Add to that the alias automatic creation...
I guess this can be closed.
|Closed_Date||0000-00-00 00:00:00||⇒||2015-11-12 12:18:16|