You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2012/11/11 21:11:19 UTC

[1/9] git commit: Localize the "Today" and "None" buttons of the DatePicker Make the buttons smaller so that they fit when translated (to French)

Updated Branches:
  refs/heads/5.4-js-rewrite b4a8eb7cc -> 719ef814e


Localize the "Today" and "None" buttons of the DatePicker
Make the buttons smaller so that they fit when translated (to French)


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/719ef814
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/719ef814
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/719ef814

Branch: refs/heads/5.4-js-rewrite
Commit: 719ef814e368aad9dffc6ed4f26262a51a9493ad
Parents: 0570566
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Sun Nov 11 12:10:35 2012 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Sun Nov 11 12:10:35 2012 -0800

----------------------------------------------------------------------
 .../META-INF/modules/core/datefield.coffee         |    3 +
 .../apache/tapestry5/services/TapestryModule.java  |    2 +-
 .../tapestry5/datepicker_106/css/datepicker.css    |    4 +
 .../tapestry5/datepicker_106/js/datepicker.js      |   11 +++-
 .../resources/org/apache/tapestry5/core.properties |    3 +
 .../org/apache/tapestry5/core_fr.properties        |   45 +++++++++++++++
 .../org/apache/tapestry5/core_fr_FR.properties     |   42 --------------
 7 files changed, 64 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/719ef814/tapestry-core/src/main/coffeescript/META-INF/modules/core/datefield.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/core/datefield.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/core/datefield.coffee
index 16390a2..c401b70 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/core/datefield.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/core/datefield.coffee
@@ -35,6 +35,9 @@ define ["core/dom", "core/events", "core/messages", "core/builder", "core/ajax",
 
     DatePicker.days = _.map days, (name) -> name.substr(0, 1).toLowerCase()
 
+    DatePicker.TODAY = messages "core-datefield-today"
+    DatePicker.NONE = messages "core-datefield-none"
+
     # Track the active popup; only one allowed at a time. May look to rework this
     # later so that there's just one popup and it is moved around the viewport, or
     # around the DOM.

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/719ef814/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
index 12b4597..21b3329 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
@@ -2099,7 +2099,7 @@ public final class TapestryModule
         // This should be overridden for particular applications. These are the
         // locales for which we have (at least some) localized messages.
         configuration.add(SymbolConstants.SUPPORTED_LOCALES,
-                "en,it,es,zh_CN,pt_PT,de,ru,hr,fi_FI,sv_SE,fr_FR,da,pt_BR,ja,el,bg,no_NB,sr_RS,mk_MK");
+                "en,it,es,zh_CN,pt_PT,de,ru,hr,fi_FI,sv_SE,fr,da,pt_BR,ja,el,bg,no_NB,sr_RS,mk_MK");
 
         configuration.add(SymbolConstants.TAPESTRY_VERSION,
                 VersionUtils.readVersionNumber("META-INF/gradle/org.apache.tapestry/tapestry-core/project.properties"));

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/719ef814/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/css/datepicker.css
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/css/datepicker.css b/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/css/datepicker.css
index 4d2c2c3..fb4cdaf 100644
--- a/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/css/datepicker.css
+++ b/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/css/datepicker.css
@@ -97,6 +97,10 @@
     display: block;
 }
 
