-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat: localize keyboard shortcut #325
feat: localize keyboard shortcut #325
Conversation
Thanks for the contribution :) The code looks good, @teolemon I'm wondering if we should adapt with the locale, such that at least for french, it's still an Ans also because N, K, O has a better alignment on AZERTY keyboards |
Ideally, yes it should be localizable, and we should carefully choose patterns. |
Don't need a library. A file const SHORTCUT_LOCALISATION = {
en: {
yes: "y",
no: "n",
skip: "k",
},
fr: {
yes: "y",
no: "n",
skip: "k",
}
}
const getShortcuts = (lang) => {
return {...SHORTCUT_LOCALISATION.en, ...SHORTCUT_LOCALISATION[lang ?? getLang()]}
} That in the main file you can do
probably need to replace the |
Hi guys, |
@benbenben2 No problem, I will finish the PR |
Hey! Nice idea about the localized shortcuts! Something I would like to add is the fact that a lot of localized cli commands always take y as yes and n as no, so that if somebody is used to the english version it would work too. |
@benbenben2 If you want to have a look, I added a commit to modify shortcuts depending on localization |
What
Replaced the shortcut to answer questions in Hunger Games to "y"
Why
The actual shortcut to reply "yes" to questions in Hunger Games is "o".
Assuming that it is a typo (French abbreviation maybe?), I changed it to "y" (for yes).
Remark: it is my first PR to hunger games project. I tested the changes locally.