Bug 1320227 - [DateTimeInput] Localize placeholders for <input type=date>. r=mossop
MozReview-Commit-ID: Bn0xjuuVhgU
--- a/toolkit/content/widgets/datetimebox.xml
+++ b/toolkit/content/widgets/datetimebox.xml
@@ -21,22 +21,22 @@
<stylesheet src="chrome://global/content/textbox.css"/>
<stylesheet src="chrome://global/skin/textbox.css"/>
<stylesheet src="chrome://global/content/bindings/datetimebox.css"/>
</resources>
<implementation>
<constructor>
<![CDATA[
- // TODO: Bug 1320227 - [DateTimeInput] localization for
- // <input type=date> input box
- this.mMonthPlaceHolder = "mm";
- this.mDayPlaceHolder = "dd";
- this.mYearPlaceHolder = "yyyy";
- this.mSeparatorText = "/";
+ /* eslint-disable no-multi-spaces */
+ this.mYearPlaceHolder = ]]>"&date.year.placeholder;"<![CDATA[;
+ this.mMonthPlaceHolder = ]]>"&date.month.placeholder;"<![CDATA[;
+ this.mDayPlaceHolder = ]]>"&date.day.placeholder;"<![CDATA[;
+ /* eslint-enable no-multi-spaces */
+
this.mMinMonth = 1;
this.mMaxMonth = 12;
this.mMinDay = 1;
this.mMaxDay = 31;
this.mMinYear = 1;
// Maximum year limited by ECMAScript date object range, year <= 275760.
this.mMaxYear = 275760;
this.mMonthDayLength = 2;
@@ -455,17 +455,16 @@
this.mHourPlaceHolder = ]]>"&time.hour.placeholder;"<![CDATA[;
this.mMinutePlaceHolder = ]]>"&time.minute.placeholder;"<![CDATA[;
this.mSecondPlaceHolder = ]]>"&time.second.placeholder;"<![CDATA[;
this.mMillisecPlaceHolder = ]]>"&time.millisecond.placeholder;"<![CDATA[;
this.mDayPeriodPlaceHolder = ]]>"&time.dayperiod.placeholder;"<![CDATA[;
/* eslint-enable no-multi-spaces */
this.mHour12 = this.is12HourTime(this.mLocales);
- this.mSeparatorText = ":";
this.mMillisecSeparatorText = ".";
this.mMaxLength = 2;
this.mMillisecMaxLength = 3;
this.mDefaultStep = 60 * 1000; // in milliseconds
this.mMinHour = this.mHour12 ? 1 : 0;
this.mMaxHour = this.mHour12 ? 12 : 23;
this.mMinMinute = 0;
--- a/toolkit/locales/en-US/chrome/global/datetimebox.dtd
+++ b/toolkit/locales/en-US/chrome/global/datetimebox.dtd
@@ -4,8 +4,14 @@
<!-- Placeholders for input type=time -->
<!ENTITY time.hour.placeholder "--">
<!ENTITY time.minute.placeholder "--">
<!ENTITY time.second.placeholder "--">
<!ENTITY time.millisecond.placeholder "--">
<!ENTITY time.dayperiod.placeholder "--">
+
+<!-- Placeholders for input type=date -->
+
+<!ENTITY date.year.placeholder "yyyy">
+<!ENTITY date.month.placeholder "mm">
+<!ENTITY date.day.placeholder "dd">