diff --git a/lib/package/localization.js b/lib/package/localization.js index 3300a690..69b5ccee 100644 --- a/lib/package/localization.js +++ b/lib/package/localization.js @@ -268,7 +268,7 @@ export default class { } // XXX - if ( message.pluralId && translatedMessage.pluralId && message.pluralId !== translatedMessage.pluralId ) { + if ( message.pluralId && translatedMessage.msgid_plural && message.pluralId !== translatedMessage.msgid_plural ) { console.error( `Plural form conflict found` ); process.exit( 1 ); @@ -290,13 +290,20 @@ ${ JSON.stringify( message.translations, null, 4 ) } const choise = await utils.confirm( "What translations do you want to use?", [ "n", "o" ] ); if ( choise === "n" ) { + if ( !message.pluralId ) { + translatedMessage.translations[ 0 ] = message.translations[ 0 ]; + } + else { + translatedMessage.translations = message.translations; + } - // XXX - this.#storeMessage( poFile.language, message ); + this.#storeMessage( poFile.language, { + "id": translatedMessage.msgid, + "pluralId": translatedMessage.msgid_plural, + "translations": translatedMessage.translations, + } ); } else { - - // XXX message.setTranslations( translatedMessage.translations ); } }