Co-authored-by: tobi <tobi.smethurst@protonmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/88 Co-authored-by: Zoë Bijl <moiety@noreply.codeberg.org> Co-committed-by: Zoë Bijl <moiety@noreply.codeberg.org>
15 lines
486 B
JavaScript
15 lines
486 B
JavaScript
const path = require("path");
|
|
|
|
const upstreamTranslations = require(path.join(__dirname, "../app/javascript/mastodon/locales/en.json"));
|
|
const currentTranslations = require(path.join(__dirname, "../app/javascript/flavours/glitch/locales/en.json"));
|
|
|
|
exports.format = (msgs) => {
|
|
const results = {};
|
|
for (const [id, msg] of Object.entries(msgs)) {
|
|
if (!upstreamTranslations[id]) {
|
|
results[id] = currentTranslations[id] || msg.defaultMessage;
|
|
}
|
|
}
|
|
return results;
|
|
};
|