diff --git a/lib/extract.js b/lib/extract.js index 612377e..64ce9bc 100644 --- a/lib/extract.js +++ b/lib/extract.js @@ -212,6 +212,17 @@ var Extractor = (function () { return; } + function isAnnontatedString(node) { + return node !== null && + isStringLiteral(node) && + node.leadingComments && + self.options.markerNames.some(function (markerName) { + return node.leadingComments.some(function (comment) { + return comment.value.indexOf(markerName) !== -1; + }); + }); + } + function isGettext(node) { return node !== null && node.type === 'CallExpression' && @@ -298,6 +309,8 @@ var Extractor = (function () { } else if (isTemplateElement(node)) { var line = reference.location && reference.location.start.line ? reference.location.start.line - 1 : 0; self.extractHtml(reference.file, node.value.raw, line); + } else if (isAnnontatedString(node)) { + str = getJSExpression(node); } if (str || singular) { var leadingComments = node.leadingComments || (parentComment ? parentComment.leadingComments : []);