import { computed } from 'vue'

export const langs = computed(() =>
  String(import.meta.env.VITE_LANGS).split(','),
)

export const langLabel = {
  zh: '中文',
  en: 'English',
}
export function initTranslations(object, keys) {
  object.translations = langs.value.map((lang) => {
    const mapper = {}
    if (keys && Array.isArray(keys)) {
      mapper.locale = lang
      keys.forEach((key) => {
        mapper[key] = ''
      })
    }
    return mapper
  })
  return object
}
