Skip to content

Commit

Permalink
Merged in bugfix/SHIBUI-894 (pull request #206)
Browse files Browse the repository at this point in the history
SHIBUI-894 Removing mock i18n testing file

Approved-by: Bill Smith <wsmith@unicon.net>
Approved-by: Ryan Mathis <rmathis@unicon.net>
  • Loading branch information
rmathis committed Sep 27, 2018
2 parents b5f9854 + d431233 commit bde749f
Show file tree
Hide file tree
Showing 4 changed files with 470 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,22 @@ public class InternationalizationConfiguration {
public LocaleResolver localeResolver() {
// TODO if we want to control the order, we can implement our own locale resolver instead of using the SessionLocaleResolver.
SessionLocaleResolver sessionLocaleResolver = new SessionLocaleResolver();

// NOTE: If we set a default here, Locale.getDefault's behavior will be consistent, but then Accept-Language
// is not honored (only ?lang=). If we do not set a default, the default is determined at runtime by the JVM.
// This may break unit tests if the system does not determine the default to be English.
// sessionLocaleResolver.setDefaultLocale(new Locale("en"));

return sessionLocaleResolver;
}

@Bean
public MappedResourceBundleMessageSource messageSource() {
MappedResourceBundleMessageSource source = new MappedResourceBundleMessageSource();
source.setBasenames("i18n/messages");
source.setUseCodeAsDefaultMessage(true);
source.setUseCodeAsDefaultMessage(false); //TODO Why was this true?
source.setFallbackToSystemLocale(false); // allows us to return messages.properties instead of
// messages_en.properties for unsupported languages.
return source;
}
}
Loading

0 comments on commit bde749f

Please sign in to comment.