From eb4f5e638a04540ff9070a22f691e00f6f86b6a4 Mon Sep 17 00:00:00 2001 From: Matthew Brookes Date: Wed, 1 Jan 2020 22:06:17 +0000 Subject: [PATCH] [docs] Disable in-context translations --- docs/src/modules/components/EditPage.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/docs/src/modules/components/EditPage.js b/docs/src/modules/components/EditPage.js index a1de89b56f56c8..e01f47918a3b59 100644 --- a/docs/src/modules/components/EditPage.js +++ b/docs/src/modules/components/EditPage.js @@ -1,9 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; -import { Router, useRouter } from 'next/router'; import Button from '@material-ui/core/Button'; -import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; const SOURCE_CODE_ROOT_URL = 'https://github.com/mui-org/material-ui/edit/master'; @@ -11,19 +9,19 @@ export default function EditPage(props) { const { markdownLocation } = props; const t = useSelector(state => state.options.t); const userLanguage = useSelector(state => state.options.userLanguage); - const router = useRouter(); - const { canonical } = pathnameToLanguage(Router._rewriteUrlForNextExport(router.asPath)); + const LOCALES = { zh: 'zh-CN', pt: 'pt-BR', es: 'es-ES' }; + const CROWDIN_ROOT_URL = 'https://translate.material-ui.com/project/material-ui-docs/'; + const crowdInLocale = LOCALES[userLanguage] || userLanguage; + const crowdInPath = markdownLocation.substring(0, markdownLocation.lastIndexOf('/')); return (