tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Wyraz (Issue Comment Edited) (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (TAP5-1704) Localizing the "Today" and "None" labels in the core datefield component
Date Mon, 12 Mar 2012 12:37:34 GMT

    [ https://issues.apache.org/jira/browse/TAP5-1704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13227463#comment-13227463
] 

Michael Wyraz edited comment on TAP5-1704 at 3/12/12 12:36 PM:
---------------------------------------------------------------

I created a patch for this. It could be improved by adding the translations within DateFieldStack
but i have no idea how to access the message bundle for DateField there nor to add one for
DateFieldStack. Other translations required (i added english and german).

                
      was (Author: michael@wyraz.de):
    I created a patch for this. It could be improved by adding the translations within DateFieldStack
but i have no idea how to access the message bundle for DateField there nor to add one for
DateFieldStack. Other translations required (i added english and german).

Patch for 5.3 Branch;

### Eclipse Workspace Patch 1.0
#P tapestry5-trunk
Index: tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/DateField.java
===================================================================
--- tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/DateField.java	(revision
1299621)
+++ tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/DateField.java	(working
copy)
@@ -245,6 +245,7 @@
         spec.put("parseURL", resources.createEventLink("parse").toURI());
         spec.put("formatURL", resources.createEventLink("format").toURI());
 
+        support.addScript("DatePicker.buttonToday='%s';DatePicker.buttonNone='%s'", messages.get("datepicker-button-today"),messages.get("datepicker-button-none"));
         support.addInitializerCall("dateField", spec);
     }
 
Index: tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js
===================================================================
--- tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js
(revision 1299621)
+++ tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js
(working copy)
@@ -90,6 +90,8 @@
     "May", "June", "July", "August",
     "September", "October", "November", "December"];
 DatePicker.days = ["m", "t", "w", "t", "f", "s", "s"];
+DatePicker.buttonToday = "Today";
+DatePicker.buttonNone = "None";
 
 
 // Function invoked whenever the selected date changes, whether by
@@ -187,7 +189,7 @@
     this._todayButton = doc.createElement("button");
     this._todayButton.className = "todayButton";
     this._todayButton.setAttribute("type", "button");
-    this._todayButton.appendChild(doc.createTextNode("Today"));
+    this._todayButton.appendChild(doc.createTextNode(DatePicker.buttonToday));
     td.appendChild(this._todayButton);
     tr.appendChild(td);
 
@@ -200,7 +202,7 @@
     this._noneButton = doc.createElement("button");
     this._noneButton.className = "noneButton";
     this._noneButton.setAttribute("type", "button");
-    this._noneButton.appendChild(doc.createTextNode("None"));
+    this._noneButton.appendChild(doc.createTextNode(DatePicker.buttonNone));
     td.appendChild(this._noneButton);
     tr.appendChild(td);
 
Index: tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField.properties
===================================================================
--- tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField.properties
(revision 1299621)
+++ tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField.properties
(working copy)
@@ -13,3 +13,5 @@
 # limitations under the License.
 
 date-value-not-parseable=Date value '%s' is not parseable.
+datepicker-button-today=Today
+datepicker-button-none=None
Index: tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField_de.properties
===================================================================
--- tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField_de.properties
(revision 1299621)
+++ tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField_de.properties
(working copy)
@@ -13,3 +13,5 @@
 # limitations under the License.
 
 date-value-not-parseable=Datumswert '%s' kann nicht geparst werden.
+datepicker-button-today=heute
+datepicker-button-none=kein

                  
> Localizing the "Today" and "None" labels in the core datefield component
> ------------------------------------------------------------------------
>
>                 Key: TAP5-1704
>                 URL: https://issues.apache.org/jira/browse/TAP5-1704
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3
>            Reporter: Patricia Arranz
>
> In de DateField Component the text of the buttons "Today" and "None" donĀ“t get translated.
they are hardcoded in the javascript code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message