fallback to es for moment when given locale is es-419

pull/1495/head
Audric Ackermann 4 years ago
parent 0d3e515843
commit 60afbe7b06
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -350,20 +350,6 @@ const Signal = require('./js/modules/signal');
const i18n = require('./js/modules/i18n');
const Attachments = require('./app/attachments');
const { locale } = config;
window.i18n = i18n.setup(locale, localeMessages);
window.moment = require('moment');
window.moment.updateLocale(locale, {
relativeTime: {
s: window.i18n('timestamp_s'),
m: window.i18n('timestamp_m'),
h: window.i18n('timestamp_h'),
},
});
window.moment.locale(locale);
window.Signal = Signal.setup({
Attachments,
userDataPath: app.getPath('userData'),
@ -418,6 +404,20 @@ window.seedNodeList = JSON.parse(config.seedNodeList);
const { OnionAPI } = require('./ts/session/onions');
const { locale } = config;
window.i18n = i18n.setup(locale, localeMessages);
// moment does not support es-419 correctly (and cause white screen on app start)
const localeForMoment = locale === 'es-419' ? 'es' : locale;
window.moment.updateLocale(localeForMoment, {
relativeTime: {
s: window.i18n('timestamp_s'),
m: window.i18n('timestamp_m'),
h: window.i18n('timestamp_h'),
},
});
window.moment.locale(localeForMoment);
window.OnionAPI = OnionAPI;
window.libsession = require('./ts/session');

Loading…
Cancel
Save