(apols for previous half-complete email, sent accidentally)
~~~~~~~

Hi Jeroen,

Yes, this is supported (though I must admit I haven't tried it out recently). It is done using "facet decorators", that replace or wrap the NamedFacet (corresponding to @Named facet) that is in the metamodel.

The facet decorator you should use is the I18n facet decorator:

isis.reflector.facet-decorators=resource-i18n

then have a look at the implementation of ResourceBasedI18nManager that is used by the installed facet decorator; you should be able to see what it's searching the resource bundle for.

~~~
In fact, there is another alternative, which is to write your own implementations of a FacetFactory to install your own NamedFacet. You could use the original NamedAnnotationFacetFactory as a guideline. You could then include your own facet factory and exclude the original, using:

isis.reflector.facets.include=com.mycompany.MyNamedFacetFactory
isis.reflector.facets.exclude=org.apache.isis.core.progmodel.facets.naming.named.NamedAnnotationFacetFactory


Learning this API is worthwhile, because it'll open up other options for you, eg getting the labels from a database, etc.

~~~
fyi, I'm hoping that we might be able, in time, to get rid of facet decorators and simply use facet factories instead. I've raised a JIRA (ISIS-69) for this.

Cheers
Dan


On 04/01/2011 13:04, Jeroen van der Wal wrote:
We're looking to use Isis in a multi language environment. Therefore
annotations like @Named, @Plural and @DescribedAs could have different
descriptions depending on the language being set. Is there a pattern
available to accomplish this? In regular Java code we use the
gettext-commons library.

Thanks,

Reply via email to