export default defineEventHandler(async (event) => {
  const query = getQuery(event)
  const locale = query.locale || 'ru'

  // Cities data with translations
  const locationsData = {
    ru: [
      { name: 'Moscow', region: 'Central Federal District', distance: '0 km', coords: [55.76, 37.64] },
      { name: 'St. Petersburg', region: 'Northwestern Federal District', distance: '635 km', coords: [59.93, 30.34] },
      { name: 'Novosibirsk', region: 'Siberian Federal District', distance: '3354 km', coords: [55.03, 82.92] },
      { name: 'Yekaterinburg', region: 'Ural Federal District', distance: '1416 km', coords: [56.84, 60.65] },
      { name: 'Kazan', region: 'Volga Federal District', distance: '719 km', coords: [55.83, 49.09] },
      { name: 'Nizhny Novgorod', region: 'Volga Federal District', distance: '411 km', coords: [56.33, 44.00] },
      { name: 'Chelyabinsk', region: 'Ural Federal District', distance: '1777 km', coords: [55.16, 61.43] },
      { name: 'Samara', region: 'Volga Federal District', distance: '862 km', coords: [53.20, 50.15] },
      { name: 'Omsk', region: 'Siberian Federal District', distance: '2555 km', coords: [54.97, 73.37] },
      { name: 'Rostov-on-Don', region: 'Southern Federal District', distance: '925 km', coords: [47.23, 39.72] }
    ],
    en: [
      { name: 'Moscow', region: 'Central Federal District', distance: '0 km', coords: [55.76, 37.64] },
      { name: 'St. Petersburg', region: 'Northwestern Federal District', distance: '635 km', coords: [59.93, 30.34] },
      { name: 'Novosibirsk', region: 'Siberian Federal District', distance: '3354 km', coords: [55.03, 82.92] },
      { name: 'Yekaterinburg', region: 'Ural Federal District', distance: '1416 km', coords: [56.84, 60.65] },
      { name: 'Kazan', region: 'Volga Federal District', distance: '719 km', coords: [55.83, 49.09] },
      { name: 'Nizhny Novgorod', region: 'Volga Federal District', distance: '411 km', coords: [56.33, 44.00] },
      { name: 'Chelyabinsk', region: 'Ural Federal District', distance: '1777 km', coords: [55.16, 61.43] },
      { name: 'Samara', region: 'Volga Federal District', distance: '862 km', coords: [53.20, 50.15] },
      { name: 'Omsk', region: 'Siberian Federal District', distance: '2555 km', coords: [54.97, 73.37] },
      { name: 'Rostov-on-Don', region: 'Southern Federal District', distance: '925 km', coords: [47.23, 39.72] }
    ]
  }

  return locationsData[locale as 'ru' | 'en'] || locationsData.ru
})
