掲示板

How to change portlet title on the basis of language selected?

thumbnail
11年前 に Neetu Mishra によって更新されました。

How to change portlet title on the basis of language selected?

Junior Member 投稿: 75 参加年月日: 12/05/21 最新の投稿
Hi,

I am creating a custom portlet & I want to change portlet title on the basis of language selected by the user. I know how to change the portlet's content but didn't get any solution to change the portlet's title.

Thanks in advance!!


Regards,
Neetu
11年前 に DarshanKumar N Bhatia によって更新されました。

RE: How to change portlet title on the basis of language selected? (回答)

Junior Member 投稿: 85 参加年月日: 10/03/02 最新の投稿
For any kind of portlet (custom /inbuilt one):

To change Title for particular locale :

1) Deploy portlet on page.
2) Click on Look and feel --> Portlet Configuration Tab

Check : Use Custom Title

Provide ur custom title Name and select a language corresponding to it.

Save.

Test it : By Putting langauge Portlet and changing to various locale.
thumbnail
11年前 に Dhrutika Parekh によって更新されました。

RE: How to change portlet title on the basis of language selected? (回答)

Expert 投稿: 435 参加年月日: 09/02/09 最新の投稿
Hi Nitu,

One solution is as provided in above post if you do it by configuration,
Other way is by changing in xml:

  • Enter Resource bundle path in your portlet.xml.(i.e. <resource-bundle>com.my.langauage.Resource.Navigation.Language</resource-bundle>)
  • On defined path place Language_*.properties files.
  • In these files make respective language entries (i.e.Language_en.properties : javax.portlet.title=Navigation ,Language_es.proeprties=Navegaci\u00F3n)

Regards,
Dhrutika
thumbnail
11年前 に Neetu Mishra によって更新されました。

RE: How to change portlet title on the basis of language selected?

Junior Member 投稿: 75 参加年月日: 12/05/21 最新の投稿
Thanks Dhrutika & DarshanKumar for your quick replies!!

Hey DarshanKumar, this is also a nice way of doing it. I knew about the custom titles but didn't knew that we can change it on the basis of language as well. So thanks once again.emoticon


For any kind of portlet (custom /inbuilt one):

To change Title for particular locale :

1) Deploy portlet on page.
2) Click on Look and feel --> Portlet Configuration Tab

Check : Use Custom Title

Provide ur custom title Name and select a language corresponding to it.

Save.



Hey Dhrutika I have a question about resource bundle path:
Enter Resource bundle path in your portlet.xml.(i.e. <resource-bundle>com.my.langauage.Resource.Navigation.Language</resource-bundle>)


It might be very simple question but apologize me for that.

Since, I am placing language_*.properties files in docroot/WEB-INF/src/content folder so is it ok to put resource bundle path like this??
<resource-bundle>content</resource-bundle>


I have tried this but it's not working, so I think I am missing some thing.emoticon Please help me regarding this. Thanks once again!!


Thanks in advance!!
thumbnail
11年前 に Muzakir Khan によって更新されました。

RE: How to change portlet title on the basis of language selected?

Regular Member 投稿: 112 参加年月日: 12/03/15 最新の投稿
Neetu Mishra:

Since, I am placing language_*.properties files in docroot/WEB-INF/src/content folder so is it ok to put resource bundle path like this??
<resource-bundle>content</resource-bundle>


I have tried this but it's not working, so I think I am missing some thing.emoticon Please help me regarding this. Thanks once again!!


Try this,
<resource-bundle>content/language.properties</resource-bundle> emoticon BOL

Regards
Khan
thumbnail
11年前 に Neetu Mishra によって更新されました。

RE: How to change portlet title on the basis of language selected? (回答)

Junior Member 投稿: 75 参加年月日: 12/05/21 最新の投稿
Hi Muzakir,

Thanks for your reply.

Try this,
<resource-bundle>content/language.properties</resource-bundle>


I have tried this but it was flagging a warning in Eclipse that file name should not end with .properties. So I have tried this:
<resource-bundle>content/language.properties</resource-bundle>

& it's working.emoticon

Thanks once again for your suggestion!!
thumbnail
9年前 に Akash Jaisawal によって更新されました。

RE: How to change portlet title on the basis of language selected?

Regular Member 投稿: 141 参加年月日: 12/03/03 最新の投稿
I have tried this but it was flagging a warning in Eclipse that file name should not end with .properties. So I have tried this:
<resource-bundle>content/language.properties</resource-bundle>

& it's working.emoticon

Thanks once again for your suggestion!!

Sorry Neetu but i didnt get you point here!
You have tried this "
<resource-bundle>content/language.properties</resource-bundle>
" but it was flagging a warning in Eclipse that file name should not end with .properties. So You have tried again this:
<resource-bundle>content/language.properties</resource-bundle>

and it worked?
thumbnail
9年前 に Akash Jaisawal によって更新されました。

RE: How to change portlet title on the basis of language selected?

Regular Member 投稿: 141 参加年月日: 12/03/03 最新の投稿
Or there should be only:
<resource-bundle>content/language</resource-bundle>
?

Sorry if am wrong somewhere!
thumbnail
9年前 に Neetu Mishra によって更新されました。

RE: How to change portlet title on the basis of language selected?

Junior Member 投稿: 75 参加年月日: 12/05/21 最新の投稿
Akash Jaisawal:
Or there should be only:
<resource-bundle>content/language</resource-bundle>
?

Sorry if am wrong somewhere!



Hi Akash,

Thanks for correcting me emoticon

I have tried this:
<resource-bundle>content/language</resource-bundle>
thumbnail
9年前 に Akash Jaisawal によって更新されました。

RE: How to change portlet title on the basis of language selected?

Regular Member 投稿: 141 参加年月日: 12/03/03 最新の投稿
Neetu Mishra:
Akash Jaisawal:
Or there should be only:
<resource-bundle>content/language</resource-bundle>
?

Sorry if am wrong somewhere!



Hi Akash,

Thanks for correcting me emoticon

I have tried this:
<resource-bundle>content/language</resource-bundle>



Hello Neetu,

I ve followed these steps but not succeed to achieve the task!
any other way to change the title programmatically?
thumbnail
9年前 に Neetu Mishra によって更新されました。

RE: How to change portlet title on the basis of language selected?

Junior Member 投稿: 75 参加年月日: 12/05/21 最新の投稿
hi Akash,

There is no other way to change the title programatically emoticon
thumbnail
9年前 に Akash Jaisawal によって更新されました。

RE: How to change portlet title on the basis of language selected?

Regular Member 投稿: 141 参加年月日: 12/03/03 最新の投稿
Neetu Mishra:
hi Akash,

There is no other way to change the title programatically emoticon



ohh..
I tried all the steps you mentioned bit nothing happns emoticon
thumbnail
9年前 に Vipin Bardia によって更新されました。

RE: How to change portlet title on the basis of language selected?

Regular Member 投稿: 162 参加年月日: 11/02/28 最新の投稿
Hi Akash,

This should work -

renderResponse.setTitle(LanguageUtil.get(renderRequest.getLocale(), "keyname"));

Regards.
9年前 に Shreyas Kamthe によって更新されました。

RE: How to change portlet title on the basis of language selected?

Junior Member 投稿: 58 参加年月日: 14/06/09 最新の投稿
Hi everybody,

Can anybody tell me how to customize the portlet for a new added language.
I am trying to set the title to the newly added language but the title shows me "????" .
Can anybody suggest me a solution ?
Is this because i have not made an entry in the portlet.xml ?

Please do reply