-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Internationalization - Decimal point/comma #175
Comments
I'm also from Germany, so I feel you 😄 We have already discussed this in #104. I still stand by my statement:
Back then, we decided that we could make this user-defined (via a hypothetical
That is a potential solution that I never thought of. If there is a good way (in JavaScript) to detect a "comma on the num pad" (as opposed to a "comma anywhere on the keyboard"), we could certainly give this a try! |
Right, I didn't think about the ambiguity of allowing commas. And I totally agree that given those considerations comma should not actually be interpreted as a decimal point. There seems to be a way to get the keycodes to the keypress event (at least on web-JavaScript, I don't know my way around node at all). On my keyboard this seems to yield Source: I also did a quick fiddle with the necessary code boiled down to almost the minimum. I don't know how you would do this in node.js, in particular with the terminal interface (maybe some hooks in that library?), but here is a way to detect it in Web-JavaScript: https://jsfiddle.net/targodan/xnery589/ Edit: If I can find the time I may be able to setup a quick node environment and see if I can make it work somehow. I'm assuming this is the main equivalent of the program? |
So, after some testing and experimenting I am afraid it might be impossible. I certainly didn't get it to work and it might be due to how terminals handle key presses. I got readline to give me keypress events, those always just contained the character I found one workaround though. You can use the following command to have your numpad always emit a dot instead of a comma regardless of your keyboard layout: |
Ok - thank you very much for checking!
That's pretty cool! I think I'm going to use this. |
Don't know how much of a hassle it might be but on terms of internationalization it would be great to configure whether to use
.
or,
as a decimal "point". I'm from germany and in the german keyboard layout the point on the num pad is a comma, since we use commas instead of points.English:
4,992.5
German:
4.992,5
I don't really care about the visual style, I can read english or german numbers equally well. However I mostly use the num pad for calculation inputs and it's really annoying to not be able to use the comma of the num pad.
As a result handling of german keyboard layouts (or others with a comma on the num pad) so the decimal point/comma is interpreted correctly would be a real improvement! Having the ui display commas instead of points would just be icing on top.
One example of handling it is in the graphical calculator
extcalc
. They always display decimal points but handle the keyboard layout in such a way, that the num pad emits a point instead of a comma.The text was updated successfully, but these errors were encountered: