Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Vladimir Vukadinovic
Available languages display names
September 14, 2011 6:46 AM
Answer

Vladimir Vukadinovic

Rank: New Member

Posts: 24

Join Date: October 10, 2008

Recent Posts

Hi,

What is the best way to change available languages display names in language portlet. For example Српски (Serbia) to Srpski (Serbia) or so on.

Thanks
Vladimir
Thiago Leão Moreira
RE: Available languages display names
September 14, 2011 8:20 AM
Answer

Thiago Leão Moreira

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1431

Join Date: October 10, 2007

Recent Posts

Hey Vladimir,

You can use the following properties to set this configuration

 1##
 2## Languages and Time Zones
 3##
 4
 5    #
 6    # Specify the available locales. Messages corresponding to a specific
 7    # language are specified in properties files with file names matching that
 8    # of content/Language_*.properties. These values can also be overridden in
 9    # properties files with file names matching that of
10    # content/Language-ext_*.properties. Use a comma to separate
11    # each entry.
12    #
13    # If there is more than one locale for the same language, the first one in
14    # the list will be used when a translation is requested in another locale of
15    # the same language but a translated value cannot be found. For example, if
16    # there are two locales such us pt_BR and pt_PT (in this order), any key not
17    # found in pt_PT will be looked for in pt_BR.
18    #
19    # All locales must use UTF-8 encoding.
20    #
21    # See the following links specifiy language and country codes:
22    #     http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt
23    #     http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html
24    #
25    locales=ar_SA,eu_ES,bg_BG,ca_AD,ca_ES,zh_CN,zh_TW,hr_HR,cs_CZ,nl_NL,nl_BE,en_US,en_GB,et_EE,fi_FI,fr_FR,gl_ES,de_DE,el_GR,iw_IL,hi_IN,hu_HU,in_ID,it_IT,ja_JP,ko_KR,nb_NO,fa_IR,pl_PL,pt_BR,pt_PT,ro_RO,ru_RU,sr_RS,sr_RS_latin,sl_SI,sk_SK,es_ES,sv_SE,tr_TR,uk_UA,vi_VN
Hitoshi Ozawa
RE: Available languages display names
September 14, 2011 3:29 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

I've answered this question just a couple of days ago in the thread below:
http://www.liferay.com/ja/community/forums/-/message_boards/message/10657200
Vladimir Vukadinovic
RE: Available languages display names
September 15, 2011 2:53 AM
Answer

Vladimir Vukadinovic

Rank: New Member

Posts: 24

Join Date: October 10, 2008

Recent Posts

Thanks,

I solved this problem on way that I changed code in page.jep for Language portlet. In my case I only wanted to change Cyrillic to Latin display name for serbian language. In first time I think that there are any special code table in database or properties files. My solution is
 1<c:choose>
 2                    <c:when test='<%= (locales[i].getLanguage().equals(\"sr\") )%>'>
 3                            <%= "Srpski" %>
 4                      </c:when>
 5                      <c:otherwise>
 6                             <%= language %>
 7                       </c:otherwise>
 8                   </c:choose>
 9
10      <!--<%= language %>-->


Regards
Vladimir
Hitoshi Ozawa
RE: Available languages display names
September 15, 2011 4:21 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

That'll change the name of the language displayed in the portlet.
I may have went to far to change the language name on all occurrances.emoticon
Vladimir Vukadinovic
RE: Available languages display names
September 15, 2011 6:59 AM
Answer

Vladimir Vukadinovic

Rank: New Member

Posts: 24

Join Date: October 10, 2008

Recent Posts

Yes, I only wanted to change name of the language displayed, but your post is use full of course.