ComLock
February 29, 2016, 3:16pm
1
In Content Studio I choose “norsk (Norge,nynorsk) (nn-NO)” as site language, but it does not work.
These don’t work for me:
src/main/resources/site/i18n/phrases_nn.properties
src/main/resources/site/i18n/phrases_nn-NO.properties
src/main/resources/site/i18n/phrases_nn_NO.properties
src/main/resources/site/i18n/phrases_no-NN.properties
Norwegian and english works btw.
When I select no site language it seems to fallback to phrases_en.properties rather than phrases.properties
ComLock
February 29, 2016, 3:29pm
2
An oh btw should not this:
“norsk (Norge) (no-NO)”
rather be
“norsk bokmål (Norge) (nb-NO)”
Or are you not following ISO 639-1
ISO 639-1-kodene er tobokstavskoder for språk, definert i ISO-standarden 639-1.
ISO 639 består av tre lister, og den etterfølgende lista er sortert på språkkodene i ISO 639-1. Lista tar med ISO 639-2 og ISO 639-3 hvor disse kodene er definert.
tsi
February 29, 2016, 4:54pm
3
Hi!
I believe we’re using Java’s locale library to list the language options:
http://www.oracle.com/technetwork/java/javase/java8locales-2095355.html
https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html
Suprised it is not working though? We’ll have to look into that
aro
February 29, 2016, 7:30pm
4
These work for me:
src/main/resources/site/i18n/phrases_nn_NO.properties // (Norge,nynorsk)
src/main/resources/site/i18n/phrases_no_NO.properties
Check that the properties file names are using underscore as language code separator, not dash.
But in the locale parameter to Thymeleaf portal.localize function, use the dash character instead:
<p data-th-text="${portal.localize({'_key=mymessage', '_locale=nn-no'})}"></p>
Same for the JavaScript i18nLib.localize function:
i18nLib.localize({key: 'mymessage', locale: "nn-no"});
It is based on the Java Locale support. I see it can be confusing that it is dash in one place but underscore in the other.
1 Like