Persist language as the user navigates #350
niculistana
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed while reviewing #268 that whenever the user toggles from English->HIL the app does persist the selected language. This could lead confusion for the user as they navigate from page-to-page.
Solution:
Pass translation code as a route param while the user is navigating from ENG (no-param) to HIL (?languageCode=hil)
To do so we would need to extend the
Linkcomponent by wrapping it into a parent component which persists thelanguageCodeparam:Then from one page to another:
import { Jump } from './components/link/jump'; // automatically pulls languageCode from params - return <Link to="/flood-control"/> + return <Jump to="/flood-control"/>Docs:
useSearchParams Reference: https://reactrouter.com/api/hooks/useSearchParams
Beta Was this translation helpful? Give feedback.
All reactions