import type { LocaleFunction } from "@/hooks/use-localed";
import { type Locale } from "@/lib/locale";
import { t } from "@/locales";

export const createLocaleFunction = (locale: Locale) => {
  const fn = t.bind(undefined, locale) as LocaleFunction;
  Object.defineProperty(fn, "locale", {
    value: locale,
    writable: false,
    configurable: false,
  });
  return fn;
};
