compress finalise, cert test, locale test

This commit is contained in:
Anthony Stirling
2023-05-20 22:48:59 +01:00
parent 9d80458250
commit 3cad43006a
7 changed files with 195 additions and 28 deletions

View File

@@ -2,8 +2,10 @@ package stirling.software.SPDF.config;
import java.util.Locale;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@@ -50,4 +52,15 @@ public class Beans implements WebMvcConfigurer {
return slr;
}
@Bean
public MessageSource messageSource() {
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
//messageSource.setBasename("classpath:messages");
messageSource.setDefaultEncoding("UTF-8");
messageSource.setUseCodeAsDefaultMessage(true);
messageSource.setDefaultLocale(Locale.UK); // setting default locale
return messageSource;
}
}