Sometimes I hate flex. Sometimes I love it. For example you need no time to translate DateField component to Russian. What I need is Russian date format, week starts at Monday and labels translated to Russian. Here you are:
<mx:DateField formatString="DD.MM.YYYY" dayNames="['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб']" firstDayOfWeek="1" monthNames="['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь','Декабрь']"/>
As far as translation is needed in every place in project it's better to make subclass:
package fbrg { import mx.controls.DateField; public class DateFieldRus extends DateField { public function DateFieldRus() { super(); this.formatString = "DD.MM.YYYY"; this.dayNames = ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб']; this.firstDayOfWeek=1; this.monthNames=['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь','Декабрь']; } } }
Comments
Post new comment