From 38237c181334aa28dec7394755732cb19353f4b5 Tue, 13 Nov 2012 14:49:46 +0100
From: Michael Wyraz <[email protected]>
Date: Tue, 13 Nov 2012 14:37:57 +0100
Subject: [PATCH] TAP5-1027 DatePicker component: "None", "Today" buttons localisation

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..4cb37f9 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,5 @@
 # limitations under the License.

 date-value-not-parseable=Date value '%s' is not parseable.
+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..e697f18 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,5 @@
 # limitations under the License.

 date-value-not-parseable=Datumswert '%s' kann nicht geparst werden.
+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);

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to