Skip to content

Commit f3117a0

Browse files
committed
Register $t & $tdate as globalProperties
1 parent 39ecc7d commit f3117a0

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

app/assets/components/NavBar.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
<script setup>
22
import { useRouter } from 'vue-router'
33
import { useAuthStore } from '@userfrosting/sprinkle-account/stores'
4-
import { useConfigStore, useTranslator } from '@userfrosting/sprinkle-core/stores'
4+
import { useConfigStore } from '@userfrosting/sprinkle-core/stores'
55
const router = useRouter()
66
const config = useConfigStore()
77
88
// Logout API variables
99
const auth = useAuthStore()
10-
11-
// Translator
12-
const { $t } = useTranslator()
1310
</script>
1411

1512
<template>

app/assets/views/AboutView.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<script setup lang="ts">
22
import { onMounted } from 'vue'
33
import { usePageMeta } from '@userfrosting/sprinkle-core/composables'
4-
import { useTranslator } from '@userfrosting/sprinkle-core/stores'
5-
const { $t } = useTranslator()
64
const page = usePageMeta()
75
86
// Hide the title on this page

app/assets/views/HomeView.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { useConfigStore, useTranslator } from '@userfrosting/sprinkle-core/store
66
77
const auth = useAuthStore()
88
const config = useConfigStore()
9-
const { $t, $tdate } = useTranslator()
9+
const { translate } = useTranslator()
1010
1111
const helloMsg = computed(() => {
12-
return $t('WELCOME_TO', {
12+
return translate('WELCOME_TO', {
1313
title: config.get('site.title'),
1414
user: auth.user?.full_name ?? '&GUEST'
1515
})

env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/// <reference types="vite/client" />
2+
/// <reference types="@userfrosting/sprinkle-core" />
23
/// <reference types="@userfrosting/theme-pink-cupcake/components" />
34
/**
45
* This is required for webpack to correctly import vue file when using TypeScript.

0 commit comments

Comments
 (0)