Fórum

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

thumbnail
Neetu Mishra, modificado 11 Anos atrás.

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

Junior Member Postagens: 75 Data de Entrada: 21/05/12 Postagens Recentes
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
DarshanKumar N Bhatia, modificado 11 Anos atrás.

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

Junior Member Postagens: 85 Data de Entrada: 02/03/10 Postagens Recentes
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
Dhrutika Parekh, modificado 11 Anos atrás.

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

Expert Postagens: 435 Data de Entrada: 09/02/09 Postagens Recentes
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
Neetu Mishra, modificado 11 Anos atrás.

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

Junior Member Postagens: 75 Data de Entrada: 21/05/12 Postagens Recentes
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
Muzakir Khan, modificado 11 Anos atrás.

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

Regular Member Postagens: 112 Data de Entrada: 15/03/12 Postagens Recentes
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
Neetu Mishra, modificado 11 Anos atrás.

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

Junior Member Postagens: 75 Data de Entrada: 21/05/12 Postagens Recentes
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
Akash Jaisawal, modificado 9 Anos atrás.

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

Regular Member Postagens: 141 Data de Entrada: 03/03/12 Postagens Recentes
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
Akash Jaisawal, modificado 9 Anos atrás.

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

Regular Member Postagens: 141 Data de Entrada: 03/03/12 Postagens Recentes
Or there should be only:
<resource-bundle>content/language</resource-bundle>
?

Sorry if am wrong somewhere!
thumbnail
Neetu Mishra, modificado 9 Anos atrás.

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

Junior Member Postagens: 75 Data de Entrada: 21/05/12 Postagens Recentes
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
Akash Jaisawal, modificado 9 Anos atrás.

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

Regular Member Postagens: 141 Data de Entrada: 03/03/12 Postagens Recentes
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
Neetu Mishra, modificado 9 Anos atrás.

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

Junior Member Postagens: 75 Data de Entrada: 21/05/12 Postagens Recentes
hi Akash,

There is no other way to change the title programatically emoticon
thumbnail
Akash Jaisawal, modificado 9 Anos atrás.

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

Regular Member Postagens: 141 Data de Entrada: 03/03/12 Postagens Recentes
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
Vipin Bardia, modificado 9 Anos atrás.

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

Regular Member Postagens: 162 Data de Entrada: 28/02/11 Postagens Recentes
Hi Akash,

This should work -

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

Regards.
Shreyas Kamthe, modificado 9 Anos atrás.

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

Junior Member Postagens: 58 Data de Entrada: 09/06/14 Postagens Recentes
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