From cad8f3e85699772708d93ab61150b78bcfd1c6e0 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Fri, 19 Nov 2021 21:04:08 +0530 Subject: [PATCH] refactor: add i18n composable --- packages/hoppscotch-app/helpers/utils/composables.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/hoppscotch-app/helpers/utils/composables.ts b/packages/hoppscotch-app/helpers/utils/composables.ts index d2aed799d..1bd14c7ba 100644 --- a/packages/hoppscotch-app/helpers/utils/composables.ts +++ b/packages/hoppscotch-app/helpers/utils/composables.ts @@ -5,6 +5,7 @@ import { readonly, Ref, ref, + useContext, watch, wrapProperty, } from "@nuxtjs/composition-api" @@ -132,3 +133,10 @@ export function useStreamSubscriber() { subscribeToStream: runAndSubscribe, } } + +export function useI18n() { + const { + app: { i18n }, + } = useContext() + return i18n.t.bind(i18n) +}