intlify / vue-i18n

Vue I18n for Vue 3
https://vue-i18n.intlify.dev/
MIT License
2.21k stars 337 forks source link

petite-vue-i18n does not support translation in this format #1962

Closed maxfrees closed 2 months ago

maxfrees commented 2 months ago

Reporting a bug?

baseTable:
  item: i
  total: to
  strip: str
  filterColumn: filter column

petite-vue-i18n does not support translation in this format

https://stackblitz.com/edit/vitejs-vite-xzgccz

Expected behavior

baseTable:
  item: i
  total: to
  strip: str
  filterColumn: filter column

petite-vue-i18n does not support translation in this format

Reproduction

baseTable:
  item: i
  total: to
  strip: str
  filterColumn: filter column

petite-vue-i18n does not support translation in this format

System Info

*

Screenshot

No response

Additional context

No response

Validations

github-actions[bot] commented 2 months ago

Thank you for your feadback! Would you be able to provide a reproduction ๐Ÿ™

More info ### Why do I need to provide a reproduction? Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making. ### What will happen? If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect. If `Status: Need More Info` labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it. ### How can I create a reproduction? We have a couple of templates for starting with a minimal reproduction: ๐Ÿ‘‰ [Reproduction mininal starter](https://stackblitz.com/edit/vitejs-vite-gfrx6w) ๐Ÿ‘‰ [Reproduction starter with unpluguin-vue-i18n](https://stackblitz.com/edit/vitejs-vite-jnecup) A public GitHub repository is also perfect. ๐Ÿ‘Œ Please ensure that the reproduction is as **minimal** as possible. You might also find these other articles interesting and/or helpful: - [The Importance of Reproductions](https://antfu.me/posts/why-reproductions-are-required) - [How to Generate a Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve)
maxfrees commented 2 months ago

@kazupon https://stackblitz.com/edit/vitejs-vite-xzgccz

kazupon commented 2 months ago

Thank you for your reproduction.

The locale messages of petite-vue-i18n is handled are simple key-value style

Docs said:

The only locale messages that can be handled are simple key-values. if you can handle hierarchical locale messages, you need to customize them using the API

https://vue-i18n.intlify.dev/guide/advanced/lite.html

The locale message of your app is object style hierarchy structure.

If you use hierarchy structure, you have to register resolveValue with registerMessageResolver @intlify/core-base https://vue-i18n.intlify.dev/guide/advanced/lite.html#use-the-same-message-resolver-and-locale-fallbacker-as-vue-i18n

Thanks!

maxfrees commented 2 months ago

Thank you for your reproduction.

The locale messages of petite-vue-i18n is handled are simple key-value style

Docs said:

The only locale messages that can be handled are simple key-values. if you can handle hierarchical locale messages, you need to customize them using the API

https://vue-i18n.intlify.dev/guide/advanced/lite.html

The locale message of your app is object style hierarchy structure.

If you use hierarchy structure, you have to register resolveValue with registerMessageResolver @intlify/core-base https://vue-i18n.intlify.dev/guide/advanced/lite.html#use-the-same-message-resolver-and-locale-fallbacker-as-vue-i18n

Thanks!

import {
  registerMessageResolver, // register the message resolver API
  resolveValue, // message resolver of vue-i18n which is used by default
  registerLocaleFallbacker, // register the locale fallbacker API
  fallbackWithLocaleChain locale fallbacker of vue-i18n which is used by default
} from '@intlify/core-base'

I also use this, but it doesnโ€™t work. Will the size be smaller than vue-i18n after adding @intlify/core-base?

kazupon commented 2 months ago

I also use this, but it doesnโ€™t work.

Please open as new issue with reproduction. ๐Ÿ™

Will the size be smaller than vue-i18n after adding @intlify/core-base?

Yes, it is smaller than vue-i18n.