Download Developer Guide - Oracle Documentation

Transcript
Internationalization and Localization
business user through the Commerce Manager user interface. Attributes are relatively
slower than Locale Dependent Fields and are only supported for Products, Categories,
and SKUs.
How to add new properties files
Spring framework provides messaging (i18n or internationalization) functionality by using
MessageSource. When an ApplicationContext gets loaded, it automatically searches for
a MessageSource bean named "messageSource" defined in the context.
In the Storefront, messageSource bean is defined in /WEBINF/conf/spring/views/velocity/velocity.xml. The MessageSource implementation used in
AquaLogic Commerce Services, ResourceBundleMessageSource, supports a
hierarchical structure that defines where properties files should be defined. See the
anotated XML code below.
<bean id="messageSource"
class="org.springframework.context.support.
ReloadableResourceBundleMessageSource">
<!-- Define the parent message source bean -->
<property name="parentMessageSource"> <ref bean="globalMessageSource"/>
</property>
<property name="basenames">
<list>
<!-- Define .properties files here (omitt the extension) -->
<value>/WEB-INF/templates/velocity/account/create</value>
<value>/WEB-INF/templates/velocity/address/create</value>
...
</list>
</property>
</bean>
<bean id="globalMessageSource"
class="org.springframework.context.support.
ReloadableResourceBundleMessageSource">
<property name="basenames">
<list>
<!-- Global .properties files are defined here -->
<value>/WEB-INF/templates/velocity/globals</value>
<value>org/acegisecurity/messages</value>
</list>
BEA AquaLogic Commerce Services Developer Guide
149