Home

Issue: 2354

How to get access to i18 plugin from context

[issue link]

So I have some asyncData logic, now i need to get access to i18 $t method in it, how to do that?

... page component
    asyncData ({ store, redirect, t }) {
      const user = store.getters.loggedUser
      if (!user.userProfile) {
        redirect(path.route.profile)
        store.commit('EMIT_TOAST', {
          timeout: 3000,
          type: 'error',
          message: t('toasts.results_disabled')
        })
      }
    },
This question is available on Nuxt.js community (#c2050)