You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Michael Wyraz <mi...@evermind.de> on 2012/05/22 13:29:08 UTC

Patch: localized datepicker buttons (Branch 5.3)

 From e6b7bc43c665c34e1d8000e7b2966d552b67d8e9 Tue, 22 May 2012 13:27:33 
+0200
From: Michael Wyraz <mi...@evermind.de>
Date: Tue, 22 May 2012 13:24:31 +0200
Subject: [PATCH] localized datepicker buttons ("Today" and "None")

diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/DateField.java 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/DateField.java
index 39ed01b..edf61bb 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/DateField.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/DateField.java
@@ -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);
      }

diff --git 
a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField.properties 
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField.properties
index d1f326f..d8eeeca 100644
--- 
a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField.properties
+++ 
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField.properties
@@ -13,3 +13,7 @@
  # limitations under the License.

  date-value-not-parseable=Date value '%s' is not parseable.
+datepicker-button-today=Today
+datepicker-button-none=None
+datepicker-button-today=Today
+datepicker-button-none=None
diff --git 
a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField_de.properties 
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField_de.properties
index 27c7282..3c8ae07 100644
--- 
a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField_de.properties
+++ 
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField_de.properties
@@ -13,3 +13,7 @@
  # limitations under the License.

  date-value-not-parseable=Datumswert '%s' kann nicht geparst werden.
+datepicker-button-today=heute
+datepicker-button-none=kein
+datepicker-button-today=heute
+datepicker-button-none=kein
diff --git 
a/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js 
b/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js
index 5033ad4..5b95c6e 100644
--- 
a/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js
+++ 
b/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js
@@ -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);

-- 
Mit freundlichen Grüßen / Regards

Michael Wyraz

evermind GmbH
Schorlemmerstraße 1
04155 Leipzig

Tel.:       +49 (0)341-25 39 66 - 0
Fax:        +49 (0)341-25 39 66 - 1
Funk:       +49 (0)177-73 00 00 3
E-Mail:     michael.wyraz@evermind.de

HRB: 21586
Amtsgericht Leipzig

Geschäftsführer:
Christoph Klemm
Thomas Grünert
Michael Wyraz


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org