the reference guide says:
Function getI18NMessage
Description Gets the real message for a specified message key; based on current settings inLocale preferences.Syntax
i18n.getI18NMessage(String i18n_key,[Object dynamic_values])
Parameters
String i18n_key - the name of a specified message key.
Objectdynamic values - optional object or dynamic value.Example // returns ‘Welcome myName in mySolution’
// if the key ‘mykey.usrname.text’ is ‘Welcome {0} in mySolution’
i18n.getI18NMessage(‘mykey.usrname.text’,new Array(‘myName’));
My questions are:
-
does the second take an array of objects or an Array or both as its argument?
-
When I pass in an array of strings that are i18n keys, Servoy does not try to localize them. Is that the expected behaviour?
On a related issue, it seems that sometimes Servoy will localize i18n keys without getI18NMessage() being explicitly called.
For example:
tResult = plugins.dialogs.showQuestionDialog(
'i18n:CAT.Label.Question',
'i18n:CAT.Label.QuestionDetails',
'i18n:CAT.Button.OK',
'i18n:CAT.Button.Cancel'
);
works for me.
My question is, when is it legal to use the form ‘i18n:mm.nn.oo’ in methods and expect that the localization will occur automatically?
thanks,
Terry