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

Can't select languages other than English. #150

Open
RobertoD91 opened this issue Jul 14, 2024 · 4 comments
Open

Can't select languages other than English. #150

RobertoD91 opened this issue Jul 14, 2024 · 4 comments

Comments

@RobertoD91
Copy link
Contributor

RobertoD91 commented Jul 14, 2024

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

  1. Edit file SCRIPTS/TELEMETRY/iNav.lua changing data.lang and data.voice
  2. 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

@RobertoD91
Copy link
Contributor Author

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?

@stronnag
Copy link
Collaborator

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

@RobertoD91
Copy link
Contributor Author

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.

@nm17
Copy link
Collaborator

nm17 commented Jul 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants