2023-05-09 11:08:47 +10:00
|
|
|
/* eslint-disable import/no-commonjs --
|
|
|
|
We need to use CommonJS here as its imported into a preval file (`emoji_compressed.js`) */
|
|
|
|
|
2018-05-19 22:46:47 +10:00
|
|
|
/* @preval */
|
|
|
|
|
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
const filtered = {};
|
|
|
|
const filenames = fs.readdirSync(path.resolve(__dirname, '../locales'));
|
|
|
|
|
|
|
|
filenames.forEach(filename => {
|
|
|
|
if (!filename.match(/\.json$/) || filename.match(/defaultMessages|whitelist/)) return;
|
|
|
|
|
|
|
|
const content = fs.readFileSync(path.resolve(__dirname, `../locales/${filename}`), 'utf-8');
|
|
|
|
const full = JSON.parse(content);
|
|
|
|
const locale = filename.split('.')[0];
|
|
|
|
|
|
|
|
filtered[locale] = {
|
|
|
|
'notification.favourite': full['notification.favourite'] || '',
|
|
|
|
'notification.follow': full['notification.follow'] || '',
|
2019-12-02 03:25:29 +11:00
|
|
|
'notification.follow_request': full['notification.follow_request'] || '',
|
2018-05-19 22:46:47 +10:00
|
|
|
'notification.mention': full['notification.mention'] || '',
|
|
|
|
'notification.reblog': full['notification.reblog'] || '',
|
2019-03-11 10:49:31 +11:00
|
|
|
'notification.poll': full['notification.poll'] || '',
|
2022-02-12 08:20:19 +11:00
|
|
|
'notification.status': full['notification.status'] || '',
|
|
|
|
'notification.update': full['notification.update'] || '',
|
2022-02-24 02:45:22 +11:00
|
|
|
'notification.admin.sign_up': full['notification.admin.sign_up'] || '',
|
2018-05-19 22:46:47 +10:00
|
|
|
|
|
|
|
'status.show_more': full['status.show_more'] || '',
|
|
|
|
'status.reblog': full['status.reblog'] || '',
|
|
|
|
'status.favourite': full['status.favourite'] || '',
|
|
|
|
|
|
|
|
'notifications.group': full['notifications.group'] || '',
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = JSON.parse(JSON.stringify(filtered));
|