From 38914bf846fdfc786c140894914e97f3a666e439 Mon Sep 17 00:00:00 2001 From: zdm Date: Wed, 14 Feb 2024 11:06:46 +0200 Subject: [PATCH] fix: tramslations --- lib/package/localization.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/package/localization.js b/lib/package/localization.js index d2445121..c4860326 100644 --- a/lib/package/localization.js +++ b/lib/package/localization.js @@ -256,6 +256,16 @@ export default class { // XXX async #resolveConflict ( poFile, message, translatedMessage ) { + var messageHash, translatedMessageHash; + + if ( !message.pluralId ) { + messageHash = JSON.stringify( message.translations[ 0 ] ); + translatedMessageHash = JSON.stringify( translatedMessageHash.translations[ 0 ] ); + } + else { + messageHash = JSON.stringify( message.translations ); + translatedMessageHash = JSON.stringify( translatedMessageHash.translations ); + } // XXX if ( message.pluralId && translatedMessage.pluralId && message.pluralId !== translatedMessage.pluralId ) { @@ -264,9 +274,6 @@ export default class { process.exit( 1 ); } - const translatedMessageHash = JSON.stringify( translatedMessage.translations ), - messageHash = JSON.stringify( message.translations ); - // translation memory conflict if ( translatedMessageHash !== messageHash ) { console.log( `Translation memory conflict found: