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

localizer driven attributes #305

Open
zbraniecki opened this issue Feb 10, 2020 · 2 comments
Open

localizer driven attributes #305

zbraniecki opened this issue Feb 10, 2020 · 2 comments

Comments

@zbraniecki
Copy link
Collaborator

In bug https://bugzilla.mozilla.org/show_bug.cgi?id=1608022 we encountered the following issue:

XUL has two attributes - key and keycode. key is used when the shortcut is visible - like ctrl+alt+r. keycode is used when the shortcut is invisible - VK_F9.

The issue is that if in English we use keycode for windows, and any localizer would like to use key instead, Fluent doesn't have a solution for that.

@zbraniecki
Copy link
Collaborator Author

One way to think about it is that if we were to allow localizers to add attributes, and null attributes, then the following would work:

// en-US
foo-windows =
    .keycode = VK_F9

// xx-YY
foo-windows =
    .keycode = None
    .key = R

@zbraniecki
Copy link
Collaborator Author

Additionally, for shortcuts in paticular, having a way to specify a narrow list of options for another attribute - modifiers, would allow the localizer to fully adjust the shortcut and remove a number of cases of ifdefs left in mozilla-central like: https://searchfox.org/mozilla-central/rev/b1e51ad5613ad3d911cf42e3e525885ce2278915/browser/base/content/browser-sets.inc#164-168

// en-US
foo-windows =
    .keycode = VK_F9

// xx-YY
foo-windows =
    .keycode = None
    .key = R
    .modifiers = accel,shift

For such model to work, we'd have to provide meta-information for a CAT tool to allow for UX of selecting from a narrow list of available modifiers - likely with checkboxes.

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

1 participant