export const supportedLanguages = [
  { code: 'en', name: 'English', nativeName: 'English' },
  { code: 'es', name: 'Spanish', nativeName: 'Español' },
  { code: 'fr', name: 'French', nativeName: 'Français' },
  { code: 'de', name: 'German', nativeName: 'Deutsch' },
  { code: 'zh', name: 'Chinese', nativeName: '中文' },
  { code: 'ja', name: 'Japanese', nativeName: '日本語' },
  { code: 'pt', name: 'Portuguese', nativeName: 'Português' },
  { code: 'ar', name: 'Arabic', nativeName: 'العربية' },
  { code: 'hi', name: 'Hindi', nativeName: 'हिन्दी' },
  { code: 'sw', name: 'Swahili', nativeName: 'Kiswahili' },
] as const;

export type LanguageCode = typeof supportedLanguages[number]['code'];

export const defaultLanguage: LanguageCode = 'en';

export function getLanguageName(code: LanguageCode): string {
  return supportedLanguages.find(lang => lang.code === code)?.name || 'English';
}

export function getNativeLanguageName(code: LanguageCode): string {
  return supportedLanguages.find(lang => lang.code === code)?.nativeName || 'English';
}

