New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change language debug mode to allow it to show the language constants #21691
Conversation
PR for joomla#14304 By default there is no change when debug language is enabled - but there now is an option to display either the language constant or the language value
PR for joomla#13904 ### Steps to reproduce the issue Extensions > Modules > Go to any module's settings Module ordering field looks different. ### Expected result All select fields must looks the same. ### Actual result ![module-settings-ordering](https://cloud.githubusercontent.com/assets/1245155/22618818/9c8a2dd6-eaf7-11e6-8cc8-06a9ae610849.png) ### After pr all select fields look the same
This reverts commit 7a1cf2d.
I have tested this item ✅ successfully on 1277199 Anyway - works 😉 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21691. |
libraries/src/Language/Language.php
Outdated
$string = $this->debug ? '**' . $this->strings[$key] . '**' : $this->strings[$key]; | ||
$value = $this->debug && \JFactory::getApplication()->get('debug_lang_const') == 0 ? $key : $this->strings[$key]; | ||
|
||
$string = $this->debug ? '**' . $value . '**' : $this->strings[$key]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd propose to refactor this a bit, so the code is only executed when debugging - this should have a measurable impact!
if (isset($this->strings[$key]))
{
$string = $this->strings[$key];
// Store debug information
if ($this->debug)
{
$value = \JFactory::getApplication()->get('debug_lang_const') == 0 ? $key : $string;
$string = '**' . $value . '**';
$caller = $this->getCallerInfo();
if (!array_key_exists($key, $this->used))
{
$this->used[$key] = array();
}
$this->used[$key][] = $caller;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applied your changes
May I politely ask a question here.. in case this get merged... will the code eventually also end up in the 4.0 branch or does this require a separate PR? |
basically yes it should do as george is pushing them all up (eventually) however as this one uses external libraries iirc it might need to be changed so he might ask you to do a specific pr as we handle those differently in j4 |
I'd love to do that. Thanks! |
I also love to do that 😉 Thanks for the update. |
That is unavoidable if someone wants this feature. |
I have tested this item ✅ successfully on 82fd8ed This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21691. |
I suggest to add an onChange event in the form field to save and reload the page. |
That would then be different to every other selector in the ui - so that would not be a good idea |
I have tested this item ✅ successfully on 82fd8ed This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21691. |
Ready to Commit after two successful tests. |
I'm not going to block the merge on this but we need to update the Language class to not rely on pulling this param from the global config at all times (basically, the same way the class has a parameter to enable/disable debug mode we should have the same for this new capability). |
Thanks for merging. Not sure I can do that change but I will try |
This created an issue when debug is on when installing Joomla |
PR for #14304
By default there is no change when debug language is enabled - but there now is an option to display either the language constant or the language value
Arguably a new feature - I will let the maintainer decide on that