core icon indicating copy to clipboard operation
core copied to clipboard

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

Open andiukas opened this issue 2 years ago • 16 comments

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

andiukas avatar Feb 07 '23 11:02 andiukas

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)

home-assistant[bot] avatar Feb 07 '23 11:02 home-assistant[bot]

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.

the problem is not solved

andiukas avatar May 08 '23 14:05 andiukas

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.

the problem is not solved

andiukas avatar Aug 06 '23 15:08 andiukas

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.

the problem is not solved

andiukas avatar Nov 04 '23 17:11 andiukas

the problem is not solved

still not working?

xraided avatar Dec 23 '23 10:12 xraided

Not working :(

andiukas avatar Dec 23 '23 10:12 andiukas

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

Pajuris avatar Feb 08 '24 08:02 Pajuris

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

Armikas avatar Feb 29 '24 21:02 Armikas

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.

Still not resolved. :(

Armikas avatar May 29 '24 23:05 Armikas

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.

soundvibe avatar Jul 16 '24 18:07 soundvibe

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.

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

Pajuris avatar Oct 15 '24 05:10 Pajuris

Any news on this issue?

Armikas avatar Dec 03 '24 16:12 Armikas

Google cloud arba microsoft tts :)

andiukas avatar Dec 03 '24 17:12 andiukas

Google cloud arba microsoft tts :)

Sorry for piggy-backing on this issue, however I don't see any other way to contact andriukas. You keep using some crappy automatic translator to translate HA into Lithuanian. Please read what you are translating. Music "player" gets translated into "gamer" for Lithuanian translation (as it's done without any context), and your machine translator adds a bunch of spaces, after each new line or in between quotes. There are a bunch of other mistranslations that have to be periodically fixed after you submit it to the lokalise service.

rKsanu2MMYvypWePtQWM avatar Dec 05 '24 16:12 rKsanu2MMYvypWePtQWM

Andiukas... it's not completed.

Pajuris avatar Dec 05 '24 17:12 Pajuris

Andiukas... it's not completed.

Nothing solves the problem, but there are other alternatives

andiukas avatar Dec 05 '24 17:12 andiukas

Anyway... keep it open.

Pajuris avatar Dec 05 '24 17:12 Pajuris

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.

Hi, I see that the Lithuanian language has been added on 2024 07 20 https://github.com/pndurette/gTTS/blob/main/gtts/langs.py, but the integration is still broken.

andiukas avatar Dec 06 '24 07:12 andiukas

Works :)

andiukas avatar Jan 30 '25 10:01 andiukas

No... not working. The same error: Error on load tts: 1b9efa821ee796812ea1f68ccd6f3d2d359ceb58_lt_-_google_translate not in cache!

Pajuris avatar Jan 30 '25 10:01 Pajuris

No... not working. The same error: Error on load tts: 1b9efa821ee796812ea1f68ccd6f3d2d359ceb58_lt_-_google_translate not in cache!

Working for me ;) no error ;) Maybe: https://github.com/home-assistant/core/issues/111909

andiukas avatar Jan 30 '25 10:01 andiukas

HA Version? Automation YAML?

Pajuris avatar Jan 30 '25 11:01 Pajuris

Image

Image

andiukas avatar Jan 30 '25 11:01 andiukas

Och.... February, 2025 release. I will wait few days for official release and will test it. Thanks.

Pajuris avatar Jan 30 '25 11:01 Pajuris

Yeah, this should be fixed in 2025.2 release.

soundvibe avatar Jan 30 '25 11:01 soundvibe