Page 1 of 1

support for i18n in admin with version 3.0+??

Posted: Mon Feb 17, 2014 6:30 am
by padma
Please let us know how to implement i18n in admin to support multiple languages...

Re: support for i18n in admin with version 3.0+??

Posted: Mon Feb 17, 2014 11:25 am
by phillipuniverse
These are the properties files that Broadleaf uses in the admin:

broadleaf-admin-module:
classpath:/messages/CustomerCareMessages
classpath:/messages/MerchandisingMessages
classpath:/messages/PromotionMessages
classpath:/messages/RuleMessages
classpath:/messages/AbstractModuleMessages
classpath:/messages/UtilityMessages

broadleaf-contentmanagement-module:
classpath:/messages/ContentManagementMessages
classpath:/messages/GeneratedMessagesEntityCMS

broadleaf-open-admin:
classpath:/messages/GeneratedMessagesEntityCommon
classpath:/messages/GeneratedMessagesEntityFramework
classpath:/messages/GeneratedMessagesEntityOpenAdmin
classpath:/messages/GeneratedMessagesEntityProfile
classpath:/messages/OpenAdminMessages

These files are split out into multiple Broadleaf projects notated above. For instance, these are the properties files in the broadleaf-open-admin module: https://github.com/BroadleafCommerce/Br ... s/messages

Now we're just in normal Spring i18n support. For all of the keys in all of those files, provide values for them in the language that you want and then save it with an '_<localecode>'. For instance, if you want a Spanish translation for the 'OpenAdminMessages.properties' file, simply create a new file in your admin project at src/main/resources/messages/OpenAdminMessages_es.properties. As long as your locale language code is es then Spring will automatically choose this file instead of the Broadleaf one and provide those overridden values.