From e9d3272e87dd0b67a7a49455d3a9e6dfb9df3cc9 Mon Sep 17 00:00:00 2001 From: lilia Date: Mon, 14 Dec 2015 15:10:49 -0800 Subject: [PATCH] Prepare for i18n // FREEBIE --- Gruntfile.js | 1 + _locales/en/messages.json | 2 ++ _locales/it/messages.json | 2 ++ js/chromium.js | 5 +++++ manifest.json | 1 + 5 files changed, 11 insertions(+) create mode 100644 _locales/en/messages.json create mode 100644 _locales/it/messages.json diff --git a/Gruntfile.js b/Gruntfile.js index 2205646d..ec914d56 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -106,6 +106,7 @@ module.exports = function(grunt) { 'index.html', 'conversation.html', 'options.html', + '_locales/**', 'protos/*', 'js/**', 'stylesheets/*.css', diff --git a/_locales/en/messages.json b/_locales/en/messages.json new file mode 100644 index 00000000..2c63c085 --- /dev/null +++ b/_locales/en/messages.json @@ -0,0 +1,2 @@ +{ +} diff --git a/_locales/it/messages.json b/_locales/it/messages.json new file mode 100644 index 00000000..2c63c085 --- /dev/null +++ b/_locales/it/messages.json @@ -0,0 +1,2 @@ +{ +} diff --git a/js/chromium.js b/js/chromium.js index 3e3a17be..47b2c085 100644 --- a/js/chromium.js +++ b/js/chromium.js @@ -157,6 +157,11 @@ } }; + // Translate + window.i18n = function(message) { + return chrome.i18n.getMessage(message); + }; + window.textsecure = window.textsecure || {}; window.textsecure.registration = { done: function () { diff --git a/manifest.json b/manifest.json index f948bf6e..62a73d81 100644 --- a/manifest.json +++ b/manifest.json @@ -7,6 +7,7 @@ "version": "0.1.5", "offline_enabled": false, "minimum_chrome_version": "37", + "default_locale": "en", "permissions": [ "unlimitedStorage",