mirror of
https://gitlab.com/eql/EQL5.git
synced 2026-01-30 12:22:36 -08:00
"quick": add function "Lisp.tr()" for i18n
This commit is contained in:
parent
376b7caed4
commit
1a41ed320b
2 changed files with 7 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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]); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue