Skip to content

Commit

Permalink
fix: translations
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Feb 16, 2024
1 parent 93037f9 commit ad1f750
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/get-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,21 @@ export default class GetText {
start,
} );

// XXX
if ( !plural.value ) return;

// XXX
if ( !plural.isTemplate ) throw `Plural message must be msgid taggeed template`;
if ( !plural.isTemplate ) {
throw this.#error( `Plural message must be msgid taggeed template`, {
node,
start,
} );
}

// XXX
if ( !msgId.isTemplate ) throw `Single form message used with plurak form must be msgid taggeed template`;
if ( !msgId.isTemplate ) {
throw this.#error( `Single form message used with plurak form must be msgid taggeed template`, {
node,
start,
} );
}

message.pluralId = plural.value;
if ( plural.isTemplate ) message.flags = [ "javascript-format" ];
Expand Down

0 comments on commit ad1f750

Please sign in to comment.