Skip to content

Commit

Permalink
feat: language change to right chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
bodobraegger committed Jul 13, 2024
1 parent ff86d0d commit 7a86694
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/i18n/LanguageChanger.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect } from 'react';
import { useNavigate, useLocation } from 'react-router';
import i18n from 'i18next';
import { slugify } from 'modern-diacritics';



Expand Down Expand Up @@ -36,7 +37,7 @@ export const useLanguageChangeHandler = () => {
if (newSections && localizedSection) {
const newCurrentSection = newSections.find((s: any) => { return s['sorting'] === localizedSection['sorting'] })
if (newCurrentSection) {
navigate('/' + newCurrentSection.slug)
navigate('/' + slugify(newCurrentSection.title))
return;
}
}
Expand Down

0 comments on commit 7a86694

Please sign in to comment.