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:
parent
23700e1776
commit
5e6d3156f9
1 changed files with 7 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue