Hello everyone. I am developing a calendar for users from Ukraine, I need the interface to be in Ukrainian. As I understand it, there is no support for this language, so I created such a js file (I took an example from custom.locale.De.js) and write phrases in Ukrainian directly.
code.PNG (39.87 KiB) Viewed 923 times
But I have a problem with the fact that months and weeks remain the same in English. How can I translate it to Ukrainian?
Снимок.PNG (51.18 KiB) Viewed 923 times
Re: Create other locale
Posted: Mon Dec 20, 2021 12:08 pm
by alex.l
Hi evgenia,
For dates you should localize DateHelper.locale property. Please check if you did?
Example for Russian language
DateHelper : {
locale : 'ru',
weekStartDay : 1,
// Non-working days which match weekends by default, but can be changed according to schedule needs
nonWorkingDays : {
0 : true,
6 : true
},
// Days considered as weekends by the selected country, but could be working days in the schedule
weekends : {
0 : true,
6 : true
},
unitNames : [
{ single : 'миллисек', plural : 'миллисек', abbrev : 'мс' },
{ single : 'секунда', plural : 'секунд', abbrev : 'с' },
{ single : 'минута', plural : 'минут', abbrev : 'мин' },
{ single : 'час', plural : 'часов', abbrev : 'ч' },
{ single : 'день', plural : 'дней', abbrev : 'д' },
{ single : 'неделя', plural : 'недели', abbrev : 'нед' },
{ single : 'месяц', plural : 'месяцев', abbrev : 'мес' },
{ single : 'квартал', plural : 'кварталов', abbrev : 'квар' },
{ single : 'год', plural : 'лет', abbrev : 'г' },
{ single : 'десятилетие', plural : 'десятилетия', abbrev : 'дес' }
],
// Used to build a RegExp for parsing time units.
// The full names from above are added into the generated Regexp.
// So you may type "2 н" or "2 нед" or "2 неделя" or "2 недели" into a DurationField.
// When generating its display value though, it uses the full localized names above.
unitAbbreviations : [
['мс', 'мил'],
['с', 'сек'],
['м', 'мин'],
['ч'],
['д', 'ден', 'дне'],
['н', 'нед'],
['мес'],
['к', 'квар', 'квр'],
['г'],
['дес']
],
parsers : {
L : 'DD.MM.YYYY',
LT : 'HH:mm'
},
ordinalSuffix : number => `${number}-й`
},
Re: Create other locale
Posted: Mon Dec 20, 2021 1:01 pm
by evgenia
Will it change month name and day of week name?
Re: Create other locale
Posted: Mon Dec 20, 2021 1:10 pm
by alex.l
Yes, it will change date formats that you asked about. Did you check and it doesn't work for you?
Re: Create other locale
Posted: Mon Dec 20, 2021 1:17 pm
by evgenia
I need to change name of the months and the name of the weeks
Снимок.PNG (57.66 KiB) Viewed 916 times
For example, at the top it should be written "Тиждень 50, Грудень 2021" instead of "Тиждень 50, December2021" and instead "sun" most be "нед"