1
0
Fork 1
mirror of https://github.com/mastodon/mastodon.git synced 2025-01-05 23:05:36 +00:00
mastodon/config/formatjs-formatter.js

12 lines
328 B
JavaScript
Raw Normal View History

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