aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas <>2021-05-27 17:19:01 +0200
committerThomas <>2021-05-28 13:40:25 +0200
commit0b1973c22e8f9e799a57629f4653324395b73664 (patch)
treeb7b7cf0d2eeece758dc234ca1a9c35304fc2bae9
parent34d5786b43c8562fe007392d7835a051e063f49f (diff)
downloadNational_eIDAS_Gateway-0b1973c22e8f9e799a57629f4653324395b73664.tar.gz
National_eIDAS_Gateway-0b1973c22e8f9e799a57629f4653324395b73664.tar.bz2
National_eIDAS_Gateway-0b1973c22e8f9e799a57629f4653324395b73664.zip
fix broken language selection in GUI
-rw-r--r--basicConfig/properties/messages.properties2
-rw-r--r--connector/src/main/java/at/asitplus/eidas/specific/connector/config/StaticResourceConfiguration.java17
2 files changed, 17 insertions, 2 deletions
diff --git a/basicConfig/properties/messages.properties b/basicConfig/properties/messages.properties
index ea604cda..0420d8b9 100644
--- a/basicConfig/properties/messages.properties
+++ b/basicConfig/properties/messages.properties
@@ -80,6 +80,8 @@ gui.countryselection.country.lu=Luxembourg
gui.countryselection.country.lu.logo.alt=Luxembourg-eID
gui.countryselection.country.mt=Malta
gui.countryselection.country.mt.logo.alt=Malta-eID
+gui.countryselection.country.no=Norway
+gui.countryselection.country.no.logo.alt=Norway-eID
gui.countryselection.country.ro=Romania
gui.countryselection.country.ro.logo.alt=Romania-eID
gui.countryselection.country.sk=Slovakia
diff --git a/connector/src/main/java/at/asitplus/eidas/specific/connector/config/StaticResourceConfiguration.java b/connector/src/main/java/at/asitplus/eidas/specific/connector/config/StaticResourceConfiguration.java
index a1e953f1..b4d58cdd 100644
--- a/connector/src/main/java/at/asitplus/eidas/specific/connector/config/StaticResourceConfiguration.java
+++ b/connector/src/main/java/at/asitplus/eidas/specific/connector/config/StaticResourceConfiguration.java
@@ -33,9 +33,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import org.springframework.web.servlet.i18n.CookieLocaleResolver;
import org.thymeleaf.templateresolver.FileTemplateResolver;
import at.asitplus.eidas.specific.connector.MsEidasNodeConstants;
@@ -50,7 +50,6 @@ import at.gv.egiz.eaaf.core.impl.utils.FileUtils;
*
*/
@Configuration
-@EnableWebMvc
public class StaticResourceConfiguration implements WebMvcConfigurer {
private static final Logger log = LoggerFactory.getLogger(StaticResourceConfiguration.class);
private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
@@ -160,6 +159,20 @@ public class StaticResourceConfiguration implements WebMvcConfigurer {
}
/**
+ * Get a i18n resolver based on cookies.
+ *
+ * @return
+ */
+ @Bean
+ public CookieLocaleResolver localeResolver() {
+ final CookieLocaleResolver localeResolver = new CookieLocaleResolver();
+ localeResolver.setCookieName("currentLanguage");
+ localeResolver.setCookieMaxAge(3600);
+ return localeResolver;
+
+ }
+
+ /**
* Get a Tyhmeleaf Template-Resolver with external configuration path.
*
* @return