Skip to content
Discussion options

You must be logged in to vote

After a lot of debugging I found a good way to do a check for this:

Use context.req.__nextStrippedLocale. It works on getServerSideProps and getInitialProps and it returns true if the current pathname is localized, otherwise it's undefined if there is no locale in the pathname.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Pustinyak
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants