Merge branch 'main' of github.com:calendso/calendso
This commit is contained in:
commit
d3d6778c60
2 changed files with 4 additions and 5 deletions
|
@ -16,4 +16,4 @@ const PoweredByCalendso = () => (
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
export default PoweredByCalendso;
|
export default PoweredByCalendso;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { useTranslation } from "next-i18next";
|
import { useTranslation } from "next-i18next";
|
||||||
import { useEffect } from "react";
|
|
||||||
|
|
||||||
type LocaleProps = {
|
type LocaleProps = {
|
||||||
localeProp: string;
|
localeProp: string;
|
||||||
|
@ -8,9 +7,9 @@ type LocaleProps = {
|
||||||
export const useLocale = (props: LocaleProps) => {
|
export const useLocale = (props: LocaleProps) => {
|
||||||
const { i18n, t } = useTranslation("common");
|
const { i18n, t } = useTranslation("common");
|
||||||
|
|
||||||
useEffect(() => {
|
if (i18n.language !== props.localeProp) {
|
||||||
(async () => await i18n.changeLanguage(props.localeProp))();
|
i18n.changeLanguage(props.localeProp);
|
||||||
}, [i18n, props.localeProp]);
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
i18n,
|
i18n,
|
||||||
|
|
Loading…
Reference in a new issue