Replies: 3 comments 4 replies
-
Hi @s4m0r4m4, looking at the article above, it looks like everything that is done in this article can also work in Transloco, saying that you must also know the disadvantage of using this method... When you import the translation files the way it demonstrated in this article you actually load the translation files eagerly into your bundle which is the main reason why we don't think that's a good practice. Using this option or not is up to you. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply, much appreciated! |
Beta Was this translation helpful? Give feedback.
-
Not sure if you want to close this or document it or whatever, your call. I still maintain this is an important feature for long-term maintenance of translation files and their usage, but the architecture would be quite different and probably not something transloco would like to pursue (I managed to build out my own typescript-based lazy loading file architecture, but it would likely result in large changes to transloco). I'm ok if you'd like to close this. |
Beta Was this translation helpful? Give feedback.
-
I'm submitting a...
Current behavior
When developing an application, the user has no direct/immediate insight into what keys are available. The Key Manager is certainly helpful for this, but I think there is possibly a better path.
Expected behavior
There was an article a while back that provided an interesting solution for providing languages from TypeScript objects instead, which enabled simple autocomplete in any typescript-supporting editor. I was especially blown away by the functionality presented in a gif at the end of the article.
I'm wondering if this would be doable for transloco as well. The hooks seem to be there (modifying the loader, providing a wrapper service), but I wanted to start the discussion to see if there was interest in this and, if so, to gather any pointers you may have if I am to try and develop it.
One concern I have is over breaking other transloco ecosystem tools. I know I can provide my own TranslocoLoader implementation, but my understanding is that that is only used for the application itself, not tooling (like the key manager or others). So I'm a little concerned that if I were to go down this route I would put myself in a place where none of the other tooling works.
Minimal reproduction of the problem with instructions
n/a
What is the motivation / use case for changing the behavior?
I believe this would significantly enhance the usability of transloco and set it miles above existing i18n packages out there. In the world of C#, this would be akin to resources files (.resx) that are automatically generated from XML and provide static classes with keys that are easily accessible in an editor.
Environment
Beta Was this translation helpful? Give feedback.
All reactions