You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Thomas Vandahl <tv...@apache.org> on 2008/10/05 18:09:11 UTC

Re: TurbineLocalizationService

b.v.weert@valbosoft.com wrote:
> If I wanted to call the localizationTool from within my code to get a
> localized string, what would then be the best method? Construct it by hand,
> or does Turbine provide some feature for this?

There is the static accessor Localization.getString(String, Locale),
however if you believe this is necessary, I suggest you should think
again. Localization should be done in the view layer, not in the controller.

That said, you may well be right to attempt what you want. That's what
the above-mentioned accessor is for.

Bye, Thomas.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@turbine.apache.org
For additional commands, e-mail: dev-help@turbine.apache.org


Re: TurbineLocalizationService

Posted by Thomas Vandahl <tv...@apache.org>.
Boudewijn van Weert wrote:
> I want to use this method when I have to generate special messages after a
> certain operation, like f.e. that a database operation was successful. This
> has to be done in the controller..

Not really. I usually return a localization key that points to the full
message, like in

data.setMessage(Constants.DB_SUCCESS);

and display it in the template like

$l10n.get($data.Message)

Bye, Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@turbine.apache.org
For additional commands, e-mail: dev-help@turbine.apache.org


Re: TurbineLocalizationService

Posted by Boudewijn van Weert <b....@valbosoft.com>.
Hi,

I want to use this method when I have to generate special messages after a
certain operation, like f.e. that a database operation was successful. This
has to be done in the controller..

Cheers, Bo

2008/10/5 Thomas Vandahl <tv...@apache.org>

> b.v.weert@valbosoft.com wrote:
> > If I wanted to call the localizationTool from within my code to get a
> > localized string, what would then be the best method? Construct it by
> hand,
> > or does Turbine provide some feature for this?
>
> There is the static accessor Localization.getString(String, Locale),
> however if you believe this is necessary, I suggest you should think
> again. Localization should be done in the view layer, not in the
> controller.
>
> That said, you may well be right to attempt what you want. That's what
> the above-mentioned accessor is for.
>
> Bye, Thomas.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@turbine.apache.org
> For additional commands, e-mail: dev-help@turbine.apache.org
>
>