~cytrogen/masto-fe

ref: 1a2a4c389fedf4e16457c10d9dbd6aa39fc3f794 masto-fe/config/formatjs-formatter.js -rw-r--r-- 328 bytes
1a2a4c38 — github-actions[bot] New Crowdin Translations (automated) (#27347) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
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;
};