Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
ruchi gupta
modify long text under language portlet
November 5, 2011 11:30 PM
Answer

ruchi gupta

Rank: New Member

Posts: 12

Join Date: July 31, 2011

Recent Posts

Hi All,
I want only language name instead of language(country) like only gujarati instead of gujarati(india).
plz suggest me how can i do this?
ruchi gupta
RE: modify long text under language portlet
November 5, 2011 11:35 PM
Answer

ruchi gupta

Rank: New Member

Posts: 12

Join Date: July 31, 2011

Recent Posts

any body help me its urgent for me.
Sagar A Vyas
RE: modify long text under language portlet
November 6, 2011 2:27 AM
Answer

Sagar A Vyas

Rank: Liferay Master

Posts: 655

Join Date: April 17, 2009

Recent Posts

ruchi gupta:
Hi All,
I want only language name instead of language(country) like only gujarati instead of gujarati(india).
plz suggest me how can i do this?


Hi Ruchi,

Can give us some more details on same ? I am not getting what are you trying to ask ?

Thanks,
Sagar Vyas
ruchi gupta
RE: modify long text under language portlet
November 6, 2011 4:40 AM
Answer

ruchi gupta

Rank: New Member

Posts: 12

Join Date: July 31, 2011

Recent Posts

Hi Sagar,


My requirement is, only language are shown in language portlet. In language portlet their are 4 option for display language icon,long text, short text and select box.When i choose select box than language look like this hindi ( india) . If i add another indian language than its also display in same manner. But i want to display only name of language like hindi not hindi(india). So plz suggest how i do this?emoticonemoticon
Sagar A Vyas
RE: modify long text under language portlet
November 6, 2011 11:14 AM
Answer

Sagar A Vyas

Rank: Liferay Master

Posts: 655

Join Date: April 17, 2009

Recent Posts

Hi Ruchi,

For this you need to change jsp page of language portlet.

You need to create hook for same of page.jsp.

<aui:form action="<%= formAction %>" method="post" name="<%= formName %>">
<aui:select changesContext="<%= true %>" label="" name="<%= name %>" onChange='<%= "submitForm(document." + namespace + formName + ");" %>' title="language">

<%
for (int i = 0; i < locales.length; i++) {
%>

<aui:option cssClass="taglib-language-option" label="<%= locales.getDisplayName(locales) %>" lang="<%= LocaleUtil.toW3cLanguageId(locales) %>" selected="<%= (locale.getLanguage().equals(locales.getLanguage()) && locale.getCountry().equals(locales.getCountry())) %>" value="<%= LocaleUtil.toLanguageId(locales) %>" />

<%
}
%>

</aui:select>
</aui:form>


You will find this kind of code on page.jsp located on \tomcat-6.0.29\webapps\ROOT\html\taglib\ui\language folder. (On Line number 80 )

Note :Remember by doing change in this means you are change something which will reflect on whole portal emoticon

Thanks,
Sagar Vyas
ruchi gupta
RE: modify long text under language portlet
November 6, 2011 9:22 PM
Answer

ruchi gupta

Rank: New Member

Posts: 12

Join Date: July 31, 2011

Recent Posts

Thanks Sagar.
Rojalin Patri
RE: modify long text under language portlet
March 15, 2012 10:23 PM
Answer

Rojalin Patri

Rank: Expert

Posts: 287

Join Date: March 22, 2011

Recent Posts

Hi Ruchi and Sagar,
i have a similar requirement and i too want to remove the country name from the display list.i tried but could n't figure out which part i should remove to so that country name won't come with the language name in the drop down list.
Ruchi:please mention how did you achieve this.

Thanks and Regards
Rojalin