vasqued2 / ha-teamtracker

Home Assistant integration that provides real-time scores in multiple professional (NBA, NFL, NHL, MLB, MLS, and more), college (NCAA), and international (soccer, golf, tennis, mma, racing) sports using ESPN APIs.
166 stars 20 forks source link

Unsupported locale #27

Closed joaco5121 closed 1 year ago

joaco5121 commented 1 year ago

I've got an error after setting up teamtracker. There's anything I can do to fix it? Sorry if my English isn't good. As you can see in the error, Spanish is my first language ("es-419")

Logger: custom_components.teamtracker Source: helpers/update_coordinator.py:182 Integration: Team Tracker (documentation, issues) First occurred: 20:32:21 (1 occurrences) Last logged: 20:32:21

Error fetching team_tracker data: Unsupported locale 'es-419'.

vasqued2 commented 1 year ago

Looks like it's a problem w/ 'Espanol (Latin America)'. In the short term, if you change your language in the front end to just "Espanol" you should be good. Let me know if it doesn't work.

I will have to make a fix to make it work for 'Espanol (Latin America)'.

joaco5121 commented 1 year ago

Okay, I changed it to Español and it works, I will leave it set in that option until is fixed, thank you for the quick answer

vasqued2 commented 1 year ago

Great! I have a fix I can push in the next day or two.

Can you review this translation file and let me know if there are any changes I should make for Latin America.

Also, if you can provide any additional Spanish translations from this English file that aren't in the Spanish file, I'd appreciate it and will include them in the next release also.

Thanks!

joaco5121 commented 1 year ago

I don't see anything you should change from Spanish to the Latin American Spanish file. I will check the English file tomorrow and let you know of any Spanish translations you may add.

vasqued2 commented 1 year ago

Thanks

vasqued2 commented 1 year ago

I created an initial translation file for Latin America.

Let me know if I should change anything in this file.

Once I make any changes you recommend, I will stage a pre-release version and you can test them if you want before I include them in an official release.

joaco5121 commented 1 year ago

Hi, I changed a few words and phrases in the es-419 file. I think that what you added to the es-419 file that wasn't in the es file before could be added to the es file as well. I dont see anything more to change, theres words in english that doesnt need to be translated cause theres no translation for some words in some sports. Like strickes, it could be "Faltas" in soccer but i think that in other sports is leaved as "Strickes". Im not much into sports, im setting up this for other members of my house and only for soccer so probably theres words that could be changed or are said in other ways that im not aware off. I hope you understand what i'm writing, i learned english by myself but i've never talked to someone in english before

export const es_419 = { "common": { "api_error": "Error de API", "no_upcoming_games": "No hay próximos juegos hasta el %s", "finalTerm": "%s - Final", "byeTerm": "DESCANSO", "tourney2": "Final", "tourney4": "Semifinales", "tourney8": "Cuartos de Final", "tourney16": "Octavos de final", "tourney32": "Ronda de 32", "tourney64": "Ronda de 64", "tourney128": "Primeras Rondas", "tourney256": "Primeras Rondas" }, "australian-football": { "startTerm": "Comienzo", "overUnder": "Más/Menos: %s", "gameStat1": "%s", "gameStat2": "%s", "gameStat3": "", "gameBar": "Probabilidad de Ganar", "teamBarLabel": "%s%", "oppoBarLabel": "%s%" }, "baseball": { "startTerm": "Comienzo", "overUnder": "Más/Menos: %s", "gameStat1": "Bolas %s", "gameStat2": "Strikes %s", "gameStat3": "%s Outs", "gameBar": "Probabilidad de Ganar", "teamBarLabel": "%s%", "oppoBarLabel": "%s%" }, "basketball": { "startTerm": "Comienzo", "overUnder": "Más/Menos: %s", "gameStat1": "%s", "gameStat2": "%s", "gameStat3": "", "gameBar": "Probabilidad de Ganar", "teamBarLabel": "%s%", "oppoBarLabel": "%s%" }, "football": { "startTerm": "Comienzo", "overUnder": "Más/Menos: %s", "gameStat1": "%s", "gameStat2": "%s", "gameStat3": "", "gameBar": "Probabilidad de Ganar", "teamBarLabel": "%s%", "oppoBarLabel": "%s%" }, "golf": { "startTerm": "Comienzo", "overUnder": "Más/Menos: %s", "gameStat1": "%s", "gameStat2": "%s", "gameStat3": "", "gameBar": "Tiros (Través De)", "teamBarLabel": "%s", "oppoBarLabel": "%s" }, "hockey": { "startTerm": "Comienzo", "overUnder": "Más/Menos: %s", "gameStat1": "%s", "gameStat2": "%s", "gameStat3": "", "gameBar": "Tiros a Puerta", "teamBarLabel": "%s", "oppoBarLabel": "%s" }, "mma": { "startTerm": "Comienzo", "overUnder": "Más/Menos: %s", "gameStat1": "%s", "gameStat2": "%s", "gameStat3": "", "gameBar": "Probabilidad de Ganar", "teamBarLabel": "%s%", "oppoBarLabel": "%s%" }, "racing": { "startTerm": "Comienzo", "overUnder": "Más/Menos: %s", "gameStat1": "%s", "gameStat2": "%s", "gameStat3": "", "gameBar": "Vueltas", "teamBarLabel": "%s", "oppoBarLabel": "%s" }, "soccer": { "startTerm": "Comienzo", "overUnder": "Más/Menos: %s", "gameStat1": "%s", "gameStat2": "%s", "gameStat3": "", "gameBar": "Tiros (A Puerta)", "teamBarLabel": "%s", "oppoBarLabel": "%s" }, "tennis": { "startTerm": "Comienzo", "overUnder": "Más/Menos: %s", "gameStat1": "%s", "gameStat2": "%s", "gameStat3": "", "gameBar": "%s", "teamBarLabel": "%s", "oppoBarLabel": "%s" }, "volleyball": { "startTerm": "Comienzo", "overUnder": "Más/Menos: %s", "gameStat1": "%s", "gameStat2": "%s", "gameStat3": "", "gameBar": " Puntaje de %s", "teamBarLabel": "%s", "oppoBarLabel": "%s" }, "default": { "startTerm": "Comienzo", "overUnder": "Más/Menos: %s", "gameStat1": "%s", "gameStat2": "%s", "gameStat3": "", "gameBar": "Probabilidad de Ganar", "teamBarLabel": "%s%", "oppoBarLabel": "%s%" } }

