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.
2023-05-31 14:43:39 -07:00
|
|
|
const path = require('path');
|
|
|
|
|
2023-06-10 02:15:05 -07:00
|
|
|
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"));
|
2023-05-31 14:43:39 -07:00
|
|
|
|
|
|
|
exports.format = (msgs) => {
|
|
|
|
const results = {};
|
|
|
|
for (const [id, msg] of Object.entries(msgs)) {
|
2023-06-10 02:15:05 -07:00
|
|
|
if (!upstreamTranslations[id]) {
|
|
|
|
results[id] = currentTranslations[id] || msg.defaultMessage;
|
|
|
|
}
|
2023-05-31 14:43:39 -07:00
|
|
|
}
|
|
|
|
return results;
|
|
|
|
};
|