Single File Components i18n Support
See original GitHub issueEdit: 2019-07-29
Experimental support for SFC is landed in v0.29.0, please check out the release note for more details.
https://github.com/antfu/vue-i18n-ally/releases/tag/0.29.0
vue-i18n has a feature allow user to define their locale messages in the i18n
section of Single File Components(SFC)
Something like this:
<i18n>
{
"en": {
"hello": "helloworld!"
},
"ja": {
"hello": "こんにちは、世界"
}
}
</i18n>
<template>
<div class="parent">
<p>message: {{ $t('hello') }}</p>
</div>
</template>
Supporting SFC locales need a lot of work to the current code base. And I am not sure if it’s a good practice at all. So I opened this issue for make a survey about this feature usages.
If you are using SFC locales and would like to see it supported by this extension. Please upvote this comment 👍
Also, feel free to leave comments to discuss about this topic. Thanks. 😄
Issue Analytics
- State:
- Created 4 years ago
- Reactions:16
- Comments:18 (9 by maintainers)
Top Results From Across the Web
Single file components | Vue I18n - Intlify
If you are building Vue component or Vue application using single file components, you can manage the locale messages with using i18n custom ......
Read more >Single file components | Vue I18n
If you are building Vue component or Vue application using single file components, you can manage the locale messages i18n custom block.
Read more >Why using i18n sections in vue.js single file components is bad
Using vue.js single file components with sections for your translations? Learn why you should not do that and what alternatives there are.
Read more >How to add Internationalization to a Vue Single File ...
A complete guide on adding Internationalization (I18n) to a Single File Component (SFC) Vue App using vue-i18n.
Read more >Single File Components i18n Support · Issue #56 - GitHub
Supporting SFC locales need a lot of work to the current code base. And I am not sure if it's a good practice...
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
I don’t use them and never had to, I think it’s a bad practice to use them so maybe you should avoid all that work, but that’s my opinion 😛
FYI, from v0.36.0, we are now using vue-i18n-locale-message as the engine of SFC loader.
Benefits from @kazupon 's great work, we now support SFC editing, which means you can use full features (translating, refactoring, etc) for SFCs! 🎉