wesm87 / ember-datepicker

Date picker using Pikaday and Moment.js
MIT License
50 stars 47 forks source link

Set the i18n translations #17

Closed Jcarlosjunior closed 9 years ago

Jcarlosjunior commented 9 years ago

I can't find a way to set my i18n pikaday translations with the ember-datepicker.

My i18n translation is in the Ember.I18n.translations, where the ember-validations is getting the translatiosn. So i think if this component get the translations from this object or allow to pass it as a parameter via handlebars.

Jcarlosjunior commented 9 years ago

My mistake, there is a i18n binding property.

henrymazza commented 9 years ago

Sorry, could you explain how do I set it?

Jcarlosjunior commented 9 years ago

Sure !

You'll need to add the following properties to your i18n object:

i18n: {
    previousMonth : 'Previous Month',
    nextMonth     : 'Next Month',
    months        :   ['January','February','March','April','May','June','July','August','September','October','November','December'],
    weekdays      : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
    weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
}

The ember-datepicker just pass the i18n object to pickaday.

You can see the same snippet of code in Pickaday's repository page. see : https://github.com/dbushell/Pikaday