vasqued2 commented 1 year ago

Thanks for the updates. I understand. Your English is very good, especially for learning by yourself. It is much better than my Spanish!

I have uploaded pre-release versions of the ha-teamtracker and ha-teamtracker_card. You can download them using HACS to make sure they fixed your problem. You could also install manually if you prefer. You can go back to the current release at any time by redownloading it.

Update teamtracker to the new pre-release version

  1. Go into HACS and select the Team Tracker from the Integraciones tab.
  2. Select 'Volver a Descargar' from the menu in the top right to redownload the integration.
  3. Select version master from the drop down and download that version. This will download the new version w/ the fix.

Update teamtracker-card to the new pre-release version

  1. Go into HACS and select the Team Tracker Card from the Interfaz tab.
  2. Select 'Volver a Descargar' from the menu in the top right to redownload the card.
  3. Select version main from the drop down and download that version. This will download the new version w/ the fix.

Refresh and Reboot

  1. If you are prompted to update versions, don't do it. You want to be on these versions. If you update, you will go back to the official version.
  2. Refresh to load the new version of the card.
  3. Restart to load the new version of the integration.

At this point, you should be able to change your language back to 'Espanol (Latin America)' and it should work. If you have problems, try clearing your browser cache and refreshing.

You can also make sure you have the right version of each in HACS.

If you try it, let me know if it works or if you have problems.

Unless one of us finds problems, I'll release this as v0.5.3 in a couples days.

Thanks for all of your help!

joaco5121 commented 1 year ago

I just downloaded and tried the pre-release versions and the only problem I found even after deleting the cache is that instead of "Comienzo en 3 días" it says "Kickoff en 3 días " I have it setup for the World Cup and the URU team, I don't know if it is some translation error for this specifically league or sport. Or maybe it is my home assistant instance that's not updating correctly

Screenshot_20221120-223250_Home_Assistant~2.png

vasqued2 commented 1 year ago

The good news is the integration is working since your aren't getting the error any more.

It looks like you are still picking up an old version of the card. Can you verify in HACS that the card version is ca7e295. Even if it is, can you try redownloading the 'main' version again and make sure to hit Refresh when given the option.

If it still isn't working, do you know how to go out and verify the es_419.js file has been downloaded? It should be in the config/www/community/ha-teamtracker-card/localize/languages directory. You could use Studio Code Server or Terminal if you know how.

If not, we will figure out another way.

Also, are you using the HA app or a browser?

joaco5121 commented 1 year ago

I redownloaded the main version three times and now the translation it's finally fixed. Thank you for taking the time to help me

vasqued2 commented 1 year ago

I just released v0.5.3 w/ the fix. You should be able to upgrade to it and get back on the regular release schedule. Thanks for all of your help.