1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
mastodon/config/formatjs-formatter.js

14 lines
333 B
JavaScript
Raw Normal View History

2023-05-31 14:43:39 -07:00
const path = require('path');
2024-02-28 14:02:14 -08:00
const currentTranslations = require(
path.join(__dirname, '../app/javascript/mastodon/locales/en.json'),
);
2023-05-31 14:43:39 -07:00
exports.format = (msgs) => {
const results = {};
for (const [id, msg] of Object.entries(msgs)) {
results[id] = currentTranslations[id] || msg.defaultMessage;
}
return results;
};