anufrievroman / calcure

Modern TUI calendar and task manager with minimal and customizable UI.
https://anufrievroman.gitbook.io/calcure
MIT License
1.51k stars 43 forks source link

Language of holiday events #62

Closed xmha97 closed 10 months ago

xmha97 commented 11 months ago

I set holiday_country = Iran on Ubuntu and Windows. On Ubuntu, I see holiday events in English. image But on Windows, I see holiday events in Persian. image Why?

anufrievroman commented 11 months ago

This is controlled by holidays library and I think is related to the version used and how it extracts locale from the system. I noticed the change of the language as well. I think it's better to ask this at that library. Here, I have no control over it.

anufrievroman commented 11 months ago

Specifically, Iran is supported in two languages, so holidays python lib chooses the language depending on your system, not sure how. Check their documentation via that link to possibly fix that. I think you'll need to add fa locale to display it in Persian, but I can't be sure.

jose1711 commented 10 months ago

Interesting, on my Arch system I see the holidays names are shown in Persian. I also get them in Python:

$ python -c 'from holidays import countries; print(list(countries.Iran(2023).values())[:3])'
['نوروز', 'نوروز', 'نوروز']

python-holidays = 0.34.

Update: Things are different if I set LANG to en_US so you may want to check that too:

$ LANG=en_US python -c 'from holidays import countries; print(list(countries.Iran(2023).values())[:3])'
['Persian New Year', 'Persian New Year', 'Persian New Year']
anufrievroman commented 10 months ago

I think there's a default language for each country in holidays library and some additionally supported languages. So, if your LANG is anything but en_US then by default it's in Arabic, but if it's specifically en_US then holidays displays events in the additionally supported English language.

Again, this is not something I can override, so I'll close this issue.