-
Notifications
You must be signed in to change notification settings - Fork 27.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose i18n data in DocumentContext #18667
Comments
@IskanderMustafin current locale already available as prop in document, check |
@dmitrykozyrenko thanks a lot, it works! |
I would like to #18329 as a reference for more examples. Would you consider reviewing a PR adding |
Closing as this was updated in #21930 which is available in the latest version of Next.js |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Feature request
I'm creating this feature request in continuation of this discussion for easier tracking and in order not to forget.
Right now I18n feature automatically adds
lang
attribute to the<html>
tag.It's cool but there more cases when current
locale
can be handy inDocumentContext
.In discussion mentioned above people have different reasons why they need it, but in my concrete case I need to do following:
direction
based on current locale. And add it asdir
attribute to the<html>
tag;As fow now I'm using a bit hacky and less idiomatic way of setting direction in
_app.tsx
:Describe the solution you'd like
Please provide
locale
,defaultLocale
andlocales
properties inDocumentContext
. I.e. in same way as it done inGetServerSidePropsContext
andGetStaticPropsContext
.The text was updated successfully, but these errors were encountered: