fix(v2): i18n fixes (#4466)

This commit is contained in:
Sébastien Lorber 2021-03-19 14:23:31 +01:00 committed by GitHub
parent 357ea7d836
commit 9e881b46c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 40 deletions

View file

@ -13,24 +13,20 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import usePrismTheme from '@theme/hooks/usePrismTheme';
import styles from './styles.module.css';
function Header({translateId, description, text}) {
return (
<div className={clsx(styles.playgroundHeader)}>
<Translate id={translateId} description={description}>
{text}
</Translate>
</div>
);
function Header({children}) {
return <div className={clsx(styles.playgroundHeader)}>{children}</div>;
}
function ResultWithHeader() {
return (
<>
<Header
translateId="theme.Playground.result"
description="The result label of the live codeblocks"
text="Result"
/>
<Header>
<Translate
id="theme.Playground.result"
description="The result label of the live codeblocks">
Result
</Translate>
</Header>
<div className={styles.playgroundPreview}>
<LivePreview />
<LiveError />
@ -42,11 +38,13 @@ function ResultWithHeader() {
function EditorWithHeader() {
return (
<>
<Header
translateId="theme.Playground.liveEditor"
description="The live editor label of the live codeblocks"
text="Live Editor"
/>
<Header>
<Translate
id="theme.Playground.liveEditor"
description="The live editor label of the live codeblocks">
Live Editor
</Translate>
</Header>
<LiveEditor className={styles.playgroundEditor} />
</>
);