Add support for vue-i18n single-file components #1775
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! I'm in a project where we use
vue-i18n
for localization. In particular, we're taking advantage of the single-file feature where you can include a<i18n>
tag in a particular component rather than using global localization sheets. Typically, with webpack, you would usevue-i18n-loader
, as documented here, to inject the<i18n></i18n>
tags into the Vue component.After digging into the
vue-i18n
package a bit, it seems like it's able to detect the existence of an__i18n
option on the component and automatically load the injected content, which is whatvue-i18n-loader
is doing. I figured since there isn't even a dependency problem, this could be implemented relatively easily into parcel as well.Let me know if there's anything else that's needed or if this isn't the right place to discuss things. Thanks!