Closed Ilis closed 6 years ago
Hi, I am looking at this issue and try my best to solve it as soon as possible.
Thanks
@slgobinath, @Ilis Hi guys! I found sort of solution about days and months localization. The local must be set into /lib/xdate.js You must add few strings in the end of the file. My localization is bulgaria, so my locale is 'bg':
XDate.locales['bg'] = {
monthNames: ['Януари','Февруари','Март','Април','Май','Юни','Юли','Август','Септември','Октомври','Ноември','Декември'], // long month names, startet from january
monthNamesShort: ['Яну.','Фев.','Мрт','Апр','Май','Юни','Юли.','Авг','Сеп.','Окт.','Ное.','Дек.'], // short month names, startet from january
dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'], // long day names, started from sunday
dayNamesShort: ['Нед.','Пнд.','Втр.','Срд.','Чет.','Пет.','Сбт.'] // short day names, started from sunday
};
XDate.defaultLocale = 'bg'; // set new default locale.
So, this work for me, but i dont know how this shout be applied into desklet and pot files...
I have a solution for this. I'll create a PR.
@NikoKrause
It didn't work. Months names are still in English.
Maybe .po and .pot have to be updated?
@Ilis Yes .pot has to be updated and the new Strings have to be translated.
@NikoKrause please check my new PR https://github.com/linuxmint/cinnamon-spices-desklets/pull/259 in which I have improved your code. (pot file also updated)
This PR also fixes alignment issues.
I've updated ru_po in #263, but noticed that string for shortened month name May is missed.
The problem is in English May
is used for both short and long names. I did not think about it.
I will fix it soon.
@slgobinath is right. It's the same string for both. How to know, which string to translate how? Not sure if this will work, but there should be something similar for applets: https://stackoverflow.com/questions/10235822/same-string-with-different-translation
Hi @NikoKrause, Is there a way to test desklet locale without changing system locale?
I don't know of any way.
Hi, Since I am unable to test, could you please try the solution provided in the Stack Overflow Answer using this method: Gettext.dpgettext
I think we need to replace _("May")
in xdate.js
by Gettext.dpgettext(UUID, "short", "May")
and Gettext.dpgettext(UUID, "long", "May")
PO file should be:
msgctxt "short"
msgid "May"
msgstr ""
msgctxt "long"
msgid "May"
msgstr ""
Modified xdate.js is attached here: xdate.js.zip
May is not a problem in Russian (Май stands both for full and shortened names, as in English)
But e. g. for Ukrainian it is not true:
№ | Месяц | Сокр. | Translation |
---|---|---|---|
1 | Січень | Сiч. | Jan |
2 | Лютий | Лют. | Feb |
3 | Березень | Бер. | Mar |
4 | Квітень | Квiт. | Apr |
5 | Травень | Трав. | May |
6 | Червень | Черв. | Jun |
7 | Липень | Лип. | Jul |
8 | Серпень | Серп. | Aug |
9 | Вересень | Вер. | Sep |
10 | Жовтень | Жовт. | Oct |
11 | Листопад | Лист. | Nov |
12 | Грудень | Груд. | Dec |
I have tried:
Gettext.dpgettext(UUID, "short", "May")
and Gettext.dpgettext(UUID, "long", "May")
and it works
Please accept my apologies for the delay.
@NikoKrause thank you very much for testing the solution. This solution has been implemented in https://github.com/linuxmint/cinnamon-spices-desklets/pull/399
@slgobinath
Issue googleCalendar does not use locale
Steps to reproduce Install googleCalendar See dates in English, i. e. "WEDNESDAY, NOVEMBER 01"
Expected behaviour Dates in national format, i. e. "СРЕДА, НОЯБРЬ 01" (for ru_RU)
Other information