-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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] Disable translations #34820
[docs] Disable translations #34820
Changes from 5 commits
6882659
a8bdc0a
e8557fe
9c5857c
1f9ceff
b861c0d
f3b9064
5f6bd10
db2336b
f28bbdc
17d66c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -389,6 +389,8 @@ https://v4.material-ui.com/* https://v4.mui.com/:splat 301! | |||||||||||||||||||||||||||
/base/api/trap-focus/ /base/api/focus-trap/ 301 | ||||||||||||||||||||||||||||
/material-ui/experimental-api/css-variables/ /material-ui/experimental-api/css-theme-variables/overview/ 301 | ||||||||||||||||||||||||||||
/joy-ui/main-features/perfect-dark-mode/ /joy-ui/main-features/dark-mode-optimization/ 301 | ||||||||||||||||||||||||||||
/pt/* /:splat 301 | ||||||||||||||||||||||||||||
/zh/* /:splat 301 | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We can do this instead to avoid #34820 (comment) and keep There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense 👍 Would the translation on x still work if this PR gets merged tough? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW now that this is committed, make sure to add the redirects in mui/mui-x#6560 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think so - we still have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @bharatkashyap should we do something similar for toolpad? Is there support for translations there as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, @mnajdova, there's no need for this in Toolpad since we don't have translations at the moment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bharatkashyap Because if you go to |
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
# 2023 | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,10 @@ const CODE_VARIANTS = { | |
}; | ||
|
||
// Valid languages to server-side render in production | ||
const LANGUAGES = ['en', 'zh', 'pt']; | ||
const LANGUAGES = ['en']; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need these constants? They're used in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We discussed that we want to keep the infrastructure around the translations so that we can easily add it back if we decide in the future, this is why I decided to left these constants and not do any changes in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
// Server side rendered languages | ||
const LANGUAGES_SSR = ['en', 'zh', 'pt']; | ||
const LANGUAGES_SSR = ['en']; | ||
|
||
// Work in progress | ||
const LANGUAGES_IN_PROGRESS = LANGUAGES.slice(); | ||
|
@@ -18,14 +18,6 @@ const LANGUAGES_LABEL = [ | |
code: 'en', | ||
text: 'English', | ||
}, | ||
{ | ||
code: 'zh', | ||
text: '中文', | ||
}, | ||
{ | ||
code: 'pt', | ||
text: 'Português', | ||
}, | ||
]; | ||
|
||
const LANGUAGES_IGNORE_PAGES = (pathname) => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do the same in MUI X and synchronize docs deployment to production to avoid redirect loop for users that previously selected language different than
en
.Here's what happens on preview deployment when user has
userLanguage=pt
cookie:Screen.Recording.2022-10-19.at.11.17.20.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll open a PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, let's keep this in mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mui/mui-x#6560