export default function ({route, redirect, error}) {
  ///////////// redirect to default local
  if (route.path === '/') return redirect('/fa')
  ///////////// local check
  const lang = ['fa', 'en']
  const isLocal = lang.includes(route.params.lang)
  const isAdmin = route.path.includes('/admin')

  if (isLocal || isAdmin) return null
  else error({statusCode: 404, message: 'Page Not Found'})
}
