Skip to content

Commit

Permalink
fix: translations
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Feb 17, 2024
1 parent 519b182 commit aeccc63
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/get-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,7 @@ export default class GetText {
if ( !single.id && !plural.id ) return;

// extracted comments
const comment = this.#extractNodeComment( ast, node );

if ( comment ) var extractedComments = [ comment ];
const extractedComments = this.#extractNodeComment( ast, node );

if ( single.id ) {
this.#poFile.addEctractedMessages( {
Expand Down Expand Up @@ -392,7 +390,7 @@ export default class GetText {
}
}

return comments.join( "\n" );
if ( comments.length ) return [ comments.join( "\n" ) ];
}

#getNodeLocation ( node, { start } = {} ) {
Expand Down

0 comments on commit aeccc63

Please sign in to comment.