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

Linked messages cannot support non-nested syntax #1719

Closed
4 tasks done
fuping685 opened this issue Jan 30, 2024 · 1 comment
Closed
4 tasks done

Linked messages cannot support non-nested syntax #1719

fuping685 opened this issue Jan 30, 2024 · 1 comment

Comments

@fuping685
Copy link

Reporting a bug?

It works fine when I use nested syntax

const messages = {
  en: {
    message: {
      hello: 'Hello',
      hello_link: '@:message.hello'
    }
  }
}

<div>{{ $t('message.hello_link') }}</div> // Hello

It shows nothing when I use non-nested syntax

const messages = {
  en: {
    'message.hello': 'Hello',
    'message.hello_link': '@:message.hello'
  }
}

<div>{{ $t('message.hello_link') }}</div> // Nothing is shown

Expected behavior

It works normally in version 8.x

Reproduction

N/A

System Info

N/A

Screenshot

No response

Additional context

No response

Validations

@fuping685 fuping685 added the Status: Review Needed Request for review comments label Jan 30, 2024
@kazupon kazupon added Type: Bug Bug or Bug fixes 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage and removed Status: Review Needed Request for review comments labels Feb 28, 2024 — with Volta.net
Copy link
Member

kazupon commented Feb 29, 2024

Thank you for your reporting!

when you use the key of object path, you need to put flatJson: true to createI18n.
Then vue-i18n will flatten the message.

Thanks!

@kazupon kazupon removed Type: Bug Bug or Bug fixes 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage labels Feb 29, 2024 — with Volta.net
@kazupon kazupon closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
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

No branches or pull requests

2 participants