This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/config/formatjs-formatter.js

12 lines
328 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;
};