Hi guys, I'm happy to share this little utility to internationalize your programs. B4AProperties it's easy to use.
You don't need anymore to write any strings.xml .
Nothing to explain, there are only four commands:
Initialize("res","my-resources") - it'll automatically load the resource from assets
Initialize2("res","my-resources","it") - it'll automatically load the resource from assets and set Italian language
GetString("common.yes.btn") - get a translated string
GetIcon("image.background") - get an image jpg or png or etc
The zip include a demo and lib.
In the Demo inside assets(Files) folder there is a folder named "res" in this folder You'll find the properties.
You can give any name to the folder You wish to store Your properties.
If You wish to store the properties in assets folder just call Initialize("","my-resources")
To build your property translated into another language use Notepad or any text editor that save in UTF-8 code.
If You use Notepad after wrote the property -> Save as -> in (encoding ) change from ( ANSI to UTF-8 )
example:
your-resources-name.properties for English
your-resources-name_it.properties for Italian
Here an Example of properties for English language:
********************************************
# images properties - this will not load
image.background = images/background.jpg - images is a folder stored Your Pictures
# string properties - this will not load
common.cancel.btn = Cancel
common.yes.btn = Yes
common.no.btn = No
common.close.btn = Close
common.detail.btn = Details...
common.copy.btn = Copy To ClipBoard
common.change.btn = Change
common.anywhere.btn = Anywhere-Software
********************************************
P.S.
For the translation of the property I used an online translator
You don't need anymore to write any strings.xml .
Nothing to explain, there are only four commands:
Initialize("res","my-resources") - it'll automatically load the resource from assets
Initialize2("res","my-resources","it") - it'll automatically load the resource from assets and set Italian language
GetString("common.yes.btn") - get a translated string
GetIcon("image.background") - get an image jpg or png or etc
The zip include a demo and lib.
In the Demo inside assets(Files) folder there is a folder named "res" in this folder You'll find the properties.
You can give any name to the folder You wish to store Your properties.
If You wish to store the properties in assets folder just call Initialize("","my-resources")
To build your property translated into another language use Notepad or any text editor that save in UTF-8 code.
If You use Notepad after wrote the property -> Save as -> in (encoding ) change from ( ANSI to UTF-8 )
example:
your-resources-name.properties for English
your-resources-name_it.properties for Italian
Here an Example of properties for English language:
********************************************
# images properties - this will not load
image.background = images/background.jpg - images is a folder stored Your Pictures
# string properties - this will not load
common.cancel.btn = Cancel
common.yes.btn = Yes
common.no.btn = No
common.close.btn = Close
common.detail.btn = Details...
common.copy.btn = Copy To ClipBoard
common.change.btn = Change
common.anywhere.btn = Anywhere-Software
********************************************
P.S.
For the translation of the property I used an online translator