Skip to content

Commit fcdfec9

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents 569e54e + e868dbb commit fcdfec9

2 files changed

Lines changed: 15 additions & 17 deletions

File tree

‎scripts/copy-res.js‎

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@
99
// This could readily be automated, but it's nice to explicitly
1010
// control when we languages are available.
1111
const INCLUDE_LANGS = [
12-
//'be' Omitted because no translations in react-sdk
13-
'en_EN',
14-
'da',
15-
'de_DE',
16-
'es',
17-
'fr',
18-
'be',
19-
'nl',
20-
'pt',
21-
'pt_BR',
22-
'ru',
12+
{'value': 'en_EN', 'label': 'English'},
13+
{'value': 'da', 'label': 'Dansk'},
14+
{'value': 'nl', 'label': 'Nederlands'},
15+
{'value': 'de_DE', 'label': 'Deutsch'},
16+
{'value': 'fr', 'label': 'Français'},
17+
{'value': 'pt', 'label': 'Português'},
18+
{'value': 'pt_BR', 'label': 'Português do Brasil'},
19+
{'value': 'ru', 'label': 'Русский'},
20+
{'value': 'es', 'label': 'Español'},
21+
{'value': 'zh_Hans', 'label': '中文'}
2322
];
2423

2524
// cpx includes globbed parts of the filename in the destination, but excludes
@@ -37,7 +36,7 @@ const COPY_LIST = [
3736

3837
INCLUDE_LANGS.forEach(function(l) {
3938
COPY_LIST.push([
40-
l, "webapp/i18n/", { lang: 1 },
39+
l.value, "webapp/i18n/", { lang: 1 },
4140
]);
4241
});
4342

@@ -159,12 +158,12 @@ function genLangFile(lang, dest) {
159158
function genLangList() {
160159
const languages = {};
161160
INCLUDE_LANGS.forEach(function(lang) {
162-
const normalizedLanguage = lang.toLowerCase().replace("_", "-");
161+
const normalizedLanguage = lang.value.toLowerCase().replace("_", "-");
163162
const languageParts = normalizedLanguage.split('-');
164163
if (languageParts.length == 2 && languageParts[0] == languageParts[1]) {
165-
languages[languageParts[0]] = lang + '.json';
164+
languages[languageParts[0]] = {'fileName': lang.value + '.json', 'label': lang.label};
166165
} else {
167-
languages[normalizedLanguage] = lang + '.json';
166+
languages[normalizedLanguage] = {'fileName': lang.value + '.json', 'label': lang.label};
168167
}
169168
});
170169
fs.writeFile('webapp/i18n/languages.json', JSON.stringify(languages, null, 4));

‎webpack.config.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010

1111
// We ship olm.js as a separate lump of javascript. This makes it get
1212
// loaded via a separate <script/> tag in index.html (which loads it
13-
// into the browser global `Olm`), and define it as an external below.
13+
// into the browser global `Olm`, where js-sdk expects to find it).
1414
//
1515
// (we should probably make js-sdk load it asynchronously at some
1616
// point, so that it doesn't block the pageload, but that is a separate
@@ -99,7 +99,6 @@ module.exports = {
9999
},
100100
},
101101
externals: {
102-
"olm": "Olm",
103102
// Don't try to bundle electron: leave it as a commonjs dependency
104103
// (the 'commonjs' here means it will output a 'require')
105104
"electron": "commonjs electron",

0 commit comments

Comments
 (0)