Skip to content

Commit

Permalink
fix: l10n tags
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Sep 10, 2023
1 parent 984ffd6 commit f6a1d31
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/get-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,14 @@ export default class GetText {

// domain
else if ( key === "domain" ) {
if ( property.value.type !== "Literal" ) continue;

res.domains = property.value.value;
if ( property.value.type === "Literal" ) {
res.domains = property.value.value;
}
else if ( property.value.type === "TemplateLiteral" ) {
if ( property.value.quasis.length === 1 ) {
res.domains = property.value.quasis.map( node => node.value.cooked ).join( "${n}" );
}
}
}

// tags
Expand Down

0 comments on commit f6a1d31

Please sign in to comment.