Skip to content

Commit

Permalink
fix: l10n parser
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Sep 9, 2023
1 parent 2bf43a8 commit 04ebf27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/get-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ export default class GetText {
// not a l10n function / method
if ( method !== "l10n" && method !== "l10nd" && method !== "l10nt" ) return;

var id, pluralId, isTemplate, extractedComments, domain;

// at least 1 argument is required
if ( !node.arguments?.[0] ) return;
if ( method === "l10nd" && !node.arguments?.[1] ) return;

var id, pluralId, isTemplate, extractedComments, domain;

// extract domain
if ( method === "l10nd" ) {
domain = this.#parseCallExpressionArgument( node.arguments[0] ).string;
Expand Down

0 comments on commit 04ebf27

Please sign in to comment.