Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: react-intl formatMessage cannot format message with param that neat by Single quotation mark #28612

Closed
liqQi opened this issue Mar 22, 2024 · 3 comments

Comments

@liqQi
Copy link

liqQi commented Mar 22, 2024

if I hava a message define like:
{ "message.id":'this is a france message, contains d\'{param}' }
then I format message like this:
i18n.formatMessage({id:'message.id'},{param:'value'})
and the result will be :
this is a france message, contains d'{param}

it look like it can't recognize param near by a Single quotation mark,

how can I solve this?

React version: 18.2.0

@liqQi liqQi added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Mar 22, 2024
@subashcs
Copy link

Is this relevant to react? Have you tried with other i18n JS packages?

@liqQi
Copy link
Author

liqQi commented Mar 22, 2024

Is this relevant to react? Have you tried with other i18n JS packages?

no, i18n just is a simple encapsulation of IntlShape,
the code like this:
`

import {IntlShape } from './react-intl'
export type Intl = IntlShape

let i18n:Intl

function xxx(){
i18n = createIntl(...)
}
`

@eps1lon
Copy link
Collaborator

eps1lon commented Mar 22, 2024

Support requests filed as GitHub issues often go unanswered. We want you to find the answer you're looking for, so we suggest the following alternatives:

Coding Questions
If you have a coding question related to React and React DOM, it might be better suited for Stack Overflow. It's a great place to browse through frequent questions about using React, as well as ask for help with specific questions.

https://stackoverflow.com/questions/tagged/react

Talk to other React developers
There are many online forums which are a great place for discussion about best practices and application architecture as well as the future of React.

https://react.dev/community

@eps1lon eps1lon closed this as not planned Won't fix, can't repro, duplicate, stale Mar 22, 2024
@eps1lon eps1lon added Resolution: Support Redirect and removed Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug labels Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants