The project is a localization management module written in Lua. It defines a LocalizationManager object that handles localization of widgets in LuaRT desktop applications.
The project provides a modular and flexible way to manage localization in desktop applications. It allows easy addition of widgets and their corresponding localization keys, as well as applying translated text. Several localization managers can be used in one application.
- Create a folder called "ecluart" in your application.
- Copy the "lm.lua" file into this folder.
[application]
|
|----ecluart
| |
| |----lm.lua
| |----...
|
|----app.wlua
The localization manager (lm) can be loaded using the function require():
local lm = require("ecluart.lm") LocalizationManager() -> objectInitializes a new localization manager instance.
LocalizationManager.dictionary (table)Table containing the localization data.
LocalizationManager.language (string)String specifying the desired language.
LocalizationManager:add(widget: object, property: string, key: string) -> noneAdds a widget, widget property and localization key.
LocalizationManager:translate() -> noneLoads the localization text for each widget.
LocalizationManager:text(key: string) -> stringGets the localization text for a key.
Copyright (c) 2023 by esferatec. It is open source, released under the MIT License. See full copyright notice in the LICENSE.md file.