mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-30 06:50:36 +02:00
fix(v2): i18n fixes (#4466)
This commit is contained in:
parent
357ea7d836
commit
9e881b46c8
5 changed files with 85 additions and 40 deletions
|
@ -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} />
|
||||
</>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue