question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Single File Components i18n Support

See original GitHub issue

Edit: 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:closed
  • Created 4 years ago
  • Reactions:16
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

9reactions
JJBocanegracommented, Jul 16, 2019

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 😛

2reactions
antfucommented, Nov 19, 2019

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! 🎉

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found