revision of revision

This commit is contained in:
polos 2017-02-02 11:14:59 +01:00
parent 307b0cb8d2
commit df3ce301a7
2 changed files with 6 additions and 6 deletions

View file

@ -2524,12 +2524,12 @@ cl_object qtranslate(cl_object l_con, cl_object l_src, cl_object l_n) {
ecl_process_env()->nvalues = 1;
QByteArray context(toQString(l_con).toUtf8());
QByteArray source(toQString(l_src).toUtf8());
int n = toInt(l_n);
int n = (int)toFloat(l_n); // for QML (value comes from JS)
cl_object l_ret;
if(n > 0) {
l_ret = from_qstring(QCoreApplication::translate(context, source, 0, n)); }
else {
if(n == -1) {
l_ret = from_qstring(QCoreApplication::translate(context, source)); }
else {
l_ret = from_qstring(QCoreApplication::translate(context, source, 0, n)); }
return l_ret; }
cl_object qlocal8bit(cl_object l_str) {

View file

@ -52,6 +52,6 @@ function apply(arg1, arg2, arg3) {
args = arg2; }
return checkEval(EQL5.apply(caller, name, args)); }
function tr(source, context, pluralNumber) {
function tr(source, context, pluralN) {
// for i18n
return EQL5.apply(null, "eql:qtranslate", [context, source, pluralNumber]); }
return EQL5.apply(null, "qtranslate", [context, source, (undefined != pluralN) ? pluralN : -1]); }