msgid no longer supports string types
jorrit opened this issue · 3 comments
jorrit commented
I use msgid
inside ngettext
to get a plural string. I also add some other, nonnumeric arguments:
{ngettext(
msgid`Based on ${numberOfRatings} review of customers that traveled with ${supplierName}.`,
`Based on ${numberOfRatings} reviews of customers that traveled with ${supplierName}.`,
numberOfRatings
)}
This used to work fine.
However, in 1.8.0 typescript was introduced, and the type of msgid
is:
export declare function msgid(strings: TemplateStringsArray, ...exprs: number[]): StringWithRawData;
The resulting error is:
TS2345: Argument of type string is not assignable to parameter of type number
I think the type of ...exprs
should be any[]
, just like with the t
function.
Related to #267.
stoyanovk commented
It's my wrong, I noticed it, and fixed in https://github.com/ttag-org/ttag/pull/273/files#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80R42
We will update the lib near time
jorrit commented
Thanks!
AlexMost commented
You can try fix in ttag@1.8.5
. Thanks for the report and big thank to @stoyanovk for the fix 💪