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
2024-07-24 12:54:56 -04:00

13 lines
333 B
JavaScript

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;
};