"quick": add function "Lisp.tr()" for i18n

This commit is contained in:
polos 2017-02-01 21:38:41 +01:00
parent 376b7caed4
commit 1a41ed320b
2 changed files with 7 additions and 0 deletions

View file

@ -36,6 +36,9 @@ Item {
// (5) pass 'this' as first argument (can be accessed in Lisp via qml:*caller*)
Lisp.call(this, "eql-user:show-properties-dialog")
// (6) i18n
console.log(Lisp.tr("internationalization"))
}
Text {

View file

@ -51,3 +51,7 @@ function apply(arg1, arg2, arg3) {
name = arg1;
args = arg2; }
return checkEval(EQL5.apply(caller, name, args)); }
function tr(source, context, pluralNumber) {
// for i18n
return EQL5.apply(null, "eql:qtranslate", [context, source, (typeof(pluralNumber) == "number") ? pluralNumber : 0]); }