PDA

View Full Version : i18n help page



DirectuX
26-08-2019, 22:14
Hi,

here : help/html/ci18n.htm (https://www.thinbasic.com/public/products/thinBasic/help/html/ci18n.htm) , this example might be more coherent with the upper xml example :

How to get values from parsed XML file
Once file is loaded and parsed, all data inside XML file is stored into an hash table with key/data pairs.
The key under which data is stored is composed by a concatenation of nodes and sibling nodes separated by \

if MyI18N.ErrorPresent Then

'---Some error occurred

printl "Error code", MyI18N.ErrorCode

printl "Error description", MyI18N.ErrorDescription

Else

'---No errors, we can go on

printl MyI18N.GetKey("thinAir")

printl MyI18N.GetKey("en-GB\HiThere")

printl MyI18N.GetKey("it-IT\Good_Morning")

printl MyI18N.GetKey("fr-FR\What_Is_Your_Name")

printl StrFormat$(MyI18N.GetKey("en-GB\My_Name_Is"),"thinBasic")

printl MyI18N.GetKey("thinBasic\en-GB")

end if

ErosOlmi
27-08-2019, 06:14
Thanks, will be present in next release

DirectuX
14-11-2019, 15:10
Here : https://www.thinbasic.com/public/products/thinBasic/help/html/i18n.htm


How to use this module
Inside your script, before calling any module specific keyword, add the following:
USES "I18N"
This directive will load the module and add new keywords and classes described in this section.


IMPORTANT

When loaded, I18N module will automatically create a I18N variable of cI18N class allowing programmer to load XML files.
So to use this module, just use the automatic variable I18N.
I18N module will automatically create a I18N variable of cI18N class
This seems not true: if you remove the Dim instruction in the I18N sample, you'll get an Unknown Keyword error.

DirectuX
16-11-2019, 19:54
https://www.thinbasic.com/public/products/thinBasic/help/html/ci18n_getlocale.htm
https://www.thinbasic.com/public/products/thinBasic/help/html/ci18n_setlocale.htm

on these help pages,
the syntax line and page title are not the good ones. (Sort of Copy/Paste oversight)

Petr Schreiber
18-11-2019, 22:15
Thanks for reporting these issues, Sebastian!


Petr