Skip to content

TaskView is a self-hosted project and task management platform focused on clarity, ownership, and control. TaskView is built for teams that want a transparent, self-hosted alternative to SaaS task managers.

367 B
Raw Blame
import { useI18n } from 'vue-i18n'
import type { LocalizedText } from 'taskview-api'

export function useAnalyticsLocale() {
  const { locale } = useI18n()

  function pick(text: LocalizedText | undefined): string {
    if (!text) return ''
    const loc = locale.value as keyof LocalizedText
    return text[loc] ?? text.en ?? text.ru ?? ''
  }

  return { pick }
}