Can't select languages other than English.
Describe the bug
The script always runs in English, regardless of the selected language. Even with a custom EdgeTX build in another language or by setting
data.lang = "es"
data.voice = "es"
in SCRIPTS/TELEMETRY/iNav.lua it still defaults to English.
Tested on Jumper T16 with EdgeTX 2.10.2 and Edge Companion Simulator.
To reproduce
- Edit file
SCRIPTS/TELEMETRY/iNav.luachangingdata.langanddata.voice - widget always loads in english
Expected behavior
The script should use the selected language.
Screenshots
n.a.
Radio and model settings
I believe these are not relevant; I also tested with an empty SD card.
Additional context
if i change from
lang = loadScript(FILE_PATH .. "lang" .. ext, env)(modes, labels, data, FILE_PATH, env)
to (for example)
lang = loadScript(FILE_PATH .. "lang_es" .. ext, env)(modes, labels, data, FILE_PATH, env)
it works
Ok, the "problem" was in src/SCRIPTS/TELEMETRY/iNav/lang.lua on line 5
local tmp = FILE_PATH .. "lang_" .. data.lang .. ".luac"
It search for compiled .luac instead of .lua (Since I was working on italian translation on the simulator and the .luac don't exist)
Also, the .wav files I was using were in the wrong format.
Maybe we can update the documentation for the translator?
You should be able to just remove the .. ".luac" and the interpreter will do the right thing.
Documentation PRs are gratefully received; all it needs to say is "WAV format as defined by OpenTX / EdgeTX". It may also be that OpenTX and EdgeTX have different WAV formats, in which case the user may have to reformat the files as needed.
e.g. see EdgeTX documentation
e.g. see EdgeTX documentation
Greatly appreciated. There are CSV files and a script for auto-generating voices. I will do another pull request with new voices.
You should be able to just remove the
.. ".luac"and the interpreter will do the right thing.
Maybe we should fix that to use ".lua"? Since it is always available.