home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.97k stars 31.02k forks source link

text-to-Speech (TTS) lithuanian language (lt) error #87628

Open andiukas opened 1 year ago

andiukas commented 1 year ago

The problem

Lithuanian language β€œTalk” feature is enabled in Google Translate (https://translate.google.com/intl/en_ALL/about/languages/), but when i try to use language "lt" in tts platform, getting error "Error running action. Not supported language lt"

What version of Home Assistant Core has the issue?

2023.02

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Text-to-Speech (TTS)

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tts

Diagnostics information

No response

Example YAML snippet

service: tts.google_translate_say
data:
  entity_id: media_player.google_home
  message: Labas
  language: lt

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @pvizeli, mind taking a look at this issue as it has been labeled with an integration (tts) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tts` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tts` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


tts documentation tts source (message by IssueLinks)

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

andiukas commented 1 year ago

the problem is not solved

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

andiukas commented 1 year ago

the problem is not solved

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

andiukas commented 1 year ago

the problem is not solved

xraided commented 11 months ago

the problem is not solved

still not working?

andiukas commented 11 months ago

Not working :(

Pajuris commented 9 months ago

Hi. Sadly, Lithuanian still not working... Latvian working, but Lithuanian no. :( One year.

Armikas commented 9 months ago

Hi there! I`m also headbanging at this... Subscribing.

issue-triage-workflows[bot] commented 6 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Armikas commented 6 months ago

Still not resolved. :(

soundvibe commented 4 months ago
2024-07-16 21:42:10.267 DEBUG (SyncWorker_37) [gtts.tts] text: Laba Diena
2024-07-16 21:42:10.267 DEBUG (SyncWorker_37) [gtts.tts] tld: lt
2024-07-16 21:42:10.267 DEBUG (SyncWorker_37) [gtts.tts] lang: lt
2024-07-16 21:42:10.267 DEBUG (SyncWorker_37) [gtts.tts] slow: False
2024-07-16 21:42:10.268 DEBUG (SyncWorker_37) [gtts.tts] lang_check: True
2024-07-16 21:42:10.268 DEBUG (SyncWorker_37) [gtts.tts] pre_processor_funcs: [<function tone_marks at 0x7f7420c860>, <function end_of_line at 0x7f7420efc0>, <function abbreviations at 0x7f72f0d760>, <function word_sub at 0x7f72f0d8a0>]
2024-07-16 21:42:10.268 DEBUG (SyncWorker_37) [gtts.tts] tokenizer_func: <bound method Tokenizer.run of re.compile('(?<=\\?).|(?<=!).|(?<=?).|(?<=!).|(?<!\\.[a-z])\\. |(?<!\\.[a-z]), |(?<!\\d):|\\[|Β‘|\\)|β€₯|β€”|\\(|,|;|\\\n|\\]|…|ΒΏ|:|،|、|。', re.IGNORECASE) from: [<function tone_marks at 0x7f72f0d4e0>, <function period_comma at 0x7f72f0c720>, <function colon at 0x7f72f0c400>, <function other_punctuation at 0x7f72f0d9e0>]>
2024-07-16 21:42:10.268 DEBUG (SyncWorker_37) [gtts.lang] langs: {'af': 'Afrikaans', 'ar': 'Arabic', 'bg': 'Bulgarian', 'bn': 'Bengali', 'bs': 'Bosnian', 'ca': 'Catalan', 'cs': 'Czech', 'cy': 'Welsh', 'da': 'Danish', 'de': 'German', 'el': 'Greek', 'en': 'English', 'eo': 'Esperanto', 'es': 'Spanish', 'et': 'Estonian', 'fi': 'Finnish', 'fr': 'French', 'gu': 'Gujarati', 'hi': 'Hindi', 'hr': 'Croatian', 'hu': 'Hungarian', 'hy': 'Armenian', 'id': 'Indonesian', 'is': 'Icelandic', 'it': 'Italian', 'iw': 'Hebrew', 'ja': 'Japanese', 'jw': 'Javanese', 'km': 'Khmer', 'kn': 'Kannada', 'ko': 'Korean', 'la': 'Latin', 'lv': 'Latvian', 'mk': 'Macedonian', 'ms': 'Malay', 'ml': 'Malayalam', 'mr': 'Marathi', 'my': 'Myanmar (Burmese)', 'ne': 'Nepali', 'nl': 'Dutch', 'no': 'Norwegian', 'pl': 'Polish', 'pt': 'Portuguese', 'ro': 'Romanian', 'ru': 'Russian', 'si': 'Sinhala', 'sk': 'Slovak', 'sq': 'Albanian', 'sr': 'Serbian', 'su': 'Sundanese', 'sv': 'Swedish', 'sw': 'Swahili', 'ta': 'Tamil', 'te': 'Telugu', 'th': 'Thai', 'tl': 'Filipino', 'tr': 'Turkish', 'uk': 'Ukrainian', 'ur': 'Urdu', 'vi': 'Vietnamese', 'zh-CN': 'Chinese', 'zh-TW': 'Chinese (Mandarin/Taiwan)', 'zh': 'Chinese (Mandarin)'}

This is the logs when debug logging is enabled. Looks like lt is missing from langs dictionary. After more investigations, I've found that Home Assistant uses gTTS python library, which sadly has no support for LT language yet. So this langs dictionary is the internal gTTS library dictionary and not the one from Home Assistant.

I think this issue could be solved very easily and very quickly: Home Assistant could just set lang_check=False here, during gTTS instance creation (lang_check arg is True by default, if not set). This would not check gTTS internal supported language set and would try to execute the tts request. I would say that this is the preferable approach, especially knowing that in the worst case scenario the request would just fail, and in the best case- more languages would be supported out of the box.

@pvizeli Could someone look into this? The fix should be very trivial IMO.

issue-triage-workflows[bot] commented 1 month ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Pajuris commented 1 month ago

Still not working... Please, fix it... it's very useful and necessary functionality.