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

_ctx.t is not a function error #212

Closed
5 tasks done
kazupon opened this issue Jun 4, 2024 · 0 comments
Closed
5 tasks done

_ctx.t is not a function error #212

kazupon opened this issue Jun 4, 2024 · 0 comments
Labels
bug Includes new features

Comments

@kazupon
Copy link
Member

kazupon commented Jun 4, 2024

Describe the bug

The following error occurs when t exported with useI18n is used as an alias:

<script>
import { useI18n } from 'vue-i18n'

export default {
    setup() {
      const { t: translation } = useI18n({
        locale: 'en',
        inheritLocale: false,
        messages: {
          en: {
            apple: 'no apples | one apple | {count} apples',
            banana: 'no bananas | {n} banana | {n} bananas',
            dessert: 'I eat @:{name}!'
          }
        }
      })
      return { translation }
    },
}
</script>

Reproduction

dd1273b

System Info

System:
    OS: macOS 13.6.6
    CPU: (10) arm64 Apple M1 Max
    Memory: 156.13 MB / 64.00 GB
    Shell: 5.9 - /bin/zsh

Used Package Manager

n/a

Additional context

not work for <script setup> , because, v-t does not transform for $setup.

you can see the SSR tab in vue playground
https://play.vuejs.org/#eNq9U11r2zAU/SuaGDiB2F6aPYyQlH1QWPewjXWwF784zrWjVpaEPtKA8X/flRQnbgkdYzD7wda9R+ceHft09INS2d4BXdKVqTRTlhiwTl0XgrVKaks6oqEmPam1bEmC0GTUcgZu5+/EuJ0yLCCmEJUUxpLWNGTtOSbJZ+Bckl9S8+2rZDoAOmJx/3rgmnSFIH5xV0kFS5JwWZUcCXvcscqjSJSHCwut4qUFXBGy2s2vuy6M6/tVjqtYvfJVO0lqqdNABanxzMmURODVEbjwwNdHZMPlpuQDMuAWEceEcpbsU7suKA4rKMmxscpHYuiMRofStlTZvZEC7Q3HKo4NU9AlCRVfG1zzxYLurFVmmedOqIcmq2SbD/338zcZ3ukGbJnN8y0z9tTLtBOWtZCBadONlo8GNI4uqB/So3soyuJxRM2aZ5JwhGIc9DdlGX6RJ9JK/GKPX0LNagezoV7toHq4UL83h3iK7xpQwR4KeurZUjdgY/vm7isc8P3UbOXWcUS/0PwBRnLnNUbYRye2KHuEC2pvg8NMND/NzcGCMMOhvNDgRsAH2z+9cPSz3EX2duSi3/M0Ms/CMiNbqJkI5FKA8L/336cHDgGFVKXj4TmmjCkJUZ1MB81/DNwZdDF0/roQPF/24YtvGmdq4Ql0KQz+8WgcejuLyRt8+pesnnn/b2r730MJq/4=

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@kazupon kazupon added status: review needed Request for review bug Includes new features and removed status: review needed Request for review labels Jun 4, 2024
@kazupon kazupon closed this as completed Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Includes new features
Projects
None yet
Development

No branches or pull requests

1 participant