WEnvironment.locale().name() returns en-US, not en_US
WEnvironment.locale().name() returns en-US instead of en_US like the documentation states.
It should use the underscore to be consistent with documentation.
I use this value in my Application to set the current Language, so its important that it be consistent.
Updated by Josh Lampco almost 8 years ago
I am not sure where in the documentation you see the locale being specified to return in the format "en_US" (Can you give an example?). If you did find it somewhere that I haven't seen, the documentation should probably be changed since the format of the HTTP
Accept-Language (Per RFC-2616) header field is of the form "en-US".
The only references to this that I find in the documentation are as follows:
Updated by Jeff Flesher almost 8 years ago
The Documentation I refer to is the header for WLocale, the constructor Documents for 3.3.3 state:
/* \brief Creates a locale by name.
- The locale name is a string such as "en" (for English) or "en_UK"
- (for UK English).
I do agree that a - (dash) is correct, and it is what is being returned, so maybe change this to read en-GB (UK to GB should already be updated by Wim Dumon via mail list).
At the time I wrote this, I found conflicting information, due to the use of underscore vs dash, but my point is the documentation should match the value returned.