Files
Wyatt JohnsonandGitHub e29bd49d87 i18n Improvements (#47174)
This serves to correct a specific issue related to multiple locales being specified in the pathname as well as some general i18n improvements.

- Multiple locales are now parsed correctly (only taking the first locale, treating the rest of the string as the pathname)
- `LocaleRouteNormalizer` has been split into `I18NProvider` and `LocaleRouteNormalizer` (tests added)
- Adjusted the `I18NProvider.analyze` method (previously `LocaleRouteNormalizer.match`) to require the `defaultLocale: string | undefined` to ensure consistent behaviour
- Added more comments around i18n
2023-03-17 18:48:09 +00:00

12 lines
223 B
React

import { useRouter } from 'next/router'
export default function Page() {
const router = useRouter()
return (
<div>
<p id="page">index page</p>
<p id="router-locale">{router.locale}</p>
</div>
)
}