Allow defaults to be lazy
See original GitHub issueI like to do nested lookup, currently I do this:
i18n._({
id: "resource.user.fields.username.label",
defaults: i18n._({id: "fields.username.label",defaults: "Username"})
})
But this always resolves the default, I like this to be lazy:
i18n._({
id: "resource.user.fields.username.label",
defaults: i18n => i18n._({id: "fields.username.label",defaults:"Username"})
})
Thoughts ? (I think it’s relatively easy to implement)
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Why do I default to laziness? - Quora
Everyone tends to default to laziness. The first thing that differentiates the "active" ones from the "lazy" ones is the realisation that they're...
Read more >How can I set the default behavior of lazy init in Spring Boot?
I want to set the that for default all beans are lazy loaded. I know that I can add the @Lazy to all...
Read more >Lazy Initialization in Spring Boot 2.2 - Baeldung
By default in Spring, all the defined beans, and their dependencies, are created when the application context is created.
Read more >React.lazy without a default export - DEV Community
The React.lazy function lets you render a dynamic import as a regular component. Before: import OtherComponent from '.
Read more >Enable lazy-load by default for responsive images - Drupal
Problem/Motivation In [#3167034], we added the basic pattern of how to add lazy loading for images to drupal. Let's continue that into ...
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
There’s already open issue for it #342. It might be easy to do by exporting compiler in subpackage as described here: https://github.com/lingui/js-lingui/issues/342#issuecomment-424687026. There’re might be few problems to solve, because
lingui compile
does few more things on top of compiling messages, as described at the end of this comment.That’s why I said a
create compiler
macro, which would generate acompiler.js
(like the compiled catalogs) which contains the pluralize methods for the selected locales. This would allow the compiler to be small and support the required locales. But that’s just an idea.