Skip to content

Commit

Permalink
general: fix LangSwitcher when on /en/xy url (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
zbycz authored Feb 6, 2025
1 parent 0ee087b commit a7fb906
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/intl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ export const Translation = ({ id, values, tags }: Props) => {
export const changeLang = (langId: string) => {
if (langId === intl.lang) return;
Cookies.set('lang', langId, { expires: 365, path: '/' });
Router.reload();
Router.push(Router.asPath, Router.asPath, { locale: 'default' }).then(() =>
Router.reload(),
);
};

export const setIntl = (initialIntl: Intl) => {
Expand Down

0 comments on commit a7fb906

Please sign in to comment.