-
Hi! The only difference I see is that some API available in Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
So if you want to use component specific messages or change the locale in one component without doing it for all, then you'll want to use the Footnote: |
Beta Was this translation helpful? Give feedback.
$t()
only uses messages and the locale from the global composer instance, whereast()
returned byuseI18n()
depends on the options passed touseI18n()
, so it can be either use the global composer instance or local/component specific composer instance.So if you want to use component specific messages or change the locale in one component without doing it for all, then you'll want to use the
useI18n()
approach. If you only use global stuff you can pick whichever style you like best.Footnote:
$t()
is injected through Vue'sapp.config.globalProperties
, which according to this vuejs/core#13360 won't be supported in vapor mode (vapor mode is unreleased so things may still change), so if you a…