Page 1 of 1

[Genhis][2.0.6] Failed Translation Request

Posted: Sat Oct 19, 2024 4:07 pm
by Cooldude2606
TL;DR LuaPlayer.request_translation will fail if the locale string contains empty strings.

Reproduction
1) Setup the files for minimal reproduction, see below.
2) Run the first command, it will output "foo:bar:baz" and "translated" is true.
3) Run the second command, it will output "foo::baz" but "translated" is false.
4) Run the third command, it will output "foobaz" and "translated" is true.

The Issue
It is expected that an invalid locale string will display an error when printed, such as "Unknown key" and this would also cause a translation request to fail. However in the case described above the locale string is valid and is printed without error but the translation request fails. This is inconsistent behaviour because one is successful while the other fails. Additionally, it only fails when using a locale key, it will not fail during concatenation. If for some reason this locale string is not valid, then it is not documented that this would cause a failure and no error message is printed.

Files

Re: [Genhis][2.0.6] Failed Translation Request

Posted: Sun Oct 20, 2024 9:41 am
by Genhis
Thanks for the report, this is fixed for the next release.