You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by GESCONSULTOR - Óscar Bou <o....@gesconsultor.com> on 2013/06/11 09:41:44 UTC

Apache Isis i18n support

Hi to all.

We are going to explore the i18n capabilities of Isis. Is there any documentation, example online or any hints that can be useful?

Thanks in advance,

Oscar

Re: Apache Isis i18n support

Posted by GESCONSULTOR - Óscar Bou <o....@gesconsultor.com>.
Thanks, Dan.

We will try it.


El 11/06/2013, a las 10:13, Dan Haywood <da...@haywood-associates.co.uk> escribió:

> Hi Oscar,
> 
> This isn't well documented, but there are some i18n capabilities.
> 
> We should distinguish between the metamodel (eg names of classes,
> properties, collections, actions, action params) and the content (eg
> messages raised through DomainObjectContainer, or the title).
> 
> For the i18n of the metamodel, Isis utilizes the FacetDecorator API;
> specifically the I18nFacetDecorator that delegates in turn to an
> implementatino of the I18nManager interface.  One implementation is
> I18nManagerUsingResourceBundle, but other impls could be written.
> 
> To specify FacetDecorators, add the following to isis.properties:
> 
> isis.reflector.facet-decorators=org.apache.isis.core.progmodel.facetdecorators.i18n.resourcebundle.I18nDecoratorUsingResourceBundleInstaller
> 
> If you then put a break point in I18nFacetDecorator#decorate(Facet,
> FacetHolder), you should see it being called during the bootstrapping.
> 
> I haven't tried this out recently, but it ought to work.
> 
> ~~~
> With respect to the content of DOC messages, you are on your own.  For our
> Estatio project, we are probably going to use something like
> https://code.google.com/p/gettext-commons/.
> 
> For titles (also content), Isis does have some support, though it may be
> incomplete.  The TitleFacet, you will see, accepts a Localization object;
> Isis' internal wrapper around Locale.  Whether this is used by TitleFacet
> implementations is hit-n-miss, however.  For safety, probably best to fall
> back on using the title() method and internationalizing yourself using
> something like gettext-commons, above.
> 
> Let us know how you get on,
> 
> Dan
> 
> 
> 
> 
> On 11 June 2013 08:41, GESCONSULTOR - Óscar Bou <o....@gesconsultor.com>wrote:
> 
>> 
>> Hi to all.
>> 
>> We are going to explore the i18n capabilities of Isis. Is there any
>> documentation, example online or any hints that can be useful?
>> 
>> Thanks in advance,
>> 
>> Oscar


Re: Apache Isis i18n support

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Oscar,

This isn't well documented, but there are some i18n capabilities.

We should distinguish between the metamodel (eg names of classes,
properties, collections, actions, action params) and the content (eg
messages raised through DomainObjectContainer, or the title).

For the i18n of the metamodel, Isis utilizes the FacetDecorator API;
specifically the I18nFacetDecorator that delegates in turn to an
implementatino of the I18nManager interface.  One implementation is
I18nManagerUsingResourceBundle, but other impls could be written.

To specify FacetDecorators, add the following to isis.properties:

isis.reflector.facet-decorators=org.apache.isis.core.progmodel.facetdecorators.i18n.resourcebundle.I18nDecoratorUsingResourceBundleInstaller

If you then put a break point in I18nFacetDecorator#decorate(Facet,
FacetHolder), you should see it being called during the bootstrapping.

I haven't tried this out recently, but it ought to work.

~~~
With respect to the content of DOC messages, you are on your own.  For our
Estatio project, we are probably going to use something like
https://code.google.com/p/gettext-commons/.

For titles (also content), Isis does have some support, though it may be
incomplete.  The TitleFacet, you will see, accepts a Localization object;
Isis' internal wrapper around Locale.  Whether this is used by TitleFacet
implementations is hit-n-miss, however.  For safety, probably best to fall
back on using the title() method and internationalizing yourself using
something like gettext-commons, above.

Let us know how you get on,

Dan




On 11 June 2013 08:41, GESCONSULTOR - Óscar Bou <o....@gesconsultor.com>wrote:

>
> Hi to all.
>
> We are going to explore the i18n capabilities of Isis. Is there any
> documentation, example online or any hints that can be useful?
>
> Thanks in advance,
>
> Oscar