Dielee / volvo2mqtt

Home Assistant addon for connecting AAOS Volvos
MIT License
125 stars 25 forks source link

babel.core.UnknownLocaleError: unknown locale ‘sl_SL’ #179

Closed zupancicmarko closed 3 months ago

zupancicmarko commented 3 months ago

Describe the bug

Throws an error when using Slovenian language.

To Reproduce:
Steps to reproduce the behavior:

  1. Use sl_SL in Babel locale
  2. Restart
  3. See Error

Expected behavior:
Work.

Version info:
volvo2mqtt: Current version: 1.8.27 homeassistant: Core 2024.2.5

Logs:
Enable the debug option and upload your logfile here.

Traceback (most recent call last):
  File "/volvoAAOS2mqtt/main.py", line 16, in <module>
    update_loop()
  File "/volvoAAOS2mqtt/mqtt.py", line 227, in update_loop
    update_car_data()
  File "/volvoAAOS2mqtt/mqtt.py", line 237, in update_car_data
    last_data_update = format_datetime(datetime.now(util.TZ), format="medium", locale=settings["babelLocale"])
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/babel/dates.py", line 719, in format_datetime
    locale = Locale.parse(locale)
             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/babel/core.py", line 391, in parse
    raise UnknownLocaleError(input_id)
babel.core.UnknownLocaleError: unknown locale 'sl_SL'
Dielee commented 3 months ago

Please try:

sl_SI

zupancicmarko commented 3 months ago

Please try:

sl_SI

Awesome! This works! Thanks a million! 🥳🥳🥳

Dielee commented 3 months ago

Yeah, nice. Thanks for the coffee ☕.