Skip to content

Commit

Permalink
[docs] Remove in-context translation code & files (#21633)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrookes authored Jul 1, 2020
1 parent 07ceaf6 commit 4024c25
Show file tree
Hide file tree
Showing 122 changed files with 4 additions and 9,533 deletions.
15 changes: 1 addition & 14 deletions docs/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-underscore-dangle */
import 'docs/src/modules/components/bootstrap';
// --- Post bootstrap -----
import React from 'react';
Expand Down Expand Up @@ -37,25 +36,13 @@ function useFirstRender() {
return firstRenderRef.current;
}

acceptLanguage.languages(['en', 'zh', 'pt']);

function loadCrowdin() {
window._jipt = [];
window._jipt.push(['project', 'material-ui-docs']);
loadScript('https://cdn.crowdin.com/jipt/jipt.js', document.querySelector('head'));
}
acceptLanguage.languages(['en', 'zh', 'pt', 'ru']);

function LanguageNegotiation() {
const dispatch = useDispatch();
const router = useRouter();
const userLanguage = useSelector((state) => state.options.userLanguage);

React.useEffect(() => {
if (userLanguage === 'aa') {
loadCrowdin();
}
}, [userLanguage]);

React.useEffect(() => {
const { userLanguage: userLanguageUrl, canonical } = pathnameToLanguage(
rewriteUrlForNextExport(router.asPath),
Expand Down
1 change: 0 additions & 1 deletion docs/public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/fr/* /:splat 200
/de/* /:splat 200
/ja/* /:splat 200
/aa/* /:splat 200

# For Google
/drafts / 301
Expand Down
6 changes: 2 additions & 4 deletions docs/src/modules/components/AppFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@ function AppFrame(props) {
>
<LanguageIcon />
<span className={classes.language}>
{userLanguage === 'aa'
? 'Translating'
: LANGUAGES_LABEL.filter((language) => language.code === userLanguage)[0].text}
{LANGUAGES_LABEL.filter((language) => language.code === userLanguage)[0].text}
</span>
<ExpandMoreIcon fontSize="small" />
</Button>
Expand Down Expand Up @@ -264,7 +262,7 @@ function AppFrame(props) {
component="a"
data-no-link="true"
href={
userLanguage === 'en' || userLanguage === 'aa'
userLanguage === 'en'
? `${CROWDIN_ROOT_URL}`
: `${CROWDIN_ROOT_URL}${crowdInLocale}#/staging`
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const ACTION_TYPES = {
};

// Valid languages to server-side render in production
const LANGUAGES = ['en', 'zh', 'ru', 'pt', 'es', 'fr', 'de', 'ja', 'aa'];
const LANGUAGES = ['en', 'zh', 'ru', 'pt', 'es', 'fr', 'de', 'ja'];

// Server side rendered languages
const LANGUAGES_SSR = ['en', 'zh', 'ru', 'pt', 'es'];
Expand Down
30 changes: 0 additions & 30 deletions docs/src/pages/components/about-the-lab/about-the-lab-aa.md

This file was deleted.

56 changes: 0 additions & 56 deletions docs/src/pages/components/accordion/accordion-aa.md

This file was deleted.

78 changes: 0 additions & 78 deletions docs/src/pages/components/alert/alert-aa.md

This file was deleted.

105 changes: 0 additions & 105 deletions docs/src/pages/components/app-bar/app-bar-aa.md

This file was deleted.

Loading

0 comments on commit 4024c25

Please sign in to comment.