Just an update on the same. Even the library from "Jibber-Jabber" seems to
be returning only empty string values.

Forced to set this as an ENVIRONMENT_VARIABLE for the time being and moving
on.

Cheers
Anish

On Sat, Feb 17, 2018 at 8:05 PM, Anish P <prabhakaran.anish1...@gmail.com>
wrote:

> Thanks for the details. Had a look earlier at the code mentioned by 
> Jibber-Jabber
> as you mentioned. Will post the status as soon as I try this out.
>
> Cheers
> Anish
>
> On Sat, Feb 17, 2018 at 9:55 AM, <uwe.dauernh...@betalo.se> wrote:
>
>> Java’s Locale.getDefault returns (if not overridden) the values from the
>> system property “user.language” and “user.region”. If these are not set, it
>> simply returns “en”. See http://hg.openjdk.java.net/jdk
>> 8u/jdk8u60/jdk/file/935758609767/src/share/classes/java/util/Locale.java
>>
>> For Linux: These system properties (if not overridden) are set on Linux
>> by interpreting the environment variable “LANG”. See
>> https://docs.oracle.com/javame/config/cdc/cdc-opt-impl/
>> ojmeec/1.0/runtime/html/localization.htm
>>
>> Thus the equivalent code in Go would be to access this environment
>> variable. Thus a simple `locale = os.Getenv("LANG")` or as Jibber-Jabber
>> does it:
>>
>> ```
>> locale = os.Getenv("LC_ALL")
>>         if locale == "" {
>>                 locale = os.Getenv("LANG")
>>         }
>> ```
>>
>> If it is correct that, as you stated, that you have no access to
>> environment variables, you won’t be able to conclude more than “en” to be
>> compatible with Java’s behavior.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "golang-nuts" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/golang-nuts/8xC2c_VcSAQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> golang-nuts+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to