package io.traintracker.app;

import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@SpringBootApplication
@EnableCaching
public class TrainTrackerApplication extends WebMvcConfigurerAdapter {

	public static void main(String[] args) {
		SpringApplication.run(TrainTrackerApplication.class, args);
	}

	@Override
	public void addViewControllers(ViewControllerRegistry registry) {
		registry.addViewController("/").setViewName("home");
	}

	@Bean
	public CloseableHttpClient httpClient() {
		return HttpClients.createDefault();
	}

}

@@ -358,16 +358,94 @@
 n.Bean;%0A
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;%0A
 import o
@@ -598,16 +598,151 @@
 Adapter;
+%0Aimport org.springframework.web.servlet.i18n.CookieLocaleResolver;%0Aimport org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
 %0A%0A@Sprin
@@ -953,16 +953,150 @@
 s);%0A%09%7D%0A%0A
+%09@Override%0A%09public void addInterceptors(InterceptorRegistry registry) %7B%0A%09%09registry.addInterceptor(new LocaleChangeInterceptor());%0A%09%7D%0A%0A
 %09@Overri
@@ -1316,10 +1316,204 @@
 ();%0A%09%7D%0A%0A
+%09@Bean%0A%09public CookieLocaleResolver localeResolver() %7B%0A%09%09CookieLocaleResolver localeResolver = new CookieLocaleResolver();%0A%09%09localeResolver.setCookieName(%22LOCALE%22);%0A%09%09return localeResolver;%0A%09%7D%0A%0A
 %7D%0A

Enable i18n support