This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 2_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/2_0_X by this push:
     new 52b059d  [SYNCOPE-1560] Fix with default locale en
52b059d is described below

commit 52b059d50c7e03b8053425fe6f02bcb2bf9300df
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Tue May 12 12:06:39 2020 +0200

    [SYNCOPE-1560] Fix with default locale en
---
 .../client/console/wicket/markup/html/form/BinaryFieldPanel.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java
index 0ea8023..a187f16 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java
@@ -28,6 +28,7 @@ import de.agilecoders.wicket.jquery.function.IFunction;
 import java.io.ByteArrayInputStream;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
+import java.util.Locale;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
@@ -176,8 +177,11 @@ public class BinaryFieldPanel extends FieldPanel<String> {
         uploadForm.add(downloadLink);
 
         FileInputConfig config = new FileInputConfig().
-        showUpload(false).showRemove(false).showPreview(false).
-        withLocale(SyncopeConsoleSession.get().getLocale().getLanguage());
+                showUpload(false).showRemove(false).showPreview(false);
+        String language = 
SyncopeConsoleSession.get().getLocale().getLanguage();
+        if (!Locale.ENGLISH.getLanguage().equals(language)) {
+            config.withLocale(language);
+        }
 
         fileUpload = new BootstrapFileInputField("fileUpload", new 
ListModel<>(new ArrayList<FileUpload>()), config);
         fileUpload.setOutputMarkupId(true);

Reply via email to