dml_frontend/composables/useI18nPages.ts
2025-06-03 09:18:45 +02:00

34 lines
718 B
TypeScript

/* import { useI18n } from 'vue-i18n'
import { i18nPages } from '@/i18n/i18n-pages'
export function useI18nPages () {
const { locale } = useI18n()
const getRoute = (key: keyof typeof i18nPages) => {
const entry = i18nPages[key]
if (!entry) return ''
if ('paths' in entry) {
return entry.paths[locale.value]
}
return entry[locale.value]
}
const getProjectLink = (slug: string) => {
const path = getRoute('projekt___link')
return path.replace(':link', slug)
}
const getArticleLink = (slug: string) => {
const path = getRoute('artikel___link')
return path.replace(':link', slug)
}
return {
getRoute,
getProjectLink,
getArticleLink
}
}
*/