vacanza/holidays

language parameter for Spanish holidays not functioning as expected

Closed this issue · 2 comments

My goal is to find the English text equivalent of holidays in Spain. So I ran the following script:

sorted(holidays.ES(years=2023, language='en').items())

But it returned only holidays in Spanish:

[(datetime.date(2023, 1, 6), 'Epifanía del Señor'),
 (datetime.date(2023, 4, 6), 'Jueves Santo'),
 (datetime.date(2023, 4, 7), 'Viernes Santo'),
 (datetime.date(2023, 5, 1), 'Día del Trabajador'),
 (datetime.date(2023, 8, 15), 'Asunción de la Virgen'),
 (datetime.date(2023, 10, 12), 'Día de la Hispanidad'),
 (datetime.date(2023, 11, 1), 'Todos los Santos'),
 (datetime.date(2023, 12, 6), 'Día de la Constitución Española'),
 (datetime.date(2023, 12, 8), 'La Inmaculada Concepción'),
 (datetime.date(2023, 12, 25), 'Navidad')]

I also tried:

sorted(holidays.ES(years=2023, language='en_US').items())

and

sorted(holidays.utils.country_holidays(country, years=2023, language='en_US').items())

But it still outputs the Spanish holiday names.

I tested this on Japan and other countries, and they work find and return the English values. I also checked the repository and noticed that the LC values for en_US are present, so was not sure exactly where the issue is coming from.

I can confirm both methods worked fine for me.

A couple of questions to tackle this:

  • what's your PH version?
  • what's your system locale?

Thank you @arkid15r . Sorry for the confusion, but I found out the bug was on my end. Running Python 3.7.7 and my company was limiting the holidays instance to 0.27.1 instead of the latest version at 0.43.

Resolved it by switching to a Python 3.9 instance and also enforcing install of the latest holidays module