mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
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
12 lines
223 B
React
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>
|
|
)
|
|
}
|