+.datePicker button.btn {
+    font-size: x-small;
+}
+
 .datePicker .previousButton {
     background: buttonface url("../images/arrow.left.png") no-repeat center center;
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/719ef814/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/js/datepicker.js
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/js/datepicker.js b/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/js/datepicker.js
index 89dc129..eeec75a 100644
--- a/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/js/datepicker.js
+++ b/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/js/datepicker.js
@@ -47,7 +47,8 @@
 |            | value.  Separating them simplifies a lot of logic and resolves |
 |            | TAP5-1409. Also somewhat smarter for whether to trigger        |
 |            | onselect when clicking "today" (and/or "none")                 |
-| 2012-11-11 | Minor changes to integrate into a page with Twitter Bootstrap  |
+| 2012-11-11 | Minor changes to integrate into a page with Twitter Bootstrap, |
+|            | and to support localizing the Today/None buttons.              |
 |-----------------------------------------------------------------------------|
 | Created 2001-10-?? | All changes are in the log above. | Updated 2006-05-28 |
 \----------------------------------------------------------------------------*/
@@ -92,6 +93,10 @@ DatePicker.months = [
     "September", "October", "November", "December"];
 DatePicker.days = ["m", "t", "w", "t", "f", "s", "s"];
 
+// Allow these to be localized
+DatePicker.TODAY = "Today"
+DatePicker.NONE = "None"
+
 
 // Function invoked whenever the selected date changes, whether by
 // navigation or when the user selects a date.
@@ -188,7 +193,7 @@ DatePicker.prototype.create = function (doc)
     this._todayButton = doc.createElement("button");
     this._todayButton.className = "btn";
     this._todayButton.setAttribute("type", "button");
-    this._todayButton.appendChild(doc.createTextNode("Today"));
+    this._todayButton.appendChild(doc.createTextNode(DatePicker.TODAY));
     td.appendChild(this._todayButton);
     tr.appendChild(td);
 
@@ -201,7 +206,7 @@ DatePicker.prototype.create = function (doc)
     this._noneButton = doc.createElement("button");
     this._noneButton.className = "btn";
     this._noneButton.setAttribute("type", "button");
-    this._noneButton.appendChild(doc.createTextNode("None"));
+    this._noneButton.appendChild(doc.createTextNode(DatePicker.NONE));
     td.appendChild(this._noneButton);
     tr.appendChild(td);
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/719ef814/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties b/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties
index 558ed8f..f085e00 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties
@@ -62,3 +62,6 @@ core-components.submit.class=btn btn-primary
 
 core-input-not-numeric=Value is not numeric.
 core-input-not-integer=Value is not an integer.
+
+core-datefield-today=Today
+core-datefield-none=None
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/719ef814/tapestry-core/src/main/resources/org/apache/tapestry5/core_fr.properties
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/core_fr.properties b/tapestry-core/src/main/resources/org/apache/tapestry5/core_fr.properties
new file mode 100644
index 0000000..4724fe2
--- /dev/null
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/core_fr.properties
@@ -0,0 +1,45 @@
+# Copyright 2012 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# We try to keep the validation messages consistent, with the constraint
+# value (if applicable) as the first parameter, and the field's label as the
+# second parameter. Occasionally we must use specific indexing when that's
+# not the best order.
+
+core-ascending=[Asc]
+core-cancel-label=Annuler
+core-date-value-not-parseable=La date '%s' ne peut pas Ítre analysÈe.
+core-default-error-banner=Vous devez corriger ces erreurs avant de poursuivre.
+core-descending=[Desc]
+core-goto-page=Aller page %d
+core-palette-available-label=Disponible
+core-palette-deselect-label=< Déselectionner
+core-palette-down-label=Descendre
+core-palette-select-label=Sélectionner >
+core-palette-selected-label=Sélectionné
+core-palette-up-label=Monter
+core-sortable=[Triable]
+core-submit-label=Créer/Mettre à jour
+integer-format-exception=Vous devez saisir un nombre entier pour %s.
+invalid-email='%s' n'est pas une adresse courriel valide.
+max-integer=%2$s ne doit pas avoir une valeur supérieure à %1$d.
+maximum-string-length=Vous ne pouvez donner que %d caractères maximum pour %s.
+min-integer=%2$s doit avoir la valeur minimale de %1$d. 
+minimum-string-length=Vous devez donner au moins %d caractères pour %s.
+number-format-exception=Vous devez saisir un nombre pour %s.
+regexp=%2$s ne correspond pas a l'expression '%1$s'.
+required=Vous devez fournir une valeur pour %s.
+
+core-datefield-today=Aujourd'hui
+core-datefield-none=Aucun
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/719ef814/tapestry-core/src/main/resources/org/apache/tapestry5/core_fr_FR.properties
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/core_fr_FR.properties b/tapestry-core/src/main/resources/org/apache/tapestry5/core_fr_FR.properties
deleted file mode 100644
index de88514..0000000
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/core_fr_FR.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2012 The Apache Software Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# We try to keep the validation messages consistent, with the constraint
-# value (if applicable) as the first parameter, and the field's label as the
-# second parameter. Occasionally we must use specific indexing when that's
-# not the best order.
-
-core-ascending=[Asc]
-core-cancel-label=Annuler
-core-date-value-not-parseable=La date '%s' ne peut pas Ítre analysÈe.
-core-default-error-banner=Vous devez corriger ces erreurs avant de poursuivre.
-core-descending=[Desc]
-core-goto-page=Aller page %d
-core-palette-available-label=Disponible
-core-palette-deselect-label=< Déselectionner
-core-palette-down-label=Descendre
-core-palette-select-label=Sélectionner >
-core-palette-selected-label=Sélectionné
-core-palette-up-label=Monter
-core-sortable=[Triable]
-core-submit-label=Créer/Mettre à jour
-integer-format-exception=Vous devez saisir un nombre entier pour %s.
-invalid-email='%s' n'est pas une adresse courriel valide.
-max-integer=%2$s ne doit pas avoir une valeur supérieure à %1$d.
-maximum-string-length=Vous ne pouvez donner que %d caractères maximum pour %s.
-min-integer=%2$s doit avoir la valeur minimale de %1$d. 
-minimum-string-length=Vous devez donner au moins %d caractères pour %s.
-number-format-exception=Vous devez saisir un nombre pour %s.
-regexp=%2$s ne correspond pas a l'expression '%1$s'.
-required=Vous devez fournir une valeur pour %s.