From f70fceba2dcaa435d7c0086953bf55ed267c9687 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 25 Apr 2019 15:45:43 +0200 Subject: [PATCH] Make a11y string properly localizable (#15161) * Make a11y string properly localizable * Remove extra . after the content * Add `accessibility text` to the translators comment * Fix the wrong parameter * Change the position of translator comments --- .../block-library/src/heading/edit.native.js | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/block-library/src/heading/edit.native.js b/packages/block-library/src/heading/edit.native.js index 5d32ba0b3d5745..fb41a50cc10f2e 100644 --- a/packages/block-library/src/heading/edit.native.js +++ b/packages/block-library/src/heading/edit.native.js @@ -13,7 +13,7 @@ import { isEmpty } from 'lodash'; /** * WordPress dependencies */ -import { __ } from '@wordpress/i18n'; +import { __, sprintf } from '@wordpress/i18n'; import { Component } from '@wordpress/element'; import { RichText, BlockControls } from '@wordpress/block-editor'; import { createBlock } from '@wordpress/blocks'; @@ -98,13 +98,23 @@ class HeadingEdit extends Component { const tagName = 'h' + level; - const accessibilityLabelLevel = __( 'level' ) + ' ' + level + __( '.' ); - const accessibilityLabelContent = isEmpty( content ) ? __( 'Empty' ) : this.plainTextContent( content ); - return (