You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using curly braces {{ }} they need to be escaped as far as I understood with a '. Usage: '{{somestring}}. However, when I pass the en.json with the escaped curly brace into the IntlProvider it shows up (see codesandbox below). As soon as I remove the messages in IntlProvider, the ' is gone (so the defaultMessage is changing the string correctly). So here I assume that messages really needs the final string, without the escaped character.
Now I am coming to the "or" from above. Here I am not sure what the expected input of IntlProvider should be. If it is with the ', then it is a bug in the react-intl (see en.json). If the expected input is without, then the formatjs compile (or maybe even the formatjs extract) has the wrong processing (this part is also included in the codesandbox).
Which package?
[email protected]
or@formatjs/[email protected]
(later described why the "or")Describe the bug
When using curly braces
{{ }}
they need to be escaped as far as I understood with a'
. Usage:'{{somestring}}
. However, when I pass theen.json
with the escaped curly brace into theIntlProvider
it shows up (see codesandbox below). As soon as I remove themessages
inIntlProvider
, the'
is gone (so thedefaultMessage
is changing the string correctly). So here I assume thatmessages
really needs the final string, without the escaped character.Now I am coming to the "or" from above. Here I am not sure what the expected input of
IntlProvider
should be. If it is with the'
, then it is a bug in thereact-intl
(seeen.json
). If the expected input is without, then theformatjs compile
(or maybe even theformatjs extract
) has the wrong processing (this part is also included in the codesandbox).To Reproduce
Codesandbox URL
https://codesandbox.io/p/devbox/zk8phk?migrateFrom=f26n8v
Reproducible Steps/Repo
Steps to reproduce the behavior:
react-intl
:index.jsx
messages
'
is then gone and takes the correctdefaultMessage
@formatjs/cli
(just a showcase how I run it)npm run i18n:generate
Expected behavior
I would expect that with the following setup I would not see the
'
in the messageThe text was updated successfully, but these errors were encountered: