#Missing documentation for `rt` in i18n

3 messages · Page 1 of 1 (latest)

mighty kindle
#

In the i18n vue docs https://vue-i18n.intlify.dev/api/composition#tm-key it uses rt in under the info for tm(key). There is a link to rt where it says in the docs "You need to use rt for the locale message returned by tm. see the rt details." but the link to that section of the docs doesn't exist (it tries to navigate to https://vue-i18n.intlify.dev/api/composition.html#rt-message). Trying to use rt I'm getting a "TypeError: Cannot convert object to primitive value" in one component (elsewher I am using it is fine but in this component which re-renders it leads to an error).

shell kettleBOT
#

Hi @mighty kindle. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

I’m sorry, but the provided knowledge sources don’t mention vue-i18n’s rt helper, nor do they document its usage or the tm/rt interaction beyond basic i18n setup and common Nuxt i18n patterns. I can’t confirm why that docs link is broken or how rt should be used from these sources.

What the sources do cover:

Given the lack of info on rt in the sources, a few suggestions within scope:

  • Ensure you’re on a compatible vue-i18n version and that your Nuxt i18n is wired through vueI18n: './i18n.config.ts'. [i18n not working].
  • If tm returns an object and rt is intended to render it, but it throws “Cannot convert object to primitive value” on re-render, consider guarding the value before rendering, or converting to a string only where appropriate. However, I don’t have a source-backed example for rt usage to share.

If you can share a minimal snippet of the failing component, I can try to map it to the documented t/tm patterns from the sources and suggest a workaround without rt.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: