Error message translations are handled in a similar way to displayable string translations. Each Java class that can produce error messages determines the customer’s current locale and chooses the correct error message resource bundles accordingly.
Default Translations
Commerce Reference Store error messages for the default locale (English) are defined in a number of locations. For the English translations, Commerce Reference Store uses a layered resource bundle model, where some of the error messages come from the ATG platform and Oracle ATG Web Commerce, and then Commerce Reference Store layers on additional error messages in additional resource bundle files as necessary. For example, some gift list error messages are stored in the /atg/commerce/gifts/UserMessages.properties
file in <ATG10dir>/DCS/lib/resources.jar
while additional gift list messages are stored in the /atg/commerce/gifts/UserMessages.properties
file in <ATG10dir>/CommerceReferenceStore/Store/EStore/lib/classes.jar
. It is the aggregate of these two /atg/commerce/gifts/UserMessage.properties
files that represents the total collection of gift list error messages.
Commerce Reference Store uses this resource bundle from the ATG platform. It is stored in <ATG10dir>/DPS/lib/resources.jar
.
/atg/userprofiling/ProfileUserResources.properties
Commerce Reference Store uses these resource bundles from Oracle ATG Web Commerce. They are stored in <ATG10dir>/DCS/lib/resources.jar
.
/atg/commerce/catalog/comparison/UserMessages.properties
/atg/commerce/gifts/UserMessages.properties
/atg/commerce/order/UserMessages.properties
/atg/commerce/order/purchase/PurchaseProcessResources.properties
/atg/commerce/order/purchase/UserMessages.properties
/atg/commerce/profile/UserMessages.properties
/atg/commerce/promotion/PromotionResources.properties
/atg/commerce/util/CountryStateResources.properties
/atg/payment/creditcard/CreditCardResources.properties
Commerce Reference Store layers these resource bundles on top of bundles that exist in Oracle ATG Web Commerce. They are stored in <ATG10dir>/CommerceReferenceStore/Store/EStore/lib/classes.jar
:
/atg/commerce/catalog/comparison/UserMessages.properties
/atg/commerce/gifts/UserMessages.properties
/atg/commerce/order/UserMessages.properties
/atg/commerce/order/purchase/PurchaseProcessResources.properties
/atg/commerce/order/purchase/UserMessages.properties
/atg/commerce/profile/UserMessages.properties
/atg/commerce/promotion/PromotionResources.properties
Finally, Commerce Reference Store adds these new resource bundles to the <ATG10dir>/CommerceReferenceStore/Store/EStore/lib/classes.jar
file:
/atg/projects/store/catalog/EmailAFriendResources.properties
/atg/projects/store/inventory/UserMessage.properties
/atg/service/email/UserMessages.properties
Creating Error Message Resource Bundles for Other Languages
To create localized error messages, you must create a set of companion resource bundles for each language. These files must:
Reside in the same Nucleus path locations as their default locale counterparts.
Follow the name extension rule of an underscore and a two-letter, lower-case language code as defined by ISO 639.
Take into account any resource bundle layering. For example,
/atg/commerce/gifts/UserMessages_de.properties
contains German translations for the messages contained in both the/atg/commerce/gifts/UserMessages.properties
file in<ATG10dir>/DCS/lib/resources.jar
and the/atg/commerce/gifts/UserMessages.properties
file in<ATG10dir>/CommerceReferenceStore/Store/EStore/lib/classes.jar
.
Commerce Reference Store includes error message bundles for both German and Spanish. The German error messages are contained in the following files in <ATG10dir>/CommerceReferenceStore/Store/EStore/lib/classes.jar
:
/atg/commerce/catalog/comparison/UserMessages_de.properties
/atg/commerce/gifts/UserMessages_de.properties
/atg/commerce/order/UserMessages_de.properties
/atg/commerce/order/purchase/PurchaseProcessResources_de.properties
/atg/commerce/order/purchase/UserMessages_de.properties
/atg/commerce/profile/UserMessages_de.properties
/atg/commerce/promotion/PromotionResources_de.properties
/atg/commerce/util/CountryStateResources_de.properties
/atg/payment/creditcard/CreditCardResources_de.properties
/atg/projects/store/catalog/EmailAFriendResources_de.properties
/atg/projects/store/inventory/UserMessage_de.properties
/atg/service/email/UserMessages_de.properties
/atg/userprofiling/ProfileUserResources_de.properties
The Spanish error messages are contained in a similar set of files that use the _es
extension in place of _de
.
You can make copies of the error message resource bundles and edit them to include your localized text. Because they contain the aggregate of all English error messages, it is easiest to copy either the German or Spanish resource bundle files when creating resource bundles for a new language in Commerce Reference Store.