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:
Alexey Pyltsyn 2021-02-18 13:29:51 +03:00 committed by GitHub
parent 75228c4b8d
commit 08fa318599
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 267 additions and 70 deletions

View file

@ -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 ? (