Added i18n and Spanish and Catalan translation
diff --git a/_locales/ca/messages.json b/_locales/ca/messages.json
new file mode 100644
index 0000000..871cfb0
--- /dev/null
+++ b/_locales/ca/messages.json
@@ -0,0 +1,50 @@
+{
+  "appName": {
+    "message": "Scroll infinit a TW",
+    "description": "The extension's name"
+  },
+  "appDescription": {
+    "message": "Fes scroll infinit i obtén altres millores als Fòrums de Google i la Consola de la Comunitat",
+    "description": "The extension's description"
+  },
+  "options_list": {
+    "message": "Activa el scroll infinit a les llistes de fils.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_thread": {
+    "message": "Activa el scroll infinit dins dels fils.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_enhancements": {
+    "message": "Millores addicionals",
+    "description": "Heading for several options that can be enabled in the options page"
+  },
+  "options_fixedtoolbar": {
+    "message": "Mantén visible la barra d'eines de la llista de fils a la Consola de la Comunitat.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_redirect": {
+    "message": "Redirigeix tots els fils oberts a TW a la Consola de la Comunitat.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_experimental_label": {
+    "message": "(experimental)",
+    "description": "Label which is placed next to an option to indicate that it may not work well or may break at any time"
+  },
+  "options_history": {
+    "message": "Mostra un enllaç \"historial de publicacions\" als perfils d'usuari.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_save": {
+    "message": "Desa",
+    "description": "Button in the options page to save the settings"
+  },
+  "inject_links": {
+    "message": "Enllaços",
+    "description": "Heading which we use before the 'previous post' link in a user profile in TW"
+  },
+  "inject_previousposts": {
+    "message": "Historial de publicacions",
+    "description": "Link shown in a user profile (in TW and the Community Console) which points to a search showing the user's posts and messages"
+  }
+}
diff --git a/_locales/en/messages.json b/_locales/en/messages.json
new file mode 100644
index 0000000..905c210
--- /dev/null
+++ b/_locales/en/messages.json
@@ -0,0 +1,50 @@
+{
+  "appName": {
+    "message": "Infinite Scroll in TW",
+    "description": "The extension's name"
+  },
+  "appDescription": {
+    "message": "Get infinite Scroll and other enhancements in the Google Forums and the Community Console",
+    "description": "The extension's description"
+  },
+  "options_list": {
+    "message": "Enable infinite scrolling in thread lists.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_thread": {
+    "message": "Enable infinite scrolling inside threads.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_enhancements": {
+    "message": "Additional enhancements",
+    "description": "Heading for several options that can be enabled in the options page"
+  },
+  "options_fixedtoolbar": {
+    "message": "Fix the toolbar in thread lists in the Community Console.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_redirect": {
+    "message": "Redirect all threads opened in TW to the Community Console.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_experimental_label": {
+    "message": "(experimental)",
+    "description": "Label which is placed next to an option to indicate that it may not work well or may break at any time"
+  },
+  "options_history": {
+    "message": "Show a \"previous posts\" link in user profiles.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_save": {
+    "message": "Save",
+    "description": "Button in the options page to save the settings"
+  },
+  "inject_links": {
+    "message": "Links",
+    "description": "Heading which we use before the 'previous post' link in a user profile in TW"
+  },
+  "inject_previousposts": {
+    "message": "Previous posts",
+    "description": "Link shown in a user profile (in TW and the Community Console) which points to a search showing the user's posts and messages"
+  }
+}
diff --git a/_locales/es/messages.json b/_locales/es/messages.json
new file mode 100644
index 0000000..328cff1
--- /dev/null
+++ b/_locales/es/messages.json
@@ -0,0 +1,50 @@
+{
+  "appName": {
+    "message": "Scroll infinito en TW",
+    "description": "The extension's name"
+  },
+  "appDescription": {
+    "message": "Haz scroll infinito y obtén otras mejoras en los Foros de Google y la Consola de la Comunidad",
+    "description": "The extension's description"
+  },
+  "options_list": {
+    "message": "Activa el scroll infinito en las listas de hilos.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_thread": {
+    "message": "Activa el scroll infinito dentro de los hilos.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_enhancements": {
+    "message": "Mejoras adicionales",
+    "description": "Heading for several options that can be enabled in the options page"
+  },
+  "options_fixedtoolbar": {
+    "message": "Mantén visible la barra de herramientas de la lista de hilos en la Consola de la Comunidad.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_redirect": {
+    "message": "Redirige todos los hilos abiertos en TW a la Consola de la Comunidad.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_experimental_label": {
+    "message": "(experimental)",
+    "description": "Label which is placed next to an option to indicate that it may not work well or may break at any time"
+  },
+  "options_history": {
+    "message": "Muestra un enlace \"historial de publicaciones\" en los perfiles de usuario.",
+    "description": "Feature checkbox in the options page"
+  },
+  "options_save": {
+    "message": "Guardar",
+    "description": "Button in the options page to save the settings"
+  },
+  "inject_links": {
+    "message": "Enlaces",
+    "description": "Heading which we use before the 'previous post' link in a user profile in TW"
+  },
+  "inject_previousposts": {
+    "message": "Historial de publicaciones",
+    "description": "Link shown in a user profile (in TW and the Community Console) which points to a search showing the user's posts and messages"
+  }
+}
diff --git a/console_inject.js b/console_inject.js
index 12512a5..f4e7392 100644
--- a/console_inject.js
+++ b/console_inject.js
@@ -19,7 +19,7 @@
               var name = encodeURIComponent(nameElement.innerText);
               var link = document.createElement("a");
               link.setAttribute("href", "https://support.google.com/s/community/search/query%3D%2528creator%253A%2522"+name+"%2522%2B%257C%2Breplier%253A%2522"+name+"%2522%2529%2B-forum%253A0");
-              link.innerText = "Previous posts";
+              link.innerText = chrome.i18n.getMessage("inject_previousposts");
               node.querySelector(".main-card").appendChild(document.createElement("br"));
               node.querySelector(".main-card").appendChild(link);
             }
diff --git a/manifest.json b/manifest.json
index 32530dc..ad62725 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,8 +1,8 @@
 {
   "manifest_version": 2,
-  "name": "Infinite Scroll in TW",
+  "name": "__MSG_appName__",
   "version": "0.2.0",
-  "description": "Get infinite Scroll in the Google Forums and the Community Console",
+  "description": "__MSG_appDescription__",
   "icons": {
     "512": "icons/512.png",
     "128": "icons/128.png"
@@ -41,5 +41,6 @@
   "background": {
     "scripts": ["background.js"],
     "persistent": false
-  }
+  },
+  "default_locale": "en"
 }
diff --git a/options.html b/options.html
index bb5da0b..8e4bd46 100644
--- a/options.html
+++ b/options.html
@@ -6,16 +6,16 @@
   </head>
   <body>
     <p>
-      <input type="checkbox" id="list"><label for="list"> Enable infinite scrolling in thread lists.</label><br>
-      <input type="checkbox" id="thread"><label for="thread"> Enable infinite scrolling inside threads.</label>
+      <input type="checkbox" id="list"> <label for="list" data-i18n="list"></label><br>
+      <input type="checkbox" id="thread"> <label for="thread" data-i18n="thread"></label>
     </p>
-    <h4>Additional enhancements</h4>
+    <h4 data-i18n="enhancements"></h4>
     <p>
-      <input type="checkbox" id="fixedtoolbar"><label for="fixedtoolbar"> Fix the toolbar in thread lists in the Community Console.</label><br>
-      <input type="checkbox" id="redirect"><label for="redirect"> Redirect all threads opened in TW to the Community Console.<span style="color: gray;">(experimental)</span></label><br>
-      <input type="checkbox" id="history"><label for="history"> Show a "previous posts" link in user profiles.</label>
+      <input type="checkbox" id="fixedtoolbar"> <label for="fixedtoolbar" data-i18n="fixedtoolbar"></label><br>
+      <input type="checkbox" id="redirect"> <label for="redirect" data-i18n="redirect"></label> <span style="color: gray;" data-i18n="experimental_label"></span><br>
+      <input type="checkbox" id="history"> <label for="history" data-i18n="history"></label>
     </p>
-    <p style="text-align: center;"><button id="save">Save</button></p>
+    <p style="text-align: center;"><button id="save" data-i18n="save"></button></p>
     <script src="options.js"></script>
   </body>
 </html>
diff --git a/options.js b/options.js
index eb89bc4..266a28b 100644
--- a/options.js
+++ b/options.js
@@ -38,7 +38,18 @@
   });
 }
 
+function i18n() {
+  var messages = ["list", "thread", "enhancements", "fixedtoolbar", "redirect", "experimental_label", "history", "save"];
+
+  messages.forEach(function(msg) {
+    console.log(msg);
+    document.querySelector("[data-i18n=\""+msg+"\"]").innerHTML = chrome.i18n.getMessage("options_"+msg);
+  });
+}
+
 window.addEventListener("load", function() {
+  i18n();
+
   chrome.storage.sync.get(null, function(items) {
     items = cleanUpOptions(items);
 
diff --git a/profile_inject.js b/profile_inject.js
index 2743672..9d9b670 100644
--- a/profile_inject.js
+++ b/profile_inject.js
@@ -4,7 +4,7 @@
     if (nameElement !== null) {
       var name = encodeURIComponent(nameElement.innerText);
       var link = document.location.pathname.split("/profile")[0]+"/threads?hl=en&amp;thread_filter=(creator:%22"+name+"%22+%7C+replier:%22"+name+"%22)";
-      document.querySelector(".user-profile__user-details-container").insertAdjacentHTML('beforeend', '<div class="user-profile__user-links"><div class="user-profile__user-link-title">Links</div><ul><li class="user-profile__user-link"><a href="'+link+'" data-stats-id="my-posts-link">Previous posts</a></li></ul></div>');
+      document.querySelector(".user-profile__user-details-container").insertAdjacentHTML('beforeend', '<div class="user-profile__user-links"><div class="user-profile__user-link-title">'+chrome.i18n.getMessage("inject_links")+'</div><ul><li class="user-profile__user-link"><a href="'+link+'" data-stats-id="my-posts-link">'+chrome.i18n.getMessage("inject_previousposts")+'</a></li></ul></div>');
     }
   }
 });