From ffe17a6bc90e4e37c9c692ac83681375071d366d Mon Sep 17 00:00:00 2001 From: Pierre Bondoerffer Date: Tue, 21 Feb 2017 14:37:08 +0100 Subject: [PATCH] Use JSON.stringify instead and fix linter --- www/assert/translations/main.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/www/assert/translations/main.js b/www/assert/translations/main.js index e711cbf8a..9e81a87bf 100644 --- a/www/assert/translations/main.js +++ b/www/assert/translations/main.js @@ -10,12 +10,8 @@ define([ return $('
', opt).text(text);
     };
 
-    var addSlashes = function (text) {
-        return (text + '').replace(/[\\']/g, '\\\'');
-    }
-
     var todo = function (missing) {
-        var str = "";;
+        var str = "";
         var need = 1;
 
         if (missing.length) {
@@ -27,19 +23,25 @@ define([
 
                 if (str !== code) {
                     if (str !== "")
+                    {
                         res += '\n';
+                    }
                     str = code;
                     res += '/*\n *\n * ' + code + '\n *\n */\n\n';
                 }
                 if (need !== needed) {
                     need = needed;
                     if (need === 0)
+                    {
                         res += '\n// TODO: These keys are not needed anymore and should be removed ('+ code + ')\n\n';
+                    }
                 }
 
-                res += (need ? '' : '// ') + 'out.' + key + ' = \'\';';
+                res += (need ? '' : '// ') + 'out.' + key + ' = "";';
                 if (need)
-                    res += ' // \'' + addSlashes(Cryptpad.Messages._getKey(key, [])) + '\'';
+                {
+                    res += ' // ' + JSON.stringify(Cryptpad.Messages._getKey(key, []));
+                }
                 return res;
             }).join('\n')));
         } else {