Giter Site home page Giter Site logo

Comments (16)

slgobinath avatar slgobinath commented on July 20, 2024 1

Hi,
I am looking at this issue and try my best to solve it as soon as possible.

Thanks

from cinnamon-spices-desklets.

spacy01 avatar spacy01 commented on July 20, 2024 1

@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...

from cinnamon-spices-desklets.

NikoKrause avatar NikoKrause commented on July 20, 2024

I have a solution for this. I'll create a PR.

from cinnamon-spices-desklets.

Ilis avatar Ilis commented on July 20, 2024

@NikoKrause

It didn't work. Months names are still in English.

Maybe .po and .pot have to be updated?

from cinnamon-spices-desklets.

NikoKrause avatar NikoKrause commented on July 20, 2024

@Ilis
Yes .pot has to be updated and the new Strings have to be translated.

from cinnamon-spices-desklets.

slgobinath avatar slgobinath commented on July 20, 2024

@NikoKrause please check my new PR #259 in which I have improved your code. (pot file also updated)

This PR also fixes alignment issues.

from cinnamon-spices-desklets.

Ilis avatar Ilis commented on July 20, 2024

I've updated ru_po in #263, but noticed that string for shortened month name May is missed.

from cinnamon-spices-desklets.

slgobinath avatar slgobinath commented on July 20, 2024

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.

from cinnamon-spices-desklets.

NikoKrause avatar NikoKrause commented on July 20, 2024

@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

from cinnamon-spices-desklets.

NikoKrause avatar NikoKrause commented on July 20, 2024

https://github.com/search?q=org%3Alinuxmint+pgettext&type=Code

from cinnamon-spices-desklets.

slgobinath avatar slgobinath commented on July 20, 2024

Hi @NikoKrause,
Is there a way to test desklet locale without changing system locale?

from cinnamon-spices-desklets.

NikoKrause avatar NikoKrause commented on July 20, 2024

I don't know of any way.

from cinnamon-spices-desklets.

slgobinath avatar slgobinath commented on July 20, 2024

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

from cinnamon-spices-desklets.

Ilis avatar Ilis commented on July 20, 2024

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

from cinnamon-spices-desklets.

NikoKrause avatar NikoKrause commented on July 20, 2024

I have tried:
Gettext.dpgettext(UUID, "short", "May") and Gettext.dpgettext(UUID, "long", "May") and it works

from cinnamon-spices-desklets.

slgobinath avatar slgobinath commented on July 20, 2024

Please accept my apologies for the delay.

@NikoKrause thank you very much for testing the solution. This solution has been implemented in #399

from cinnamon-spices-desklets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.