You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2016/08/18 15:40:48 UTC

svn commit: r1756819 - in /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main: java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/ resources/o...

Author: weber
Date: Thu Aug 18 15:40:48 2016
New Revision: 1756819

URL: http://svn.apache.org/viewvc?rev=1756819&view=rev
Log:
TOBAGO-1580 - Multifile-Upload Component: I18n

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FileRenderer.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago.properties.xml
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago_de.properties.xml
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago_es.properties.xml
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FileRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FileRenderer.java?rev=1756819&r1=1756818&r2=1756819&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FileRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FileRenderer.java Thu Aug 18 15:40:48 2016
@@ -19,6 +19,7 @@
 
 package org.apache.myfaces.tobago.renderkit.html.standard.standard.tag;
 
+import org.apache.myfaces.tobago.context.ResourceManagerUtils;
 import org.apache.myfaces.tobago.internal.component.AbstractUIFile;
 import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
 import org.apache.myfaces.tobago.internal.util.PartUtils;
@@ -146,6 +147,8 @@ public class FileRenderer extends LabelL
     writer.writeIdAttribute(fieldId);
     writer.writeClassAttribute(Classes.create(file, "real"));
     writer.writeNameAttribute(clientId);
+    String multiFormat = ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "tobago.file.multiFormat");
+    writer.writeAttribute(DataAttributes.dynamic("tobago-file-multi-format"), multiFormat, true);
     // readonly seems not making sense in browsers.
     writer.writeAttribute(HtmlAttributes.DISABLED, file.isDisabled() || file.isReadonly());
     writer.writeAttribute(HtmlAttributes.READONLY, file.isReadonly());

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago.properties.xml?rev=1756819&r1=1756818&r2=1756819&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago.properties.xml (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago.properties.xml Thu Aug 18 15:40:48 2016
@@ -35,6 +35,9 @@
   <entry key="configButtonText">Configuration</entry>
   <entry key="configCachecoverage">Cache coverage</entry>
 
+  <!-- File-->
+  <entry key="tobago.file.multiFormat">{} files selected</entry>
+
   <!-- Sheet -->
   <entry key="sheetFirst">First Page</entry>
   <entry key="sheetPrev">Previous Page</entry>

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago_de.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago_de.properties.xml?rev=1756819&r1=1756818&r2=1756819&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago_de.properties.xml (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago_de.properties.xml Thu Aug 18 15:40:48 2016
@@ -37,6 +37,9 @@
   <entry key="configButtonText">Einstellungen</entry>
   <entry key="configCachecoverage">Cache Abdeckung</entry>
 
+  <!-- File-->
+  <entry key="tobago.file.multiFormat">{} Dateien ausgewählt</entry>
+
   <!-- Sheet -->
   <entry key="sheetFirst">erste Seite</entry>
   <entry key="sheetPrev">vorherige Seite</entry>

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago_es.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago_es.properties.xml?rev=1756819&r1=1756818&r2=1756819&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago_es.properties.xml (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago_es.properties.xml Thu Aug 18 15:40:48 2016
@@ -35,6 +35,9 @@
   <entry key="configButtonText">Configuracion</entry>
   <entry key="configCachecoverage">Cobertura de cache</entry>
 
+  <!-- File-->
+  <entry key="tobago.file.multiFormat">{} archivos seleccionados</entry>
+
   <!-- Sheet -->
   <entry key="sheetFirst">Primera Página</entry>
   <entry key="sheetPrev">Página Anterior</entry>

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1756819&r1=1756818&r2=1756819&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Thu Aug 18 15:40:48 2016
@@ -2006,7 +2006,8 @@ Tobago.File.init = function(elements) {
     var pretty = file.parent().find(".tobago-file-pretty");
     var text;
     if (file.prop("multiple")) {
-      text = file.prop("files").length  + " files"; // todo i18n
+      var format = file.data("tobago-file-multi-format");
+      text = format.replace("{}", file.prop("files").length);
     } else {
       text = file.val();
       // remove path, if any. Some old browsers set the path, others like webkit uses the prefix "C:\facepath\".