Language Change for issue #38659
Pull Request for Issue #38659 .
Summary of Changes
Changed the + symbol to "then" in System Panel Added "then" between the keys in the xml text and made it easier to understand the shortcuts
Before: J + X Keyboard Shortcuts
J then A Save J then S Save & Close J then Q Cancel J then N New J then F Search J then O Options J then H Help J then M Toggle J then X Overview J then D Home
After: J then X Keyboard Shortcuts
Enables keyboard shortcuts on the administrator site, which can be provided by other plugins and includes directly the following list of shortcuts:
J then A Apply J then S Save & Close J then Q Cancel (Quit) J then N New J then F Search (Find) J then O Options J then H Help J then M Toggle Menu J then X Overview / Extras J then D Home Dashboard
Testing Instructions
Go to System and see that the text on the system Panel changed from:
to

Go to System Plugin Shortcuts and see the description changed from:

to

Same should be visible in the modal window when you press J then X
Dashboard and plugin description works, but In modal without then.
Dashboard and plugin description works, but In modal without
then.
Yes thats what I wrote :-)
Okay, I thought you will change both :)
I don't know which file to use to change it, no idea why it's not the same as the plugin description :-(
Maybe you can make the "then" in smaller font on the Dashboard?
You changed "Save" to "Apply". It is true that the a button stands for apply, but we have in all toolbars the button SAVE, not Apply.
no idea why it's not the same as the plugin description
it is dinamicaly generated here https://github.com/joomla/joomla-cms/blob/febdab61581ffdffb941db3aa7dd368bc083a30e/build/media_source/plg_system_shortcut/js/shortcut.es6.js#L103-L114
Maybe you can make the "then" in smaller font on the Dashboard?
You changed "Save" to "Apply". It is true that the a button stands for apply, but we have in all toolbars the button SAVE, not Apply.
Thank you I changed it. Better now?
Yeah, well, not trivial, require new string for Joomla.Text._('then') :)
no idea why it's not the same as the plugin description
it is dinamicaly generated here
https://github.com/joomla/joomla-cms/blob/febdab61581ffdffb941db3aa7dd368bc083a30e/build/media_source/plg_system_shortcut/js/shortcut.es6.js#L103-L114
I Found that file but where has this file the "title" from? Because I want to change them too.
Yeah, well, not trivial, require new string for
Joomla.Text._('then'):)
why doesn't it take the existing language override?
It comes from plugin https://github.com/joomla/joomla-cms/blob/f520c98c64efb538e70e918acffb60d07e4d6b1e/plugins/system/shortcut/src/Extension/Shortcut.php#L119-L139
why doesn't it take the existing language override?
The modal shows User defined combination, and so the modal content is dinamicaly generated.
The modal shows User defined combination,
I mean combination that may come from other extennsion with addShortcuts event,
This will do the thing
dl += ` ${Joomla.Text._('JTHEN')} <kbd>${key.trim()}</kbd>`;
Or full:
let dl = '<dl>';
dlItems.forEach((titles, shortcut) => {
dl += '<dt><kbd>J</kbd>';
shortcut.split('+').forEach(key => {
dl += ` ${Joomla.Text._('JTHEN')} <kbd>${key.trim()}</kbd>`;
});
dl += '</dt>';
titles.forEach(title => {
dl += `<dd>${title}</dd>`;
});
});
dl += '</dl>';
Maybe constant JTHEN is not very good, then can be something PLG_SYSTEM_SHORTCUT_THEN :)
Not sure here.
But probably, it is fine as you already made, it is less confusing on dashboard now.
Yes but this would not change the titles as in my xml change
- please dont use
<b>it should not be used for styling text https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b - I see what you are doing with highlighting one letter but it only really works in english
- and you had to invent extras for options which really doesnt make sense.
What does X stand for ? @brianteeman
it doesnt stand for anything
it doesnt stand for anything
Let's write the meaning of the shortcuts into brackets so people will remember easier and understand ...
as stated before - it only makes sense in english
also look at any keyboard shortcut system. there doesnt have to be and often isnt any connection between the key and the action

@Fedik should I mention XSS, or the project will also tolerate this one?
@Fedik should I mention XSS, or the project will also tolerate this one?
Do you see a security issue in a language change ? 😳
@coolcat-creations not on your side, the existing js code has them. It just need adding the sanitizer in the insertAdjusentHTML call. Again, it’s not about the changes in this pr but the code that was released with 4.2.0
Edit I have further complains about that js but this pr is not the place to express them…
@dgrammatiko maybe it should be reported rather to the JSST ? :-)
@coolcat-creations I think @brianteeman is right, better remove <b> on first letter,
There not always will be a case when first letter will refer to "shortcut", especialy for non Eglish translations.
should I mention XSS
XSS, what is it, kind of new CSS? :wink:
Ok, I applied the requested changes and added also a language string. I cant test the build (es6 file change) myself because I can't get composer and npm running.
Almost :wink:

Add new js string around here: https://github.com/joomla/joomla-cms/blob/f520c98c64efb538e70e918acffb60d07e4d6b1e/plugins/system/shortcut/src/Extension/Shortcut.php#L94-L97
Text::script('PLG_SYSTEM_SHORTCUT_THEN');
@Fedik thanks for your help I will add it :-)
About XSS, I will do separated PR, later, after this one will be merged.