Update style of i18n, pull it in via preload instead of .html
This commit is contained in:
parent
1ad2b080c8
commit
f86a6ef752
7 changed files with 47 additions and 40 deletions
13
preload.js
13
preload.js
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue