-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Document - GUI development - added Localization requirements #3499
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
Conversation
|
You may want to look at: It seems to be grammatically incorrect and is rather confusing. Maybe something in the line of: |
Note that this does not reliably handle localized float input. using the suggested method will result in 1.000.23 which is not a valid float. Use this instead: |
|
What happens if you substitute: |
If I'm not mistaken 1.58 in de_DE locale evaluates to 158. |
|
I tried to solve this bug #2966 . Although I didn't solve it, I tested a lot of locale float and I concluded that "replace" is the lesser evil. If you come up with something better, I'll use it. In Czech, a space is used to separate thousands. In school, we learned that a dot is also possible. But I've never seen it in technical software. In Czech localizations of CAD systems, I've seen:
|
|
A more harsh and brute force way is to translate all ',' at input to '.' and add a validity check at each character entered to prevent multiple decimal separators to be entered. The alternative is to adhere to the locale from the user's perspective. However, this must be 100% consistent. And that is the problem... consistency is paramount. |
|
@hansu Have you ever seen format value 1.256.523,56 in technical software with DE localization? |
Don't know about DE, but I've seen it in nl-NL and da-DK (some of my hairs on my head have been left behind in processing that kind of stuff). A mess to mess with the mess and no messing! |
No, this seems to me only common in a financial context |
Only partially ;-)
That I've also seen multiple places. One problem is that it can be interpreted as being inconsistent. That said, however, creating the drawing or using the drawings are generally performed by two different persons with different backgrounds. That means that there is a writer/reader disparity that needs to be considered when looking at consistency. One partial example is generally not enough to use as a rule.
That seems to be a common way to deal with the problem afaik. How it is displayed afterwards is not uniformly agreed upon. Some use locales and others just fix it to use one or the other. But, whatever you choose, the visual must be used consistently everywhere from that point on.
Indeed, that would cause a lot of grief, being off by one or more orders of magnitude. But the same problem occurs if an operator enters |
|
Thank you all for the comments. I'll try to draw a conclusion from this:
Does that make sense? Norbert doesn't want to display DRO with decimal comma in Gmoccapy. So it's simple here. Gmoccapy will display decimal point everywhere. On the other hand, I don't want to prohibit float numbers according to localization in other GUIs. But it will be a lot of work to unify everything. |
|
The gist of it is fine. It needs a bit more work on grammar, formatting and finally a native English speaker check (not me...):
|
That needs now some further explanation ;-)
I can't image that one operator enters a number like this. In this case I would just throw en error or just didn't accept the input. |
|
My English is very bad, so I use google translator.
[BsAtHome]
I think that no one will want to create a GUI where float numbers will be displayed according to localization. It's a lot of work.
If someone creates a GUI where float numbers will be displayed according to localization. It will be necessary to make rules from this GUI. But I would do them retroactively. |
|
I don't think you should use (sub)headers ( You should review your text again and add the/your (compact and short) rationale to it, just like you did just now. That will explain to the reader why the rules are setup as they are. But remember, rules are there to limit expression. You must be very careful not to limit one thing and then, via a backdoor, allow it again, which can easily happen when you "don't want to define" something. |
|
I think you don't want to get too specific unless required: Decimal localization is difficult.
etc don't add code examples unless required. |
|
The British Standard for technical drawings is decimal commas. (BS8888 - https://roymech.org/Useful_Tables/Drawing.html ) |
|
Decimal comma is used often in Czech drawings. However, I have never seen a drawing where some values had commas and others dots. In Creo we used decimal dots, but we had a font set where the dot looked like something between a dot and a comma. The advantage of comma is that it is more readable on dirty printed paper drawings. Here, Sigma is working on a fix for the localization of the calculator widget: |
|
When I was at school we were taught to use https://en.wikipedia.org/wiki/Interpunct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might I suggest:
Different locales use different decimal separators and thousands separators. Locale-specific string-to-float functions should be avoided as they may give unexpected results. (For example the text string "1.58" in de_DE will be converted to 158 by atof()). The following guidelines (based on avoiding ambiguity rather than on "correctness" in any specific locale) are suggested if parsing float to string and vice-versa:
- In the case of input allow either comma (,) or point(.) as a decimal separator, but reject any input that has more than one of either. Space should be accepted but not required as a thousands separator.
- In the case of display either use point (.) consistently or use the current localisation format consistently. The emphasis here being on "consistently".
|
Thank you Andy. I used your text. |

I wrote a rule for localizing float numbers.
This rule is based on this:
#3494
#2966