From 33cf39e9a05e18112687c026e635a78cd8025153 Mon Sep 17 00:00:00 2001 From: dtygel Date: Thu, 1 Jun 2017 10:38:36 -0300 Subject: [PATCH 1/2] Add language picker labels (#4141) * fix after rebase * add string to translate in messagecontextmenu * add labels for language picker --- scripts/copy-res.js | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/scripts/copy-res.js b/scripts/copy-res.js index 0d67599f88..460b2b5189 100755 --- a/scripts/copy-res.js +++ b/scripts/copy-res.js @@ -9,17 +9,16 @@ // This could readily be automated, but it's nice to explicitly // control when we languages are available. const INCLUDE_LANGS = [ - //'be' Omitted because no translations in react-sdk - 'en_EN', - 'da', - 'de_DE', - 'es', - 'fr', - 'be', - 'nl', - 'pt', - 'pt_BR', - 'ru', + {'value': 'en_EN', 'label': 'English'}, + {'value': 'da', 'label': 'Dansk'}, + {'value': 'nl', 'label': 'Nederlands'}, + {'value': 'de_DE', 'label': 'Deutsch'}, + {'value': 'fr', 'label': 'Français'}, + {'value': 'pt', 'label': 'Português'}, + {'value': 'pt_BR', 'label': 'Português do Brasil'}, + {'value': 'ru', 'label': 'Русский'}, + {'value': 'es', 'label': 'Español'}, + {'value': 'zh_Hans', 'label': '中文'} ]; // cpx includes globbed parts of the filename in the destination, but excludes @@ -37,7 +36,7 @@ const COPY_LIST = [ INCLUDE_LANGS.forEach(function(l) { COPY_LIST.push([ - l, "webapp/i18n/", { lang: 1 }, + l.value, "webapp/i18n/", { lang: 1 }, ]); }); @@ -159,12 +158,12 @@ function genLangFile(lang, dest) { function genLangList() { const languages = {}; INCLUDE_LANGS.forEach(function(lang) { - const normalizedLanguage = lang.toLowerCase().replace("_", "-"); + const normalizedLanguage = lang.value.toLowerCase().replace("_", "-"); const languageParts = normalizedLanguage.split('-'); if (languageParts.length == 2 && languageParts[0] == languageParts[1]) { - languages[languageParts[0]] = lang + '.json'; + languages[languageParts[0]] = {'fileName': lang.value + '.json', 'label': lang.label}; } else { - languages[normalizedLanguage] = lang + '.json'; + languages[normalizedLanguage] = {'fileName': lang.value + '.json', 'label': lang.label}; } }); fs.writeFile('webapp/i18n/languages.json', JSON.stringify(languages, null, 4)); From e868dbbb9445f1b8cebc0c6e384d1a4ea689cb3e Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 1 Jun 2017 15:46:37 +0100 Subject: [PATCH 2/2] No need to make olm an external (#4139) matrix-js-sdk now loads olm from global.Olm instead of requiring it (https://github.com/matrix-org/matrix-js-sdk/pull/446), so we no longer need to define it as an external. --- webpack.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index efeab7fe8b..5d4fef72a9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,7 +10,7 @@ module.exports = { // We ship olm.js as a separate lump of javascript. This makes it get // loaded via a separate