From ad1f750f29009664a29d259c0ceb789831751772 Mon Sep 17 00:00:00 2001 From: zdm Date: Fri, 16 Feb 2024 18:02:31 +0200 Subject: [PATCH] fix: translations --- lib/get-text.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/get-text.js b/lib/get-text.js index 570d48e9..6fc13920 100644 --- a/lib/get-text.js +++ b/lib/get-text.js @@ -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" ];