mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-03 19:32:35 +02:00
refactor(v2): add more translatable strings (#4219)
* refactor(v2): add more translatable strings * Apply suggestions from code review Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com> * Fixes * Updates * Localize direct link to heading * typo + add french translations Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com> Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
75228c4b8d
commit
08fa318599
20 changed files with 267 additions and 70 deletions
|
@ -12,7 +12,7 @@ import copy from 'copy-text-to-clipboard';
|
|||
import rangeParser from 'parse-numeric-range';
|
||||
import usePrismTheme from '@theme/hooks/usePrismTheme';
|
||||
import type {Props} from '@theme/CodeBlock';
|
||||
import Translate from '@docusaurus/Translate';
|
||||
import Translate, {translate} from '@docusaurus/Translate';
|
||||
|
||||
import styles from './styles.module.css';
|
||||
import {useThemeConfig} from '@docusaurus/theme-common';
|
||||
|
@ -240,7 +240,11 @@ export default function CodeBlock({
|
|||
<button
|
||||
ref={button}
|
||||
type="button"
|
||||
aria-label="Copy code to clipboard"
|
||||
aria-label={translate({
|
||||
id: 'theme.CodeBlock.copyButtonAriaLabel',
|
||||
message: 'Copy code to clipboard',
|
||||
description: 'The ARIA label for copy code blocks button',
|
||||
})}
|
||||
className={clsx(styles.copyButton)}
|
||||
onClick={handleCopyCode}>
|
||||
{showCopied ? (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue