package cz.muni.fi.pa165.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.validation.Validator;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

import cz.muni.fi.pa165.sample.SampleDataConfiguration;

@Configuration
@EnableWebMvc
@Import(SampleDataConfiguration.class)
@ComponentScan(basePackages = "cz.muni.fi.pa165.controller")
class WebConfiguration extends WebMvcConfigurerAdapter {
    @Bean
    public ViewResolver viewResolver() {
        InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
        viewResolver.setPrefix("/WEB-INF/jsp/");
        viewResolver.setSuffix(".jsp");
        return viewResolver;
    }

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/webjars/**").addResourceLocations("/webjars/");
    }

    @Override
    public Validator getValidator() {
        return new LocalValidatorFactoryBean();
    }
}
@@ -27,16 +27,42 @@
 onfig;%0A%0A
+import java.util.Locale;%0A%0A
 import o
@@ -101,24 +101,24 @@
 ation.Bean;%0A
-
 import org.s
@@ -406,24 +406,79 @@
 actoryBean;%0A
+import org.springframework.web.servlet.LocaleResolver;%0A
 import org.s
@@ -749,24 +749,89 @@
 rerAdapter;%0A
+import org.springframework.web.servlet.i18n.FixedLocaleResolver;%0A
 import org.s
@@ -1627,24 +1627,24 @@
 lidator() %7B%0A
-
         retu
@@ -1684,10 +1684,128 @@
 );%0A    %7D
+%0A%0A    @Bean%0A    public LocaleResolver localeResolver() %7B%0A        return new FixedLocaleResolver(Locale.ENGLISH);%0A    %7D
 %0A%7D

Try to force English locale