Comments (8)
I'm confused. Are you trying to specify messages in ICU AST form?
type: 1
is argument, your value
is just a string
from formatjs.
I'm confused. Are you trying to specify messages in ICU AST form?
type: 1
is argument, yourvalue
is just a string
What is this ICU AST form you are talking about? Can you please provide a documentation? Type 0 is working, type 1 not. You can see it in my codepen example
from formatjs.
https://formatjs.io/docs/react-intl/components#intlprovider
you wanna pass in Record<string, string>
to messages
in your Provider
from formatjs.
https://formatjs.io/docs/react-intl/components#intlprovider
you wanna pass in
Record<string, string>
tomessages
in your Provider
Thank you but I mean the documentation for this type: 0 and type: 1 thing. Have you checked my codesandbox? If not, please see my codesandbox. There you can see that type: 0 is working but type: 1 is not.
Why is that? Can you provide a documentation for that?
from formatjs.
The payload form you're passing in is a list of MessageFormatElement chunks. Type 0 is a literal chunk. Type 1 is a argument chunks but those are implementation details.
You should pass in strings instead of passing in map of string to array. Where in the documentation do you get that param shape?
from formatjs.
The payload form you're passing in is a list of MessageFormatElement chunks. Type 0 is a literal chunk. Type 1 is a argument chunks but those are implementation details. You should pass in strings instead of passing in map of string to array. Where in the documentation do you get that param shape?
Okay I see.. so this is officially not recommended and never was or is that some kind of legacy thing how it was used to be used?
I'm working on legacy code and all the translation were like that passing arrays of objects with that type and value keys :(
from formatjs.
Those have never been supported AFAIK. The array form is our internal AST format which isn't technically public.
from formatjs.
Ok, then nevermind and thanka a lot for the clarification. This issue can be closed then
from formatjs.
Related Issues (20)
- @formatjs/intl-messageformat, 10.5.0: Plural rules aren't applied correctly HOT 2
- @formatjs/intl-numberformat/polyfill: roundingIncrement seems to be a no-op HOT 3
- [docs] Rich Text Formatting example doesn't work HOT 2
- Polyfill.io has been sold to a weird Chinese company and should no longer be recommended HOT 1
- chore: update tzdata to 2024a
- INVALID_TAG when parsing regular HTML tag with attribute HOT 1
- Can't catch error HOT 1
- Feature request: allow units greater than `day` in `FormattedRelativeTime` with `updateIntervalInSeconds` to be picked HOT 2
- It's incredibly slow on lower end Android devices HOT 2
- Intl.Segmenter: isWordLike does not match Node.js and browsers HOT 5
- @formatjs/intl-locale/polyfill-force TypeError: Error uninitialized locale at Locale2.getWeekInfo HOT 7
- Extract does not work on vue template since vue 3.4.0 HOT 1
- eslint-plugin-formatjs doesn't check `this.intl.formatMessage(...)` usages HOT 1
- `LocaleMatcher` doesn't work on propietary tags HOT 2
- Node 20.12.1 x Jest; shouldPolyfill results in RangeError. Incorrect locale information provided HOT 1
- eslint-plugin-formatjs and eslint v9 support HOT 5
- Website - search is broken
- @formatjs/intl-localematcher documentation is wrong... incorrect order HOT 1
- @formatjs/swc-plugin-experimental incompatible with latest SWC core version HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formatjs.