From: "Spectron International, Inc." <[EMAIL PROTECTED]>

> I want to be able to set the locale-attribure for the request in an
action.
> I have an action that reads the locale from a database and I use the
> following to set the locale:
>
> Request request=ObjectModelHelper.getRequest(objectModel);
> request.setAttribute('locale-attribute',locale);

Why don't you use this in your sitemap:

<map:transform type="i18n">
    <map:parameter name="locale" value="{../locale}"/>
</map:transform>
?

This is the proposed way of setting locale using a custom action. See
/samples/i18n/ sitemap to get the idea.

Btw, you should set 'locale' and not the 'locale-attribute' for
LocaleAction.

--
Konstantin

>
> I have tried, 'locale-attribute', 'language-attribute' but it doesn't
work.
> This is what I get in the log (the first 2 messages are from my action, so
> is reading the locale from the database ok):
>
> DEBUG (2002-05-07) 14:08.33:283
> [sitemap.action.get-locale](/cocoon/msim/MainMenu2)
> SocketListener-1/MyAction: Using datasource [msim].
> DEBUG (2002-05-07) 14:08.33:300
> [sitemap.action.get-locale](/cocoon/msim/MainMenu2)
> SocketListener-1/MyAction: Using locale-attribute [es]
> DEBUG (2002-05-07) 14:08.33:308
> [sitemap.transformer.i18n](/cocoon/msim/MainMenu2)
> SocketListener-1/I18nTransformer: I18nTransformer: catalog
> location:translations
> DEBUG (2002-05-07) 14:08.33:311
> [sitemap.transformer.i18n](/cocoon/msim/MainMenu2)
> SocketListener-1/I18nTransformer: I18nTransformer: catalog
> directory:file:/opt/jetty/webapps/cocoon/msim/translations/
> DEBUG (2002-05-07) 14:08.33:312
> [sitemap.transformer.i18n](/cocoon/msim/MainMenu2)
> SocketListener-1/XMLResourceBundleFactory: XMLResourceBundleFactory
> configured with: cacheAtStartup = false, directory =
> 'file:/opt/jetty/webapps/cocoon/msim/translations/'
> DEBUG (2002-05-07) 14:08.33:313
> [sitemap.transformer.i18n](/cocoon/msim/MainMenu2)
> SocketListener-1/I18nTransformer: I18nTransformer: configured
> DEBUG (2002-05-07) 14:08.33:315
> [sitemap.transformer.i18n](/cocoon/msim/MainMenu2)
> SocketListener-1/I18nTransformer: I18nTransformer: using locale en_US
> DEBUG (2002-05-07) 14:08.33:316
> [sitemap.transformer.i18n](/cocoon/msim/MainMenu2)
> SocketListener-1/XMLResourceBundleFactory: _getBundle: messages, locale
> en_US
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to