Localization in Gideros
Gideros Localize module provides seamless localization support for Gideros, by loading string constants from specific files based on user locale.
This module provides global object Localize, which overrides native or non native objects, to check for localization before using strings, thus seamlessly (thanks to bowerandy) integrating localization support.
Contents
Download
Example codes
--simple Gideros app, nothing's changed
local font = TTFont.new('tahoma.ttf', 15)
--We can use simple text
local text = TextField.new(font, 'This is a simple string')
text:setPosition(0,50)
stage:addChild(text)
--Or we can format string printf style
local text = TextField.new(font, string.format('Hello, %s', 'Arturs'))
text:setPosition(0,20)
stage:addChild(text)
Example video
Video of module example app:
Method list
Override optional object
| Method name | new(object, method, index) |
| Description | It is possible to add optional objects for seamless localization |
| Input parameters | object object - object, that we will be workign with, for example, TextField, Bitmap, Sound, etc string method - name of the method as string, that we want to override. integer index - Index of the argument passed to method, that we need to check for localization |
| Example input | Localize.load(Sound, "new", 1) |
Changing directory
| Property name | path |
| Description | It is possible to change path where to look for localization files simply by changing path property (default: 'locales') |
| Example | Localize.path = 'locales' |
Changing file type
| Property name | filetype |
| Description | It is possible to change how language constants are stored. |
| Input parameters | string string_constant - string with format (default: 'lua'). Possible values:
|
| Example | Localize.filetype = 'lua' |
Latest changes
None for nowYou may also be interested in:
Powered by BlogAlike.com








