-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent localization in country_holidays due to LANG dependency #2168
Comments
Hi @pmarkoo As far as I remember It was our decision back in 2022 to have English as a fallback. Even though there is no technical difficulty to change the behavior I doubt we'll do it for
Could you add a link to the documentation you mentioned in your post? Thank you! |
Hello @arkid15r, thank you for considering this! When I mentioned the documentation, I was specifically referring to the docstring of the English as a fallback is not really a problem. My main concern is that reliance on the |
No, this is a valid point. I believe we need to update the docs while keeping English translation as a fallback. |
In version 0.60 the language does not work as expected in Jupyter . For example, running the following code in Jupyter I got: `min_year = 2021 country_code = country holidays_data = [ holiday_names = {holiday_name: holiday_name for _, holiday_name in holidays_data} print(holiday_names)` returns:
however if I run the same code in a script from the terminal I got
changing the language to spanish in the same script I got: {'Año Nuevo': 'Año Nuevo', 'Jueves Santo': 'Jueves Santo', 'Viernes Santo': 'Viernes Santo', 'Domingo de Resurrección': 'Domingo de Resurrección', 'Día del Trabajo': 'Día del Trabajo', 'San Pedro y San Pablo': 'San Pedro y San Pablo', 'Día de la Independencia': 'Día de la Independencia', 'Día de la Gran Parada Militar': 'Día de la Gran Parada Militar', 'Santa Rosa de Lima': 'Santa Rosa de Lima', 'Combate de Angamos': 'Combate de Angamos', 'Todos Los Santos': 'Todos Los Santos', 'Inmaculada Concepción': 'Inmaculada Concepción', 'Navidad del Señor': 'Navidad del Señor', 'Batalla de Junín': 'Batalla de Junín', 'Batalla de Ayacucho': 'Batalla de Ayacucho'} So looks like the problem arises just in Jupyter. running locale in the terminal I got
running locale in Jupyter I got:
|
Correct |
Now it works as expected. But documentation said:
|
Bug Report
Expected Behavior
When using the
country_holidays
function without specifying the language parameter (i.e., setting it to None or omitting it), the holiday names should consistently be returned in the country's original language as per the documentation.For example, executing the following code:
Should consistently output:
Erster Weihnachtstag
Actual Behavior
The country_holidays function exhibits inconsistent behavior based on the environment's
LANG
environment variable when the language parameter is not set:Local Environment:
Output:
Erster Weihnachtstag
Remote Server Environment:
Output:
Christmas Day
Steps to Reproduce the Problem
Easy to reproduce:
Output
Erster Weihnachtstag
Christmas Day
Environment
0.62
Additional Context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: