소스 검색

Make sure variables are interpolated when no translations exist.

JC Brand 8 년 전
부모
커밋
59ca7bae16
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      src/utils.js

+ 3 - 2
src/utils.js

@@ -27,6 +27,7 @@
         tpl_form_captcha
     ) {
     "use strict";
+    locales = locales || {};
 
     var XFORM_TYPE_MAP = {
         'text-private': 'password',
@@ -158,8 +159,8 @@
         // Translation machinery
         // ---------------------
         __: function (str) {
-            if (typeof Jed === "undefined" || !utils.isConverseLocale(this.locale) || this.locale === 'en') {
-                return str;
+            if (!utils.isConverseLocale(this.locale) || this.locale === 'en') {
+                return Jed.sprintf.apply(Jed, arguments);
             }
             if (typeof this.jed === "undefined") {
                 this.jed = new Jed(window.JSON.parse(locales[this.locale]));