Maybe it’s just my stupid american brain but it’s hard to quickly read large numbers without commas in them. Shouldn’t this be part of the unit_system: imperial
?
Yes, it should use locale so I can see comma as decimals separator.
No, it should not. I’m in the Netherlands where comma is the decimal point and the point is used as the thousands-seperator. I hate it. I’ll overrule it everywhere I can… Please don’t follow the locale… Make it a config option. User preferences are …well uh… user preferences. Not a one-size-fits-all setting!
It seems to me these decisions should be part of the configuration. In Configuration / General we already have the option to select imperial or metric. It seems to me we ought to be able to have more detailed control. Comma or period for separator. MM-DD-YYYY or DD-MM-YYYY for date format. Imperial for distance but Celsius for temperature. MPH, KPH or knots. Start-of-week date. All of that sort of thing.
Isn’t that the point of following the locale? If you set it correctly you get your desired separators.
I was wondering that too. I’d never heard of locale settings. I did a quick search for how to change my locale settings in HA. I didn’t come up with anything seemed directed toward end users. Am I missing something?
Can you explain in greater detail what your concern is and how you would expect it to work?
It’s important to know that term locale
has a pretty specific meaning in programming. Generally speaking, it’s a user-driven preference in the form of a combined language code (ex: en
) and country code (ex: US
). This setting allows the application to adjust it’s interface to use the desired language (or regional variant) along with setting formatting rules for things like numbers, currency and dates.
I do think there is a case for allowing users to override specific formatting conventions if they want to, but that should be avoided as the ‘normal’ way to do things as the resulting user experience is pretty poor.
Apple actually does a good job of this in macOS, allowing specific formatting conventions to be overridden on a per-language basis.
Lots of applications have default values for units and formatting conventions, but allow the user to change them. Navigation programs, for example, can display distances in metric, imperial or nautical miles. Depths can be meters, feet or fathoms. Speed can be set in MPH, KPH or knots. Spreadsheets and accounting programs allow users to select commas vs. periods. Most thermostats allow users to choose between F and C.
I don’t see this as particularly difficult or unexpected, and I wouldn’t categorize these options as “poor.”
You’re misinterpreting him. His idea of defaults is location based, where you’re idea of defaults is configuration based. In the end, you and him have the same goal. A default set of parameters that can be overridden. He is specifically pointing out that he wants the ‘defaults’ to be based on locale.
As a side note, a thing that many people on the forum don’t know is that you can have multiple locale’s for a single language, each locale with different settings (time format, number format, etc) but the same language.
It might work if you could set the locale in the environment where HA’s Python is running, but you could easily find a ton of bugs if you tried to change it.
Yes, I’m probably misunderstanding the whole concept. I didn’t mean to come across as challenging anyone, just trying to understand. And I agree we are all after the same thing.
Speaking for myself, no, I didn’t know that. Where in the HA documentation would I learn about this? Where would I go to change it?
Again, how does all this relate to a poor schmuck who just installed HA on a RPi, following all the directions but not being totally clear on all the components and how they relate?
To me, this is the sort of thing which should be right there in the UI. I gave examples of a couple of other types of hardware where this is done, and there are many more. It’s so fundamental to the operation of a system like this that I’m surprised it’s not “step one” after you get HA running.
Currently, it’s based on your timezone. I don’t think you can change the locale currently anyways. I was just pointing out how local works. I’m more or less stating, “we can use the locale and everyone will get what they want”.
You do not want to change the python locale. It will most likely make the python syntax fail across the board.
The main point with some of these responses is that “You shouldn’t be against using locale as a possible solution”.
Thank you, I know everyone is just trying to arrive at the best solution. The discussion is valuable.
I just hope, in the end, we don’t lose sight of the fact that this is a glaring hole in HA. Being able to set up units and formats in the UI should be a no-brainer.
My point is. My locale is Dutch-NL In the Netherlands the decimal separator is comma and thousand separator is point. I DO NOT like this. I prefer it the other way around. So when i would set my locale to NLNL i get the wrong separators. This is valid (or wrong ) for a multitude of other settings. I would set the interface to dutch but i get a lot of things not the way i want it. I can imagine there are more situations/users who have preferences different from what is “default” for their locale… In your OS (see your own screenshot) you can also override the settings!
And this is exactly what is wrong here. Setting your locale would not give me what i want.
But it can, that’s what you aren’t understanding.
To requote myself:
Can i define my own locale? Because i’m a strange fellow and now i have to search for a matching set…
No, you cannot do that currently but this is what this WTH should strive for. Again, you aren’t understanding what me or this other guy are saying:
Base it off locale, give use the option to change said locale.
Instead, you’re saying “NO, NO LOCALE!!! I WANT TO CHANGE IT.” when this will do what you want.
Ok, maybe we are saying the same thing, but my understanding of English is just a few ticks behind… I read the wikipedia definition referred a couple of posts before:
In computing, a locale is a set of parameters that defines the user's language, region and any special variant preferences that the user wants to see in their user interface..
Then it should be implemented in a way the “any special variant preferences” can be set.