Details
Description
Tapestry uses ValidationStrings class to handle translations for error messages.
This class should return a message from the ValidationStrings.properties, which correspond to the current locale in Tapestry.
When Tapestry is used in the non-en environment (System properties user.language/user.country set i.e. to DE), the messages are displayed in the default locale instead of the current locale of tapestry. This happens even when accepted-locale are set in Tapestry to en only.
The buggy function is ValidationStrings.getMessagePattern, which looks like:
public static String getMessagePattern(String key, Locale locale)
{ return ResourceBundle.getBundle(RESOURCE_BUNDLE, locale).getString(key); }It tries to get a localized message from the resource bundle. When you read JavaDoc for getBundle, it says, how the resolving works. And the strategy is:
bundle_[locale-from-parameter]
bundle_[default-locale]
bundle
So in my case, it was trying:
ValidationStrings_en
ValidationStrings_de
ValidationStrings
ValidationStrings_en doesn't exists so the german translation was taken.
To fix this, you should create a translation bundle also for english (ValidationStrings_en).