Skip to content
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

TTS and unrecognized language names #113

Closed
HenryWales opened this issue Apr 27, 2023 · 2 comments
Closed

TTS and unrecognized language names #113

HenryWales opened this issue Apr 27, 2023 · 2 comments
Labels
enhancement Develop an existing feature ui Any problem related to the User Interface

Comments

@HenryWales
Copy link

In the original LWT, apart from populating initial fields on creation the name of a language didn't matter.

Here, it is used to convert into language-code for text-to-speech.

This mean that an unrecognized language name displays an error message on every single text.

Warning: Undefined array key "<Language>" in C:\xampp\htdocs\lwt\do_text_header.php on line 181

Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\lwt\do_text_header.php on line 181

I propose that instead of doing the conversion every time, the language-code is added as a field when creating or editing a language. This allows the use of native language names instead of the english names without breaking TTS or displaying errors at the top of each text.

@HugoFara HugoFara added bug Something isn't working ui Any problem related to the User Interface labels Apr 30, 2023
@HugoFara
Copy link
Owner

Thanks for the bug report! Languages names are currently a limitation of this version of LWT. As I tried to get rid of this kind of issue, I built robust tool for detecting a language in 2.8, so I will try to fix everything with 2.9!

In the meantime, the simplest solution is to keep unmodified language names...

I already though of a language code system, but as explained in #86 , new features should go to jzohrab/lute, the current purpose of this project is too maintain backward compatibility more than anything...

@HugoFara HugoFara added enhancement Develop an existing feature and removed bug Something isn't working labels Apr 30, 2023
HugoFara added a commit that referenced this issue Dec 26, 2023
…anguage rename (#113).

JS Doc is added with JS DOC and PHP Doc with phpDocumentor.
New global LWT_LANGUAGES_ARRAY.
When renaming a language, text to speech was broken, it is fixed.
@HugoFara
Copy link
Owner

The issue is fixed, I changed the way things work.

Before: use language name → search in languages array

After: use languages id → get language name + translator URI → search in languages array with name. → if not found, use translator URI.

It won't work still if you change language name AND use an unknown translator URL. In this last case I will try to look for a small review of the text-to-speech feature.

At any rates, the warnings won't show whatever happens!

@HugoFara HugoFara linked a pull request Dec 27, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Develop an existing feature ui Any problem related to the User Interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants