joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

Language Change for issue #38659

Open coolcat-creations opened this issue 3 years ago • 37 comments

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: grafik to grafik

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

to grafik

Same should be visible in the modal window when you press J then X

coolcat-creations avatar Sep 01 '22 14:09 coolcat-creations

Dashboard and plugin description works, but In modal without then.

Fedik avatar Sep 01 '22 14:09 Fedik

Dashboard and plugin description works, but In modal without then.

Yes thats what I wrote :-)

coolcat-creations avatar Sep 01 '22 14:09 coolcat-creations

Okay, I thought you will change both :)

Fedik avatar Sep 01 '22 14:09 Fedik

I don't know which file to use to change it, no idea why it's not the same as the plugin description :-(

coolcat-creations avatar Sep 01 '22 14:09 coolcat-creations

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.

chmst avatar Sep 01 '22 14:09 chmst

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

Fedik avatar Sep 01 '22 14:09 Fedik

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?

coolcat-creations avatar Sep 01 '22 14:09 coolcat-creations

Yeah, well, not trivial, require new string for Joomla.Text._('then') :)

Fedik avatar Sep 01 '22 14:09 Fedik

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.

coolcat-creations avatar Sep 01 '22 14:09 coolcat-creations

Yeah, well, not trivial, require new string for Joomla.Text._('then') :)

why doesn't it take the existing language override?

coolcat-creations avatar Sep 01 '22 15:09 coolcat-creations

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.

Fedik avatar Sep 01 '22 15:09 Fedik

The modal shows User defined combination,

I mean combination that may come from other extennsion with addShortcuts event,

Fedik avatar Sep 01 '22 15:09 Fedik

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.

Fedik avatar Sep 01 '22 15:09 Fedik

But probably, it is fine as you already made, it is less confusing on dashboard now.

Fedik avatar Sep 01 '22 15:09 Fedik

Yes but this would not change the titles as in my xml change

coolcat-creations avatar Sep 01 '22 15:09 coolcat-creations

  1. please dont use <b> it should not be used for styling text https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b
  2. I see what you are doing with highlighting one letter but it only really works in english
  3. and you had to invent extras for options which really doesnt make sense.

brianteeman avatar Sep 01 '22 15:09 brianteeman

What does X stand for ? @brianteeman

coolcat-creations avatar Sep 01 '22 15:09 coolcat-creations

it doesnt stand for anything

brianteeman avatar Sep 01 '22 15:09 brianteeman

it doesnt stand for anything

Let's write the meaning of the shortcuts into brackets so people will remember easier and understand ...

coolcat-creations avatar Sep 01 '22 15:09 coolcat-creations

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

image

brianteeman avatar Sep 01 '22 15:09 brianteeman

@Fedik should I mention XSS, or the project will also tolerate this one?

dgrammatiko avatar Sep 01 '22 16:09 dgrammatiko

@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 avatar Sep 01 '22 17:09 coolcat-creations

@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 avatar Sep 01 '22 17:09 dgrammatiko

@dgrammatiko maybe it should be reported rather to the JSST ? :-)

coolcat-creations avatar Sep 01 '22 19:09 coolcat-creations

@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:

Fedik avatar Sep 01 '22 19:09 Fedik

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.

coolcat-creations avatar Sep 02 '22 07:09 coolcat-creations

Almost :wink:

image

Fedik avatar Sep 02 '22 07:09 Fedik

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 avatar Sep 02 '22 07:09 Fedik

@Fedik thanks for your help I will add it :-)

coolcat-creations avatar Sep 02 '22 07:09 coolcat-creations

About XSS, I will do separated PR, later, after this one will be merged.

Fedik avatar Sep 02 '22 08:09 Fedik