component based translations
See original GitHub issueHej, I was wondering if somebody like component based translations would be possible. What i mean by this is that each component/page would add its own translation, this would keep the separation much cleaner. So each component would do
import english from './en.json'`
and in the component/page
created: function() {
this.$i18n.add('en', english)
}
I quickly tried this out now, but it seems when you add with the same key, they don’t get merged but overwritten.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Component based localization | Vue I18n
Therefore you can globally translate using $t or $tc in the root Vue instance and any composed component.
Read more >Component Level Localization with React and Bit
This article will guide you through the steps of creating component-level translations using React. We will also push the translatable UI ...
Read more >vue.js - Use component based translations in child ...
The component contains child components named c-child . Now, I would like to use the component based translations of c-parent also in c-child...
Read more >Angular i18n: Methodical Way to Lazy Load Component- ...
Here we are going to understand that real-world problem solution for component-based content translation in Angular.
Read more >A Component-Based Formal Language Workbench
The definition of the translation is validated empirically by using generated code to execute funcon terms. (manually-written unit tests, and translations of ...
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 Free
Top 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
There is a new release v1.7.0 that should enable the functionality you requested. We ended up modifying the
add
method to extend the translations and adding a new methodreplace
, that will replace all existing locale translations (just likeadd
did before).Please try it out and let me know if it works for you.
yeah, This is fine for my current needs. Would be worse if i would use rest or something to fetch the translations, then it would be a rest call each time.