[Gridsphere-users] Title of portlet language in portlet.xml

Jason Novotny novotny at gridsphere.org
Fri Mar 28 07:16:49 PDT 2008


    Which version of GS are you using?

    Jason

Edrick wrote:
> That was a perfect workaround for it. But, what about why the project won't
> switch to another language file. Now is using Portlet_en.properties. I
> switch on login to language "es" and still my Portlet_es.properties is not
> used and I can see that other Gridsphere Administration included portlets
> switch to the selected language. Am I missing something? You can see what I
> am talking about on the project I send you on my previous message of this
> thread. 
>
> Edrick
>
>
>
> novotny wrote:
>   
>> Just taking a quick look, instead of
>>
>> setNextState(request, "SecondScreen.jsp");
>>
>> in your action method, you could try
>>
>> setNextState(request, "view");
>>
>> and add another render method to the portlet:
>>
>> public void view(RenderFormEvent event) {
>>  
>>                 PortletRequest request =event.getRenderRequest();
>>                 RenderResponse rr = event.getRenderResponse();
>>                 rr.setTitle(getLocalizedText(request, 
>> "PORTLET_TITLE_TRANSACTIONS"));
>>                
>>                 setNextState(event.getRenderRequest(),
>> "SecondScreen.jsp");
>>               
>> }
>>
>> Jason
>>
>> eperez wrote:
>>     
>>> Hi,
>>> I only have one method that uses the RenderFormEvent and that is the
>>> prepare method. 
>>>
>>> I will include a small example project showing the problem. You will
>>> notice in the project that the title of the portlet is assigned once
>>> from the Portlet.properties file. But it will revert back to the one in
>>> portlet.xml. You could also notice one other thing (a bug?): If you
>>> choose your locale "Español" (es) on login, the Portlet_es.properties is
>>> not used even thought it was supposed to.
>>>
>>>   Edrick
>>>
>>> -----Original Message-----
>>> From: gridsphere-users-bounces at gridsphere.org
>>> [mailto:gridsphere-users-bounces at gridsphere.org] On Behalf Of Jason
>>> Novotny
>>> Sent: Thursday, March 27, 2008 11:56 AM
>>> To: GridSphere Users
>>> Subject: Re: [Gridsphere-users] Title of portlet language in portlet.xml
>>>
>>>
>>> Hi,
>>>
>>>     A render method is always performed-- so even if an action method is
>>>
>>> invoked, then a render method (doView for example) would be invoked 
>>> after. Try adding the lines of code below to all the methods in your 
>>> portlet that take a RenderFormEvent parameter and see if that works.
>>>
>>>     Jason
>>>
>>> Edrick wrote:
>>>   
>>>       
>>>> Your proposed workaround looks better, but  the new problem is: how do
>>>>     
>>>>         
>>> i
>>>   
>>>       
>>>> define the title on the action methods (the ones with ActionFormEvent
>>>> parameter) since I can't get a RenderResponse object from them? I did
>>>>     
>>>>         
>>> this 
>>>   
>>>       
>>>>              PortletRequest request =event.getRenderRequest();
>>>>              RenderResponse rr = event.getRenderResponse(); 
>>>>              rr.setTitle(getLocalizedText(request,
>>>> "PORTLET_TITLE_TRANSACTIONS"));
>>>>
>>>> on the prepare method and it displays the string correctly the first
>>>>     
>>>>         
>>> time
>>>   
>>>       
>>>> from the Portlet.properties file, but once i click on an action link
>>>>     
>>>>         
>>> or
>>>   
>>>       
>>>> button, the portlet title will change to the one defined on
>>>>     
>>>>         
>>> portlet.xml and
>>>   
>>>       
>>>> I don't know how to set the title from a method called from an action
>>>>     
>>>>         
>>> tag
>>>   
>>>       
>>>> instead of a render tag method (since I can't get a RenderResponse
>>>>     
>>>>         
>>> object
>>>   
>>>       
>>>> from a method called from an action tag). How can I set the title from
>>>> within an action method?
>>>>
>>>> Thanks in advance,
>>>> Edrick
>>>>
>>>> novotny wrote:
>>>>   
>>>>     
>>>>         
>>>>> Hi,
>>>>>
>>>>>     I believe that feature worked for GS2.X but not for 3...
>>>>>
>>>>> One thing you can do is to use
>>>>>
>>>>> RenderResponse#setTitle(String title)
>>>>>
>>>>> method in your portlet to set the title based on the locale
>>>>>
>>>>> Jason
>>>>>
>>>>> Edrick wrote:
>>>>>     
>>>>>       
>>>>>           
>>>>>> Can I set a portlet title for another language in the portlet.xml
>>>>>>         
>>>>>>             
>>> file of
>>>   
>>>       
>>>>>> my
>>>>>> proyect?
>>>>>>
>>>>>> I tried to change this:
>>>>>>          <title>Transaction Logs</title>
>>>>>> to this: 
>>>>>>          <title xml:lang="en">Transaction Logs</title>
>>>>>>          <title xml:lang="es">Registro de Transacciones</title>
>>>>>> but it doesn't work. I don't want to have all the portlet titles in
>>>>>> english
>>>>>> if I'm using another language. Can it be done in any other way? 
>>>>>>   
>>>>>>       
>>>>>>         
>>>>>>             
>>>>> _______________________________________________
>>>>> Gridsphere-users mailing list
>>>>> Gridsphere-users at gridsphere.org
>>>>> http://lists.gridsphere.org/mailman/listinfo/gridsphere-users
>>>>>
>>>>>
>>>>>     
>>>>>       
>>>>>           
>>>>   
>>>>     
>>>>         
>>> _______________________________________________
>>> Gridsphere-users mailing list
>>> Gridsphere-users at gridsphere.org
>>> http://lists.gridsphere.org/mailman/listinfo/gridsphere-users
>>>   
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Gridsphere-users mailing list
>>> Gridsphere-users at gridsphere.org
>>> http://lists.gridsphere.org/mailman/listinfo/gridsphere-users
>>>   
>>>       
>> _______________________________________________
>> Gridsphere-users mailing list
>> Gridsphere-users at gridsphere.org
>> http://lists.gridsphere.org/mailman/listinfo/gridsphere-users
>>
>>
>>     
>
>   



More information about the Gridsphere-users mailing list