JC Brand 8 năm trước cách đây
mục cha
commit
acf0e19d99
4 tập tin đã thay đổi với 11 bổ sung10 xóa
  1. 2 1
      docs/CHANGES.md
  2. 6 3
      src/converse-core.js
  3. 3 5
      src/converse.js
  4. 0 1
      src/utils.js

+ 2 - 1
docs/CHANGES.md

@@ -7,9 +7,10 @@
 - *Breaking change*: Callbacks for `converse.on` now no longer receive an event
   object as first parameter. [jcbrand]
 - Use lodash instead of underscore.js [jcbrand]
+- Escape user-generated input to prevent JS-injection attacks. (Thanks to SamWhited) [jcbrand]
 - #486 Honor existing mam user configuration [throwaway42]
 - #749 /me will show your contact's name in the sent field [jcbrand]
-- Escape user-generated input to prevent JS-injection attacks. (Thanks to SamWhited) [jcbrand]
+- #774 Browser language (fr-fr or fr) is not detected by default [jcbrand]
 
 ## 2.0.5 (Unreleased)
 - #743, #751, #753 Update to Strophe 1.2.12. SASL-EXTERNAL now has reduced priority, so it won't

+ 6 - 3
src/converse-core.js

@@ -12,6 +12,7 @@
         "jquery",
         "lodash",
         "polyfill",
+        "locales",
         "utils",
         "moment_with_locales",
         "strophe",
@@ -20,7 +21,7 @@
         "backbone.browserStorage",
         "backbone.overview",
     ], factory);
-}(this, function (sizzle, $, _, dummy, utils, moment, Strophe, pluggable) {
+}(this, function (sizzle, $, _, dummy, locales, utils, moment, Strophe, pluggable) {
     /*
      * Cannot use this due to Safari bug.
      * See https://github.com/jcbrand/converse.js/issues/196
@@ -178,8 +179,10 @@
 
         // Detect support for the user's locale
         // ------------------------------------
-        var locales = _.isUndefined(locales) ? {} : locales;
-        this.isConverseLocale = function (locale) { return !_.isUndefined(locales[locale]); };
+        locales = _.isUndefined(locales) ? {} : locales;
+        this.isConverseLocale = function (locale) {
+            return !_.isUndefined(locales[locale]);
+        };
         this.isMomentLocale = function (locale) { return moment.locale() !== moment.locale(locale); };
         if (!moment.locale) { //moment.lang is deprecated after 2.8.1, use moment.locale instead
             moment.locale = moment.lang;

+ 3 - 5
src/converse.js

@@ -9,16 +9,14 @@ if (typeof define !== 'undefined') {
     /* When running tests, define is not defined. */
     define("converse", [
         "converse-api",
+        // PLEASE NOTE: By default all translations are included.
+        // You can modify the file src/locales.js to include only those
+        // translations that you care about.
 
         /* START: Removable components
          * --------------------
          * Any of the following components may be removed if they're not needed.
          */
-        "locales",              // Translations for converse.js. This line can be removed
-                                // to remove *all* translations, or you can modify the
-                                // file src/locales.js to include only those
-                                // translations that you care about.
-
         "converse-chatview",    // Renders standalone chat boxes for single user chat
         "converse-controlbox",  // The control box
         "converse-bookmarks",   // XEP-0048 Bookmarks

+ 0 - 1
src/utils.js

@@ -215,7 +215,6 @@
                 locale = utils.isLocaleAvailable(window.navigator.systemLanguage, library_check);
             }
             return locale || 'en';
-
         },
 
         fadeIn: function (el, callback) {