This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Cleanest way to get current language on older firmwares?
#1
Hello,

disclaimer : I know that with the recently released firmware it's now possible to pass HTTP requests to the LM itself (package "webrequests"), which would probably solve the issue. But my question is about LMs with older firmwares.

My goal is to get, in a Lua script, the current language setting of the LM.

I know that the language is stored in a variable "Config" inside the HTML code of the page scada-main. But to send a HTTP GET request of the page scada-main from a Lua script, it would be necessary to pass admin password in the Lua script, which is not very secure.

Would there be a cleaner way (e.g. io.readfile('path/to/some/file') to get current language setting?
Reply
#2
Use this:
Code:
lang = require('uci').get('genohm-scada.core.language')
log(lang)

lang will be nil when English is selected.
Reply


Forum Jump: