import { Languages } from 'src/constants/languages';
import { MeUser } from 'src/types/user';

export const getTranslationLanguage = (user: MeUser) => {
  // Priority:
  // 1. User language
  // 2. Browser language
  // 4. Default language

  if (user?.language) return user.language;

  if (navigator?.language) return navigator.language;

  return Languages.SPANISH;
};
