calcom/lib/hooks/useLocale.ts
Omar López cfd70172f0
Refactors useLocale (#908)
* Removes unused component

* Refactors useLocale

We don't need to pass the locale prop everywhere

* Fixes syntax error

* Adds warning for missing localeProps

* Simplify i18n utils

* Update components/I18nLanguageHandler.tsx

Co-authored-by: Mihai C <34626017+mihaic195@users.noreply.github.com>

* Type fixes

Co-authored-by: Mihai C <34626017+mihaic195@users.noreply.github.com>
2021-10-12 13:11:33 +00:00

10 lines
166 B
TypeScript

import { useTranslation } from "next-i18next";
export const useLocale = () => {
const { i18n, t } = useTranslation("common");
return {
i18n,
t,
};
};