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