Page History
...
For example if the key servoy.license.registered has the value 'Registerd to {0} with {1} {2}' the outcome will be 'Registered to Servoy with 15 developers'
You might be wondering how to know when using i18n in a dialog with button the user has clicked because depending on the language of the user the Yes button can be Si, Ja , Oui, Hai, ect.
To solve this you can get the translation in a variable and use that to check wich button is clicked.
For example:
Code Block |
---|
{color:#7f0055}{*}function{*}{color} question() \{ {color:#7f0055}{*}var{*}{color} var yes {color:#ff0000}={color} i18n.getI18NMessage({color:#2a00ff}"servoy.lbl.yes"{color}); {color:#7f0055}{*}var{*}{color} var no {color:#ff0000}={color} i18n.getI18NMessage({color:#2a00ff}"servoy.lbl.no"{color}); {color:#7f0055}{*}var{*}{color} var cancel {color:#ff0000}={color} i18n.getI18NMessage({color:#2a00ff}"servoy.lbl.cancel"{color}); {color:#7f0055}{*}var{*}{color} var answer {color:#ff0000}={color} {color:#ff0000}plugins{color}.dialogs.showQuestionDialog({color:#2a00ff}"i18n:servoy.lbl.title"{color}, {color:#2a00ff}"i18n:servoy.lbl.message"{color}, yes, no, cancel); {color:#7f0055}{*}if{*}{color} if(answer {color:#0000ff}*==*{color} yes) \{ {color:#00c800}application{color}.output({color:#2a00ff}"yes{color} {color:#2a00ff}is{color} {color:#2a00ff}pressed"{color}); {color:#3f7f5f}//execute your code.{color} \} \\ \} |
Note that in dialogs you don't need to use the function i18n. getI18Nmessage() but you can just use "i18n:key".
...
Overview
Content Tools
Activity