Integrate handling of translation tag into static html building, add default description to translate tags

This commit is contained in:
Frank Li 2017-07-10 14:08:00 -07:00
parent ed648074f2
commit 30a8ff329a
4 changed files with 61 additions and 14 deletions

View file

@ -20,7 +20,7 @@ module.exports = function translatePlugin(babel) {
}
/* assume translate element only has one child which is the text */
const text = path.node.children[0].value.trim();
let description;
let description = "no description given";
const attributes = path.node.openingElement.attributes;
for (let i = 0; i < attributes.length; i++) {
if (attributes[i].name.name === "desc") {