Implemented font image renderer

This commit is contained in:
ErickSkrauch
2019-05-10 01:53:28 +03:00
parent cb84df8f96
commit 625b5a9b94
42 changed files with 628 additions and 531 deletions

View File

@@ -10,16 +10,25 @@ module.exports = function(input) {
const json = JSON.parse(input);
const result = JSON.stringify(Object.keys(json).reduce((translations, key) => {
translations[key] = {
id: `${moduleId}.${key}`,
defaultMessage: json[key],
};
const value = json[key];
const id = `${moduleId}.${key}`;
if (typeof value === 'object') {
translations[key] = {
...value,
id,
};
} else {
translations[key] = {
id,
defaultMessage: value,
};
}
return translations;
}, {}));
return `
import { defineMessages } from 'react-intl';
export default defineMessages(${result})
export default defineMessages(${result});
`;
};