Skip to content

Commit

Permalink
fix: tramslations
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Feb 14, 2024
1 parent 5051371 commit 38914bf
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/package/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand All @@ -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:
Expand Down

0 comments on commit 38914bf

Please sign in to comment.