Skip to content
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

Hotkeys are not handled correctly in translated strings. #386

Open
pixelzoom opened this issue Jun 22, 2021 · 2 comments
Open

Hotkeys are not handled correctly in translated strings. #386

pixelzoom opened this issue Jun 22, 2021 · 2 comments
Assignees

Comments

@pixelzoom
Copy link
Contributor

Noted while working on hotkey support for Fourier in phetsims/fourier-making-waves#91.

Hotkeys are inlined in the implementation, for example see greenhouse-effect MicroScreenView:

        if ( KeyboardUtils.isKeyEvent( event, KeyboardUtils.KEY_L ) && globalKeyStateTracker.altKeyDown ) {

Then they are duplicated in the translated strings, for example in molecules-and-light-strings_en.json:

      "pauseOrPlayShortcutDescription": {
        "value": "Pause or play action in Observation Window with Alt key plus K."
      },
      "stepForwardShortcutDescription": {
        "value": "When action is paused step forward in bigger steps with Alt key plus L."

So if the code needs to be changed, we'll have to change (potentially many!) string files. The strings should contain StringUtils.fillIn placeholders, and the correct key (and modifier?) should be inserted by the implementation.

It would also be nice to standardize on a more concise (and typical) syntax for referring to hotkeys. "Alt key plus K" is verbose, inconsistent (why not "Alt key plus K key"), confusing ("plus" could be interpretted as "+") and unusal. More typical is "Alt+K". See for example this non-technical reference: https://www.tckpublishing.com/27-handy-keyboard-shortcuts-every-writer-should-know/

@pixelzoom pixelzoom changed the title Hot keys are not handled correctly in translated strings. Hotkeys are not handled correctly in translated strings. Jun 22, 2021
@jonathanolson
Copy link
Contributor

Is this related to molecules-and-light or molecule-shapes? I'm a bit confused why it's opened in this repo.

@pixelzoom
Copy link
Contributor Author

Sorry, this should be in molecules-in-light. Transferring the issue...

@pixelzoom pixelzoom transferred this issue from phetsims/molecule-shapes Jun 23, 2021
@pixelzoom pixelzoom removed their assignment Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants