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
Correct, intl-get returns an object with a property translation and locale, where the translation derived from. This is to tell the downstream format-message which locale to pass through to the format functions.
What is the use case for using intl-get within your templates outside of format-message/format-html-message? I can make this backwards compat. by overriding toString, but I wasn't aware of people using the helper outside the context of subexpression :)
We'd discovered that intl-get "worked" without using format-message. It wasn't clear that you "had" to use format-message. The docs didn't really say. Now they do, but it's still not quite clear. Here's the line that mentions it, but the wording of the line doesn't make it as obvious as I think it could: "Will return the message from the current locale, or locale explicitly passed as an argument, message object."
So, it looks like we were using it in an unexpected way, and we just need to do it the correct way with format-message.
We were using intl-get in templates like so:
and it would return the message string.
It appears that this no longer works and intl-get returns an object. We now have to change all our code from above to something like this:
Was the first example above an intended use of intl-get? Or was it always supposed to be used with format-message?
The text was updated successfully, but these errors were encountered: