Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

managed localize resource with lang attribute #11

Closed
kazupon opened this issue Nov 2, 2017 · 2 comments · Fixed by GrabarzUndPartner/gp-vue-boilerplate#219
Closed

Comments

@kazupon
Copy link
Member

kazupon commented Nov 2, 2017

related from kazupon/vue-i18n#249

e.g.

// someFile.vue
<template>
  ...
</template>

<i18n lang="zh-CN" src='./zh-CN.json'></i18n>
<i18n lang="zh-TW" src='./zh-TW.json'></i18n>
<i18n lang="en" src='./en.json'></i18n>

<script>
export default {
  ...
}
</script>
@kazupon kazupon added the Type: Feature Includes new features label Feb 15, 2018
@kazupon kazupon added feature request and removed Type: Feature Includes new features labels Jul 4, 2019
@kazupon kazupon added this to To do in OSS Focus1 Jul 9, 2019
@kazupon kazupon moved this from To do to In progress in OSS Focus1 Jul 10, 2019
@kazupon kazupon moved this from In progress to To do in OSS Focus1 Jul 10, 2019
@kazupon kazupon moved this from To do to In progress in OSS Focus1 Jul 10, 2019
@kazupon kazupon moved this from In progress to Done in OSS Focus1 Jul 19, 2019
@antfu
Copy link
Member

antfu commented Jul 19, 2019

@kazupon Hi! I would think this approach is kind of confusing from the original vue sfc. lang attr is to specify the preprocessor programming language in template script and style. I would suggest to use another attr name instead of lang and leave lang for specify the locale preprocessor.

For example:

// someFile.vue
<template>
  ...
</template>

<i18n locale="zh-CN" src='./zh-CN.json'></i18n>
<i18n locale="zh-TW" lang='json5' src='./zh-TW.json5'></i18n>
<i18n locale="en" lang='yaml' src='./en.yaml'></i18n>

@kazupon
Copy link
Member Author

kazupon commented Jul 19, 2019

@antfu
Thank you for feedback!

It's no problem. 😉
I've implemented with locale attr.
https://github.com/kazupon/vue-i18n-loader/blob/dev/src/index.ts#L31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants