Ensure locale is 'en' when NODE_ENV=test (#1527)

Beacause so many of our tests have hardcoded english strings. We could do
better, but for now anyone running tests locally must simply do so in english,
even if they usually use Signal in another language.

// FREEBIE
This commit is contained in:
Lilia 2017-10-03 20:08:06 +02:00 committed by Scott Nonnenberg
parent 23700e1776
commit 5e6d3156f9

View file

@ -28,14 +28,19 @@ function getLocaleMessages(locale) {
}
function load() {
var english = getLocaleMessages('en');
let english = getLocaleMessages('en');
let appLocale = app.getLocale();
if (process.env.NODE_ENV === 'test') {
appLocale = 'en';
}
// Load locale - if we can't load messages for the current locale, we
// default to 'en'
//
// possible locales:
// https://github.com/electron/electron/blob/master/docs/api/locales.md
let localeName = normalizeLocaleName(app.getLocale());
let localeName = normalizeLocaleName(appLocale);
let messages;
try {