Replies: 6 comments 6 replies
-
Thanks for such a great write-up! I would like to add a bit of context to better understand my reasoning. (Disclosure: I was part of the design team on @angular.io/localize, so my opinions may be skewed.) GLOSSARY:
REASONING:
How
NOTE: I am not saying that |
Beta Was this translation helpful? Give feedback.
-
Is coming: #11 |
Beta Was this translation helpful? Give feedback.
-
Qwik Speak v0.1.0 contains the Vite plugin for inlining translations at compile time. More info here The goal is to make it stable and make it grow even more. The extraction tool will arrive soon. |
Beta Was this translation helpful? Give feedback.
-
Inline and Extract tools are available! Inline features:
Extract features:
The library is about 8kB before tree shaking and minification, and the library and tools (that are apart) have no external dependencies. |
Beta Was this translation helpful? Give feedback.
-
To improve performance, the
PROS
See Qwik Speak Inline Vite plugin for more details. |
Beta Was this translation helpful? Give feedback.
-
From v0.17.0, the inlining of translations in js chunks occurs not only in prod mode but also in dev mode (in memory). So you can have the same app behavior in both dev and prod, and detect any problems immediately. |
Beta Was this translation helpful? Give feedback.
-
At the state of the art, this library implements i18n only at runtime: this means that the translations, even if lazy loaded for each page, are downloaded at runtime during the SSR or on the client, and the lookup also happens at runtime.
Translations can be inlined at build time only using a localized router and the SSG offered by Qwik City.
After having an exchange of views with Miško Hevery, the main requirements of Qwik's i18n should be the following:
Qwik requirements
Developers requirements
Customers requirements (not always, but recurrent)
Perhaps the list is not complete, but the main requirements should be clear: Qwik requires a compile-time solution that would inline the translated strings into the lazy loaded chunks that Qwik produces to avoid impact on the first loading time. At the same time, developers need in most cases runtime features to be compliant with the specifications or to satisfy customer requests.
This discussion aims to find the solution that satisfies the main requirements, which could be of any kind: a Vite plugin, or through middleware, or both, and create an integrated or alternative project to this with those interested.
Beta Was this translation helpful? Give feedback.
All reactions