Update style of i18n, pull it in via preload instead of .html

This commit is contained in:
Scott Nonnenberg 2018-03-23 18:37:32 -07:00
parent 1ad2b080c8
commit f86a6ef752
No known key found for this signature in database
GPG key ID: 5F82280C35134661
7 changed files with 47 additions and 40 deletions

View file

@ -110,6 +110,19 @@ window.nodeNotifier = require('node-notifier');
window.ProxyAgent = require('proxy-agent');
window.moment = require('moment');
const { setup } = require('./js/i18n');
const { locale, localeMessages } = window.config;
window.i18n = setup(locale, localeMessages);
window.moment.updateLocale(locale, {
relativeTime: {
s: window.i18n('timestamp_s'),
m: window.i18n('timestamp_m'),
h: window.i18n('timestamp_h'),
},
});
window.moment.locale(locale);
// ES2015+ modules
const attachmentsPath = Attachments.getPath(app.getPath('userData'));
const deleteAttachmentData = Attachments.createDeleter(attachmentsPath);