B4A Library B4AProperties

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
 

Attachments

  • B4AProperties_v1.0.zip
    126.6 KB · Views: 321
  • english.png
    english.png
    67 KB · Views: 266
  • italian.png
    italian.png
    66.9 KB · Views: 250
  • hebrew.png
    hebrew.png
    57.1 KB · Views: 248
  • deutsch.png
    deutsch.png
    71.5 KB · Views: 250
  • spanish.png
    spanish.png
    67.8 KB · Views: 248
  • traditional_chinese.png
    traditional_chinese.png
    65.1 KB · Views: 237
  • french.png
    french.png
    69.8 KB · Views: 245
Top