Skip to content

Commit

Permalink
fix: translations
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Feb 15, 2024
1 parent 36a9b94 commit 9b7c78b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/package/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ export default class {
if ( message.isDisabled ) continue;

// delete invalid translation
if ( message.id === message.translations?.[ 0 ] ) {
if ( message.id === message.singleFormTranslation ) {
console.warn( `Failed translation removed:
[en] message:
${ message.id }
[${ poFile.language }] translation:
${ message.translations[ 0 ] }
${ message.singleFormTranslation }
` );

message.isFuzzy = false;
Expand Down Expand Up @@ -267,8 +267,8 @@ ${ res.data }
var messageHash, translatedMessageHash;

if ( !message.pluralId ) {
messageHash = JSON.stringify( message.translations[ 0 ] );
translatedMessageHash = JSON.stringify( translatedMessage.translations[ 0 ] );
messageHash = JSON.stringify( message.singleFormTranslation );
translatedMessageHash = JSON.stringify( translatedMessage.translations[ message.singleFormIndex ] );
}
else {
messageHash = JSON.stringify( message.translations );
Expand Down Expand Up @@ -324,7 +324,7 @@ ${ JSON.stringify( message.translations, null, 4 ) }
}
else if ( answer === "new" ) {
if ( !message.pluralId ) {
translatedMessage.translations[ 0 ] = message.translations[ 0 ];
translatedMessage.translations[ message.singleFormIndex ] = message.singleFormTranslation;
}
else {
translatedMessage.translations = message.translations;
Expand Down

0 comments on commit 9b7c78b

Please sign in to comment.