Skip to content

Commit

Permalink
Merge pull request #1546 from Bilb/master
Browse files Browse the repository at this point in the history
Bump to v1.5.1
  • Loading branch information
Bilb authored Mar 19, 2021
2 parents 96da731 + 8c7c76a commit 35321c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "session-desktop",
"productName": "Session",
"description": "Private messaging from your desktop",
"version": "1.5.0",
"version": "1.5.1",
"license": "GPL-3.0",
"author": {
"name": "Loki Project",
Expand Down
16 changes: 10 additions & 6 deletions preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,21 +387,25 @@ window.seedNodeList = JSON.parse(config.seedNodeList);

const { OnionPaths } = 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;
const { locale: localFromEnv } = config;
window.i18n = i18n.setup(localFromEnv, localeMessages);

// moment does not support es-419 correctly (and cause white screen on app start)
window.moment = require('moment');

window.moment.updateLocale(localeForMoment, {
// Default to the locale from env. It will be overriden if moment
// does not recognize it with what moment knows which is the closest.
// i.e. es-419 will return 'es'.
// We just need to use what we got from moment on the updateLocale below

const localeSetForMoment = window.moment.locale(localFromEnv);
window.moment.updateLocale(localeSetForMoment, {
relativeTime: {
s: window.i18n('timestamp_s'),
m: window.i18n('timestamp_m'),
h: window.i18n('timestamp_h'),
},
});
window.moment.locale(localeForMoment);

window.OnionPaths = OnionPaths;

Expand Down

0 comments on commit 35321c2

Please sign in to comment.