-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Numeric preset fields should localize numbers #3615
Comments
Per #3597 (comment), consider the Number module of Globalize.js for this task. |
|
Correction: |
I'd like to take this one on as it would make me dive a bit more into the codebase of iD. Where, or which file would I need to modify in order to effect these changes needed for this issue? I'll continue digging for the time being, and will updated in this thread if I get my bearings and realize where this is to be done. But as of right now, I wouldn't know where I would need to create these changes in order to do the parsing and pass it along to the page. Thanks! |
I suspect that I should work on this file Will work on this this evening. |
Accepting localized numbers is useful, but iD should also accept the formally defined format of the tag value. Due to a restricted range of reasonable values, the resulting value seems to be unambiguous. |
I don't think it would go there - that script is to pull down translation packs from Transifex. You'll probably really need to do the conversion to/from local formatting in @1ec5 can you provide some more guidance? I'm not sure this should be labelled with "good first issue". It sounds like something with a lot of gotchas involved and requiring deeper knowledge of iD. |
Sorry, I forgot to remove that after posting #3615 (comment). For what it’s worth, #4964 would also introduce a dependency on an internationalization library. |
There’s probably an NPM package for this by now, but this compact solution is right in line with how native platforms have been exposing number formatting for eons, so it’s good enough for the numeric field’s needs. |
I don’t think this is necessarily true. For example, in a locale like Spanish that uses the format |
#8769 implements localized number formatting and parsing in numeric fields. However, there are a couple more things to take care of as tail work:
|
There are quite a few placeholders to update, but I updated this placeholder proactively because otherwise it would mislead users into entering the wrong decimal separator and thus the wrong raw tag. |
Actually, never mind: this is a |
The “Lanes” and “Max Height” (
maxheight=*
) fields accept numbers as input, but the placeholder string for “Max Height” highlights the fact that they only accept English-style numbers (European digits and a period as the decimal point). Numeric fields like these should convert between the language’s local number format and the format expected in OSM tags. (Note that floating-point fields like “Max Height” also tend to accept units: #3614.)Related: #3597
The text was updated successfully, but these errors were encountered: