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 d0204fc commit 5051371
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/package/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ export default class {

// XXX
async #resolveConflict ( poFile, message, translatedMessage ) {

// XXX
if ( message.pluralId && translatedMessage.pluralId && message.pluralId !== translatedMessage.pluralId ) {
console.error( `Plural form conflict found` );

process.exit( 1 );
}

const translatedMessageHash = JSON.stringify( translatedMessage.translations ),
messageHash = JSON.stringify( message.translations );

Expand Down Expand Up @@ -283,15 +291,14 @@ ${ JSON.stringify( message.translations, null, 4 ) }
}
}

// XXX
#storeMessage ( language, message ) {
#storeMessage ( language, { id, pluralId, translations } ) {
this.#dbh.do( SQL.updateTranslations, [

//
language,
message.id,
message.pluralId || "",
message.translations,
id,
pluralId || "",
translations,
] );
}
}

0 comments on commit 5051371

Please sign in to comment.