From aeccc63385ec50ea6f1e502a1551962da9cae392 Mon Sep 17 00:00:00 2001 From: zdm Date: Sat, 17 Feb 2024 15:15:09 +0200 Subject: [PATCH] fix: translations --- lib/get-text.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/get-text.js b/lib/get-text.js index ed85364f..c66e9e64 100644 --- a/lib/get-text.js +++ b/lib/get-text.js @@ -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( { @@ -392,7 +390,7 @@ export default class GetText { } } - return comments.join( "\n" ); + if ( comments.length ) return [ comments.join( "\n" ) ]; } #getNodeLocation ( node, { start } = {} ) {