Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' &&
Expand Down Expand Up @@ -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 : []);
Expand Down