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
Hi! I've used formatjs in a project that was set up by someone else before, and now I'm looking to add it to a new project. Right now it's just node.js (typescript) backend. We want to format templated emails. We have some English and Spanish content coming from a CMS in the format
{en: {subject: 'Hello',body: 'Hello {name}, how are you?'},es: {subject: 'Hola',body: 'Hola {name}, ¿cómo estás?'},}
We'd like to use the subset of formatjs features that will let us do something like format(email[locale].body, 'Alice') in order to get Hello Alice, how are you?.
Here's what I did:
Google formatjs because I remembered it existed
Got to https://formatjs.io/ which showed an example of Annie took no photos on January 6, 2022.. Seems promising
Click on Get started, which took me to the basic principles page. This is confusing:
I understand the basic principles, I want to get started!
I'm now on the third of three sections in the left sidebar. The first is called Getting Started - shouldn't I have been sent there?
Click on Getting Started on the left sidebar.
I'm now on Getting Started -> Installation, which seems promising again. It tells me to npm install react-intl. I'm not using react though??
At some point I ended up on the intl-messageformat docs which include a code example const msg = new IntlMessageFormat(message, locales, [formats], [opts]) but it doesn't say what to install, or where to import IntlMessageFormat from. There's an npm link which points you straight back to the same page.
I should say, this isn't a huge problem because I did figure it out in the end. The @formatjs/intl page was what I wanted (I think - although seems like intl-messageformat might also work for me?). Maybe the Get Started button on the homepage should point to @formatjs/intl instead? Or to a landing page with links to docs for react-intl, @formatjs/intl, Core concepts and so on, since each user has a slightly different use case.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi! I've used formatjs in a project that was set up by someone else before, and now I'm looking to add it to a new project. Right now it's just node.js (typescript) backend. We want to format templated emails. We have some English and Spanish content coming from a CMS in the format
We'd like to use the subset of formatjs features that will let us do something like
format(email[locale].body, 'Alice')
in order to getHello Alice, how are you?
.Here's what I did:
Annie took no photos on January 6, 2022.
. Seems promisingGet started
, which took me to the basic principles page. This is confusing:Getting Started
- shouldn't I have been sent there?Getting Started
on the left sidebar.Getting Started
->Installation
, which seems promising again. It tells me tonpm install react-intl
. I'm not using react though??const msg = new IntlMessageFormat(message, locales, [formats], [opts])
but it doesn't say what to install, or where to importIntlMessageFormat
from. There's an npm link which points you straight back to the same page.I should say, this isn't a huge problem because I did figure it out in the end. The @formatjs/intl page was what I wanted (I think - although seems like
intl-messageformat
might also work for me?). Maybe theGet Started
button on the homepage should point to @formatjs/intl instead? Or to a landing page with links to docs forreact-intl
,@formatjs/intl
,Core concepts
and so on, since each user has a slightly different use case.Beta Was this translation helpful? Give feedback.
All reactions