You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-user@portals.apache.org by Otott Zsofia <zs...@rndsoft.hu> on 2004/09/06 12:06:37 UTC

supported locales

Hello, 

I saw that in the portlet.xml it is possible to entry supported locales. But I don't know which function returns it for me. Can anyone help me with this?

Zsofi

Re: supported locales

Posted by Christof Dallermassl <cd...@hyperwave.com>.
Hi!

> There are two sides to the story. Inside the
> Portlet.xml, you are specifying which locales you
> support from within your portlet. You specify your
> intent to support specific locales with the
> <supported-locale> tag. Additionally, you can provide
> a resource bundle class or properties file for each
> language you support.

I think, the <supported-locale> from the portlet.xml file is not used at all. 
The supportedLocales field in 
org.apache.pluto.portalImpl.om.portlet.impl.PortletDefinitionImpl is never 
used (IMHO). And the getLocale/getLocales methods in 
org.apache.pluto.core.impl.PortletRequestImpl forward the call to the servlet 
request.

Addtionally, the getSupportedLocale method in the PortletDefinition is NOT in 
the interface, only in the portal class. (is this a bug???)

Apart from this, thanks a lot to all pluto developers!

regards,
Christof
-- 
---------------------------------------------------------------------------
Christof Dallermassl, Software Developer
Hyperwave Research & Development, Albrechtgasse 9, A-8010 Graz, Austria
Tel. +43 316 82 09 18 - 634, Fax +43 316 82 09 18 - 99
mailto: christof.dallermassl@hyperwave.com
http://www.hyperwave.com
---------------------------------------------------------------------------

Re: supported locales

Posted by Otott Zsofia <zs...@rndsoft.hu>.
Hello Ken,

Thank you for your reply, but it isn't really clear, that with the
getLocales method, I really get the supported locales, and not the locales
accepted by the clients. Because in javax.servlet.ServletRequest the
getLocales method : "Returns an Enumeration of Locale objects indicating, in
decreasing order starting with the preferred locale, the locales that are
acceptable to the client based on the Accept-Language header. If the client
request doesn't provide an Accept-Language header, this method returns an
Enumeration containing one Locale, the default locale for the server." And
in the PortletRequest it is almost the same: "Returns an Enumeration of
Locale objects indicating, in decreasing order starting with the preferred
locale in which the portal will accept content for this request. The Locales
may be based on the Accept-Language header of the client."
I may misunderstood something, can you explain me how this method works?

Thanks,

 Zsofi

----- Original Message ----- 
From: "Kenneth Ramirez" <ke...@yahoo.com>
To: <pl...@portals.apache.org>
Sent: Tuesday, September 07, 2004 2:05 AM
Subject: Re: supported locales


> There are two sides to the story. Inside the
> Portlet.xml, you are specifying which locales you
> support from within your portlet. You specify your
> intent to support specific locales with the
> <supported-locale> tag. Additionally, you can provide
> a resource bundle class or properties file for each
> language you support.
>
> At runtime, you can retrieve the client/portal
> supported locales via the PortletRequest class by
> calling the getLocales() method. This method returns
> an Enumeration of locale objects (starting with the
> preferred locale). At this point, you can choose which
> locale you wish to send your content back in, pass it
> to the getResourceBundle method and pull up the
> appropriate resource bundle for use in your rendition.
>
> Hope this helps.
>
> Ken
> --- Otott Zsofia <zs...@rndsoft.hu> wrote:
>
> > Hello,
> >
> > I saw that in the portlet.xml it is possible to
> > entry supported locales. But I don't know which
> > function returns it for me. Can anyone help me with
> > this?
> >
> > Zsofi
>
>
>
>
> _______________________________
> Do you Yahoo!?
> Win 1 of 4,000 free domain names from Yahoo! Enter now.
> http://promotions.yahoo.com/goldrush
>


Re: supported locales

Posted by Kenneth Ramirez <ke...@yahoo.com>.
There are two sides to the story. Inside the
Portlet.xml, you are specifying which locales you
support from within your portlet. You specify your
intent to support specific locales with the
<supported-locale> tag. Additionally, you can provide
a resource bundle class or properties file for each
language you support.

At runtime, you can retrieve the client/portal
supported locales via the PortletRequest class by
calling the getLocales() method. This method returns
an Enumeration of locale objects (starting with the
preferred locale). At this point, you can choose which
locale you wish to send your content back in, pass it
to the getResourceBundle method and pull up the
appropriate resource bundle for use in your rendition.

Hope this helps.

Ken
--- Otott Zsofia <zs...@rndsoft.hu> wrote:

> Hello, 
> 
> I saw that in the portlet.xml it is possible to
> entry supported locales. But I don't know which
> function returns it for me. Can anyone help me with
> this?
> 
> Zsofi



		
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush