Set agent language by the remote helper or by another option
Hi,
is there a way to set the agent language when the remote helper initiates a connection to remote computer and the user has to agree to a consent message?
The agent is installed as a windows service (Windows 11) and after reviewing the source code i know, that the agent automatically detects the OS language. We have several Windows machines that are manually localized to a language other than en-US. However, since the system's default UI language is still en-US the consent message is translated to English even when the user uses another system language.
It would be nice to somehow set the target language before displaying the consent message. Or is there any other option?
Thank you.
Do u use a custom consent message? Or the normal default one? I would have to look at the source code for meshcentral to work it out Because the consent message is passed from the meshcore.js on the server side
We don't use a custom consent message. Agent is already translated to the Czech language in source code. When i run agent from cli with the parameter -lang=cs, agent is translated to the Czech language.
So if u use an argument and it's always Czech, isn't the consent on Czech too?
I would have to look into the source code Wednesday when I have free time.
Also the translations for the meshagent are in the meshcentral repo https://github.com/Ylianst/MeshCentral/blob/master/agents%2Fagent-translations.json
It might be that's the translations for that string are missing OR something else is wrong
I can't set this argument for a running service, only for install/uninstall/update agent. Without the lang parameter the setup gui is translated to English. Tried to install agent service with this parameter but no luck. I think the issue is with multilingual windows and agent language detection. I will investigate further. Thank you for your time.
@rsmehlik I did have a little look at source code last night on my mobile
The meshcore.js reads all the translations and is indeed meant to convert the consent text
but from looking, I have a feeling there are no translations for this text. It's completely missing?
You can check the agent-translations.json in the agents folder of meshcentral
That's why it's not working
ok ive had a look on my lappy instead this morning, the file is actually called coretranslations.json
and you can verify translations for the meshagent by running translations on the console tab of a device in the web ui
so my mistake (still learning)
the meshagent gets its language by running require('util-language').current
this in turn gets the language of the OSLanguage from the WMI SELECT OSLanguage FROM Win32_OperatingSystem
i verified all this by checking meshcore.js and util-language.js
please can you share screenshots of the language settings etc you have on the OS from the settings panel? i need all info, like keyboard layout, region, windows display language, etc so i can try replicate your setup to see whats going on
i can also see the is an option -lang which should force the language too, which works when you run the agent manually
but unfortunately this must be attached when you run the exe, so it wont apply when its run as a background service unless you change the service agruments manually in the registry etc https://superuser.com/a/1507466/1264697
what we need to do is add an extra value into the .msh file to load the language you want
this would require a new agent release/testing etc so will take some time
Thank you. My investigation through the source code and the system is same as your is. Adding extra value to the .msh file is a great option. Another one could be set the language by the client environment variable (LANG for example). This is already implemented in util-language.js for Linux systems. Thank you.