Confusion in labels with the separator used between languages and countries

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Confusion in labels with the separator used between languages and countries

Jacques Le Roux
Administrator
Hi committers,

This is mostly for Chinese committers who are the most active in this area at the moment, but others could be interested also...

I know it's confusing because Java uses underscore to separate languages from countries

http://www.oracle.com/us/technologies/java/locale-140624.html

when a dash is required by XML :/

See errors reported in https://issues.apache.org/jira/browse/OFBIZ-9260 description

Thanks to care next time :)

Jacques

Reply | Threaded
Open this post in threaded view
|

Re: Confusion in labels with the separator used between languages and countries

Jacques Le Roux
Administrator
I confirm this is handled in LabelManagerFactory.java

                             Element valueElem = (Element) valueNode;
                             // Support old way of specifying xml:lang value.
                             // Old way: en_AU, new way: en-AU
                             String localeName = valueElem.getAttribute("xml:lang");
                             if( localeName.contains("_")) {
                                 localeName = localeName.replace('_', '-');
                             }
I'll replace this snippet by throwing an exception in order to now to automatically detect such issues

Jacques


Le 15/03/2017 à 12:17, Jacques Le Roux a écrit :

> Hi committers,
>
> This is mostly for Chinese committers who are the most active in this area at the moment, but others could be interested also...
>
> I know it's confusing because Java uses underscore to separate languages from countries
>
> http://www.oracle.com/us/technologies/java/locale-140624.html
>
> when a dash is required by XML :/
>
> See errors reported in https://issues.apache.org/jira/browse/OFBIZ-9260 description
>
> Thanks to care next time :)
>
> Jacques
>
>