Skip to content

Commit

Permalink
fix(survey): app header translation
Browse files Browse the repository at this point in the history
  • Loading branch information
lukashroch committed Nov 21, 2024
1 parent c40971d commit b6a4bc3
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions apps/survey/src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,12 @@
<script lang="ts">
import { mapState } from 'pinia';
import { computed, defineComponent, ref, watch } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { useLocale } from 'vuetify';
import { Navigation } from '@intake24/survey/components/layouts';
import { Navigation } from '@intake24/survey/components/layouts';
import { ConfirmDialog, Loader, MessageBox, ServiceWorker, useLanguage } from '@intake24/ui';
import { useHttp } from './services';
import { useApp, useAuth, useSurvey } from './stores';
Expand All @@ -209,31 +210,25 @@ export default defineComponent({
const http = useHttp();
const route = useRoute();
const vI18n = useLocale();
const { t } = useI18n();
useLanguage('survey', http, vI18n);
const appInfo = computed(() => useApp().app);
const sidebar = ref(false);
const appInfo = computed(() => useApp().app);
const legal = computed(() => ({
home: import.meta.env.VITE_LEGAL_HOME,
copyright: import.meta.env.VITE_LEGAL_COPYRIGHT,
privacy: import.meta.env.VITE_LEGAL_PRIVACY,
terms: import.meta.env.VITE_LEGAL_TERMS,
}));
const title = computed(() => {
if (route.meta?.title)
return vI18n.t(route.meta.title);
return vI18n.t('common._');
});
const title = computed(() => t(route.meta?.title ?? 'common._'));
const windowInnerHeight = computed(() => window.innerHeight);
watch(route, () => {
document.title = title.value;
});
const windowInnerHeight = computed(() => window.innerHeight);
return {
appInfo,
legal,
Expand Down

0 comments on commit b6a4bc3

Please sign in to comment.