export default function useLanguage(selectLanguage = 'vi') {
  const data = import.meta.glob('@lang/*.json', {
    import: 'default',
    eager: true,
  })

  const imp = {}

  for (const path in data) {
    const keypath = path.match(/\/[a-zA-Z]+\./)[0].replace(/\/(\w+)\./, '$1')
    imp[keypath] = data[path]
  }

  return imp[selectLanguage]
}
