You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

  1. /* @preval */
  2. const fs = require('fs');
  3. const path = require('path');
  4. const filtered = {};
  5. const filenames = fs.readdirSync(path.resolve(__dirname, '../locales'));
  6. filenames.forEach(filename => {
  7. if (!filename.match(/\.json$/) || filename.match(/defaultMessages|whitelist/)) return;
  8. const content = fs.readFileSync(path.resolve(__dirname, `../locales/${filename}`), 'utf-8');
  9. const full = JSON.parse(content);
  10. const locale = filename.split('.')[0];
  11. filtered[locale] = {
  12. 'notification.favourite': full['notification.favourite'] || '',
  13. 'notification.follow': full['notification.follow'] || '',
  14. 'notification.follow_request': full['notification.follow_request'] || '',
  15. 'notification.mention': full['notification.mention'] || '',
  16. 'notification.reblog': full['notification.reblog'] || '',
  17. 'notification.poll': full['notification.poll'] || '',
  18. 'status.show_more': full['status.show_more'] || '',
  19. 'status.reblog': full['status.reblog'] || '',
  20. 'status.favourite': full['status.favourite'] || '',
  21. 'notifications.group': full['notifications.group'] || '',
  22. };
  23. });
  24. module.exports = JSON.parse(JSON.stringify(filtered));