diff --git a/pom.xml b/pom.xml index 14b87e4..c04b96c 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ 999999-SNAPSHOT jenkinsci/locale-plugin - 2.440.3 + 2.452.1 1810.v9b_c30a_249a_4c false @@ -42,7 +42,7 @@ io.jenkins.tools.bom - bom-2.440.x + bom-2.452.x 3120.v4d898e1e9fc4 pom import diff --git a/src/main/java/hudson/plugins/locale/LocaleFilter.java b/src/main/java/hudson/plugins/locale/LocaleFilter.java index 3276728..8001c18 100644 --- a/src/main/java/hudson/plugins/locale/LocaleFilter.java +++ b/src/main/java/hudson/plugins/locale/LocaleFilter.java @@ -1,7 +1,9 @@ package hudson.plugins.locale; import java.io.IOException; +import java.util.Enumeration; import java.util.Locale; +import java.util.NoSuchElementException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; @@ -33,6 +35,29 @@ public Locale getLocale() { // Force locale to configured default, ignore request' Accept-Language header return Locale.getDefault(); } + + @Override + public Enumeration getLocales() { + // Create a custom Enumeration with only the default locale + return new Enumeration() { + private boolean hasMoreElements = true; + + @Override + public boolean hasMoreElements() { + return hasMoreElements; + } + + @Override + public Locale nextElement() { + if (hasMoreElements) { + hasMoreElements = false; + return getLocale(); + } else { + throw new NoSuchElementException(); + } + } + }; + } }; } }