Skip to content
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

[docs] Don't redirect on deploy preview #32399

Merged
merged 1 commit into from
Apr 27, 2022

Conversation

m4theushw
Copy link
Member

@m4theushw m4theushw commented Apr 20, 2022

Preview with the fix: https://deploy-preview-32399--material-ui.netlify.app/material-ui/getting-started/installation/

Preview to test the bug: https://deploy-preview-32458--material-ui.netlify.app/material-ui/getting-started/installation/

My cellphone is in Portuguese. When I open any deploy preview, it tries to redirect me to the translated page, but only the English language is included in the preview, so I see a 404 page. This PR disables the redirect for previews. To test the fix, you can add the Portuguese language to a browser and open the link above. In this PR it won't redirect, but with any other preview it should display a 404 error. Once approved I'll also fix this in MUI X.

@mui-bot
Copy link

mui-bot commented Apr 20, 2022

No bundle size changes

Generated by 🚫 dangerJS against a1e4808

@m4theushw m4theushw marked this pull request as ready for review April 20, 2022 23:10
@m4theushw m4theushw added the docs Improvements or additions to the documentation label Apr 20, 2022
Copy link
Contributor

@danilo-leal danilo-leal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woof... this always bothered me too!
Kinda glad you got bothered enough to fix it 😅 Nice one!

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Glad we have this fix.

@siriwatknp siriwatknp merged commit e210677 into mui:master Apr 27, 2022
@m4theushw m4theushw deleted the dont-redirect-on-deploy-preview branch May 10, 2022 02:36
@@ -55,7 +55,7 @@ function LanguageNegotiation() {
acceptLanguage.get(navigator.language) ||
userLanguage;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we redirect to translated page if navigator language is not English though?
Given that content is not translated, I would argue that we should only redirect if user explicitly selected different language

const preferedLanguage =
  LANGUAGES.find((lang) => lang === getCookie('userLanguage')) ||
- acceptLanguage.get(navigator.language) ||
  userLanguage;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pages for the data grid are not translated, but the pages for the core components are. Speaking about Portuguese, the core docs is around 35% translated. I think as soon as one single string is translated we'll need to redirect the docs. BTW, the button to send contributions doesn't work on X. I'll open an issue for that.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as soon as one single string is translated we'll need to redirect the docs.

Interesting, what is the motivation behind this?
I would argue that partially translated (even >50%) page is more disappointing than helpful. Especially for technical documentation (landing pages and pricing page are English-only)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants