nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.71k stars 478 forks source link

hi, I am learning nuxt+i18n, but I encountered a problem when using t in step #2940

Closed zjluse closed 3 months ago

zjluse commented 5 months ago

Environment

see here: https://codesandbox.io/p/github/zjluse/nuxt3-i18n-demo/main?workspaceId=8e4ff903-42a7-414f-a4d0-eae55a1e012d

Reproduction

see here: https://codesandbox.io/p/github/zjluse/nuxt3-i18n-demo/main?workspaceId=8e4ff903-42a7-414f-a4d0-eae55a1e012d

Describe the bug

I want to use t in the setup function to set the language so that I can toast or dynamically load text, but setLocale does not take effect.

Additional context

No response

Logs

No response

zjluse commented 5 months ago

The computed attribute is valid, but it is not suitable for use in some scenarios

const text = computed(() => {
  return t("welcome");
});
BobbieGoede commented 5 months ago

I'm not sure what the issue is and I'm unable to access your reproduction, perhaps it's not public?

kazupon commented 3 months ago

Closing due to inactivity. Please open a new issue with a reference to this one if you can follow up with more information.

Thanks!