forked from matrix/element-web
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
fcdfec9d64
|
@ -9,17 +9,16 @@
|
||||||
// This could readily be automated, but it's nice to explicitly
|
// This could readily be automated, but it's nice to explicitly
|
||||||
// control when we languages are available.
|
// control when we languages are available.
|
||||||
const INCLUDE_LANGS = [
|
const INCLUDE_LANGS = [
|
||||||
//'be' Omitted because no translations in react-sdk
|
{'value': 'en_EN', 'label': 'English'},
|
||||||
'en_EN',
|
{'value': 'da', 'label': 'Dansk'},
|
||||||
'da',
|
{'value': 'nl', 'label': 'Nederlands'},
|
||||||
'de_DE',
|
{'value': 'de_DE', 'label': 'Deutsch'},
|
||||||
'es',
|
{'value': 'fr', 'label': 'Français'},
|
||||||
'fr',
|
{'value': 'pt', 'label': 'Português'},
|
||||||
'be',
|
{'value': 'pt_BR', 'label': 'Português do Brasil'},
|
||||||
'nl',
|
{'value': 'ru', 'label': 'Русский'},
|
||||||
'pt',
|
{'value': 'es', 'label': 'Español'},
|
||||||
'pt_BR',
|
{'value': 'zh_Hans', 'label': '中文'}
|
||||||
'ru',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// cpx includes globbed parts of the filename in the destination, but excludes
|
// cpx includes globbed parts of the filename in the destination, but excludes
|
||||||
|
@ -37,7 +36,7 @@ const COPY_LIST = [
|
||||||
|
|
||||||
INCLUDE_LANGS.forEach(function(l) {
|
INCLUDE_LANGS.forEach(function(l) {
|
||||||
COPY_LIST.push([
|
COPY_LIST.push([
|
||||||
l, "webapp/i18n/", { lang: 1 },
|
l.value, "webapp/i18n/", { lang: 1 },
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -159,12 +158,12 @@ function genLangFile(lang, dest) {
|
||||||
function genLangList() {
|
function genLangList() {
|
||||||
const languages = {};
|
const languages = {};
|
||||||
INCLUDE_LANGS.forEach(function(lang) {
|
INCLUDE_LANGS.forEach(function(lang) {
|
||||||
const normalizedLanguage = lang.toLowerCase().replace("_", "-");
|
const normalizedLanguage = lang.value.toLowerCase().replace("_", "-");
|
||||||
const languageParts = normalizedLanguage.split('-');
|
const languageParts = normalizedLanguage.split('-');
|
||||||
if (languageParts.length == 2 && languageParts[0] == languageParts[1]) {
|
if (languageParts.length == 2 && languageParts[0] == languageParts[1]) {
|
||||||
languages[languageParts[0]] = lang + '.json';
|
languages[languageParts[0]] = {'fileName': lang.value + '.json', 'label': lang.label};
|
||||||
} else {
|
} 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));
|
fs.writeFile('webapp/i18n/languages.json', JSON.stringify(languages, null, 4));
|
||||||
|
|
|
@ -10,7 +10,7 @@ module.exports = {
|
||||||
|
|
||||||
// We ship olm.js as a separate lump of javascript. This makes it get
|
// We ship olm.js as a separate lump of javascript. This makes it get
|
||||||
// loaded via a separate <script/> tag in index.html (which loads it
|
// loaded via a separate <script/> tag in index.html (which loads it
|
||||||
// into the browser global `Olm`), and define it as an external below.
|
// into the browser global `Olm`, where js-sdk expects to find it).
|
||||||
//
|
//
|
||||||
// (we should probably make js-sdk load it asynchronously at some
|
// (we should probably make js-sdk load it asynchronously at some
|
||||||
// point, so that it doesn't block the pageload, but that is a separate
|
// point, so that it doesn't block the pageload, but that is a separate
|
||||||
|
@ -99,7 +99,6 @@ module.exports = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
externals: {
|
externals: {
|
||||||
"olm": "Olm",
|
|
||||||
// Don't try to bundle electron: leave it as a commonjs dependency
|
// Don't try to bundle electron: leave it as a commonjs dependency
|
||||||
// (the 'commonjs' here means it will output a 'require')
|
// (the 'commonjs' here means it will output a 'require')
|
||||||
"electron": "commonjs electron",
|
"electron": "commonjs electron",
|
||||||
|
|
Loading…
Reference in New Issue