Skip to content

esferatec/ec-luart-localizationmanager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 

Repository files navigation

ec-luart-localizationmanager

The project is a localization management module written in Lua. It defines a LocalizationManager object that handles localization of widgets in LuaRT desktop applications.

LuaRT 2.1.0

Features

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.

Installation

  1. Create a folder called "ecluart" in your application.
  2. Copy the "lm.lua" file into this folder.
[application]
|
|----ecluart
|   |
|   |----lm.lua
|   |----...
|
|----app.wlua

Usage

The localization manager (lm) can be loaded using the function require():

local lm = require("ecluart.lm") 

Constructor

 LocalizationManager() -> object

Initializes a new localization manager instance.

Property - dictionary

LocalizationManager.dictionary (table)

Table containing the localization data.

Property - language

LocalizationManager.language (string)

String specifying the desired language.

Method - add

LocalizationManager:add(widget: object, property: string, key: string) -> none

Adds a widget, widget property and localization key.

Method - translate

LocalizationManager:translate() -> none

Loads the localization text for each widget.

Method - text

LocalizationManager:text(key: string) -> string

Gets the localization text for a key.

License

Copyright (c) 2023 by esferatec. It is open source, released under the MIT License. See full copyright notice in the LICENSE.md file.

About

virtual localization manager for LuaRT

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages