mirror of
https://github.com/elyby/emails-renderer.git
synced 2025-05-31 14:12:05 +05:30
Implemented font image renderer
This commit is contained in:
@@ -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});
|
||||
`;
|
||||
};
|
||||
|
Reference in New Issue
Block a user