diff --git a/assets/JsTrans.js b/assets/JsTrans.js index ad122ea..4c2409f 100644 --- a/assets/JsTrans.js +++ b/assets/JsTrans.js @@ -46,10 +46,12 @@ Yii.translate.process = function (message, params, dictionary) { var eval_expr = ex.split('n').join(num); // if expression matches, set translation to current chunk - if (eval(eval_expr)) { - translation = msg; - break; - } + try { + if (eval(eval_expr)) { + translation = msg; + break; + } + } catch(ex) {} } } } @@ -85,4 +87,4 @@ Yii.t = function (category, message, params, language) { // pass message and dictionary to translate function return Yii.translate.process(message, params, dictionary); -} \ No newline at end of file +}