`IntlService#lookup()` return value changed in v5
See original GitHub issueWe’re currently upgrading our app from v4 to v5 and I found that the return value of IntlService#lookup()
has changed.
It used to return the raw translation string, but now it returns an array like:
[{ type: 0, value: "Some translation" }]
Was this change intentional? I don’t think it is.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
How to return value from function which has Observable ...
A slimmer solution would be using RxJS' .toPromise() instead: function getValueFromObservable() { return this.store.pipe(take(1)) .toPromise() }.
Read more >about Return - PowerShell | Microsoft Learn
The return keyword exits a function, script, or script block. It can be used to exit a scope at a specific point, to...
Read more >Function return values - Learn web development | MDN
We are returning the result of the calculation Math.floor(Math.random() * number) each time the function is called. This return value appears at ...
Read more >Value methods | Think Java | Trinket
Some of the methods we have used, like the Math methods, return values. ... Start with a working program and make small, incremental...
Read more >Javanotes 9, Section 4.4 -- Return Values
For example, the function TextIO.getln(), with a return type of String, ... In the body of the function, it evaluates Math.sqrt(12.0*12.0 + 5.0*5.0), ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m so grateful for you still putting so much work into this great addon. 💖
I suggest we add a private (or public?)
lookupAST()
method and letlookup()
return the raw string again. Or what would you suggest?We should fix. It wasn’t intentional and thanks for bringing it to my attention.
The internal change was intentional for perf reasons but we should be able to keep it so the public
lookup
method returns the original string translation and not the AST object. Unfortunately, I unknowingly let this bleed into the public API.Some side context, I haven’t worked in Ember in a couple years now and am relying entirely on the Ember community to report these bugs as I no longer “dogfood” my own addons. Some things will slip through so I’m thankful to have every early adopter raise these issues ❤