import { useContext } from "react";
import { LocalizationContext } from "~/context/localization";
import type { LocalizationContextType } from "~/context/localization";

export default function useLocalization(): LocalizationContextType {
  const { localization, currentLocale, setCurrentLocale } =
    useContext(LocalizationContext);
  return {
    localization,
    currentLocale,
    setCurrentLocale,
  };
}
