I am currently working on a rainmeter skin, which displays some Information about the User, LogonServer, OS-Language, Computername usw.
To get the language I am using this:
Code: Select all
[Rainmeter]
Update=1000
[Variables]
ActLangFile=#CURRENTPATH#ActLang
[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Program=Powershell.exe
Parameter=-NoProfile -ExecutionPolicy Bypass -Command "((get-culture).Displayname)"
OutputType=ANSI
UpdateDivider=-1
OutputFile=#ActLangFile#
[MeasureLangFile]
Measure=Script
ScriptFile=#CURRENTPATH#LuaTextFile.lua
FileToRead=#ActLangFile#
RegExpSubstitution=1
[MeasureLang]
Measure=String
String=MeasureLangFile
Does someone have an idea how I could do this? I was thinking about using .inc files which would contain the variables in the needed language.
Would this work or does anyone have an idea?
The .lua script which is used to read the file looks like this:
Code: Select all
function Initialize()
sFileToRead = SELF:GetOption('FileToRead')
end
function Update()
hReadingFile = io.open(sFileToRead)
if not hReadingFile then
print('LuaTextFile: unable to open file at ' .. sFileToRead)
return
end
sAllText = hReadingFile:read("*all")
sAllText = string.gsub(sAllText, "\t", " ")
io.close(hReadingFile)
return tostring(sAllText)
end