- Go to
/account/profile and change your language to Portuguese.
- Then navigate away from the page.
- Notice that the "locale" in the URL goes back to "en-US"
This is because all calls to routePath in the pages need to include the locale, otherwise the routePath function just inserts the default en-US.
We can do this by use importing {useLocale} from 'next-intl' in our components, and initiating it with const currentLocale = useLocale() and pass in the currentLocale to the routePath