Kaynağa Gözat

Merge pull request #268 from gbonvehi/master

Fix locale set during initialize not being used in utils.translation
JC Brand 10 yıl önce
ebeveyn
işleme
1243d8e3a0
2 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 1 1
      converse.js
  2. 2 2
      src/utils.js

+ 1 - 1
converse.js

@@ -300,7 +300,7 @@
 
         // Translation machinery
         // ---------------------
-        var __ = utils.__;
+        var __ = $.proxy(utils.__, this);
         var ___ = utils.___;
         // Translation aware constants
         // ---------------------------

+ 2 - 2
src/utils.js

@@ -30,7 +30,7 @@ define(["jquery"], function ($) {
     var utils = {
         // Translation machinery
         // ---------------------
-        __: $.proxy(function (str) {
+        __: function (str) {
             // Translation factory
             if (this.i18n === undefined) {
                 this.i18n = locales.en;
@@ -41,7 +41,7 @@ define(["jquery"], function ($) {
             } else {
                 return t.fetch();
             }
-        }, this),
+        },
 
         ___: function (str) {
             /* XXX: This is part of a hack to get gettext to scan strings to be