Merge branch 'main' of github.com:calendso/calendso

pull/761/head
Peer Richelsen 2021-09-23 23:53:04 +01:00
commit d3d6778c60
2 changed files with 4 additions and 5 deletions

View File

@ -16,4 +16,4 @@ const PoweredByCalendso = () => (
</div>
);
export default PoweredByCalendso;
export default PoweredByCalendso;

View File

@ -1,5 +1,4 @@
import { useTranslation } from "next-i18next";
import { useEffect } from "react";
type LocaleProps = {
localeProp: string;
@ -8,9 +7,9 @@ type LocaleProps = {
export const useLocale = (props: LocaleProps) => {
const { i18n, t } = useTranslation("common");
useEffect(() => {
(async () => await i18n.changeLanguage(props.localeProp))();
}, [i18n, props.localeProp]);
if (i18n.language !== props.localeProp) {
i18n.changeLanguage(props.localeProp);
}
return {
i18n,