tolgee-js icon indicating copy to clipboard operation
tolgee-js copied to clipboard

Tags interpolation not working with numbers?

Open baptisteArno opened this issue 2 years ago • 1 comments

Trying to interpolate the <1> tag here:

"account.apiTokens.deleteConfirmationMessage": "The token <1>tokenName</1> will be permanently revoked, are you sure you want to continue?",
<T
  keyName="account.apiTokens.deleteConfirmationMessage"
  params={{
    1: <strong>My token</strong>,
  }}
/>;

This displays "invalid". Any reason why numbers are not accepted here? :)

baptisteArno avatar Oct 18 '23 08:10 baptisteArno

We are using format js for the tags interpolation, but it seems like it's not able to handle numbers. https://formatjs.io/docs/intl-messageformat#rich-text-support

We already have an issue with self-closing tags, so we'll probably release a separate tag parser to solve this.

stepan662 avatar Oct 18 '23 09:10 stepan662