From 4c2b904932d6005312547bf76f679e7969f00558 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Tue, 5 Nov 2019 11:02:55 +0200 Subject: [PATCH] sprintf to compose string, separate strings per platform --- packages/block-library/src/missing/edit.native.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/block-library/src/missing/edit.native.js b/packages/block-library/src/missing/edit.native.js index 094f0575f22541..297a8c02178aec 100644 --- a/packages/block-library/src/missing/edit.native.js +++ b/packages/block-library/src/missing/edit.native.js @@ -11,15 +11,13 @@ import { withPreferredColorScheme } from '@wordpress/compose'; import { coreBlocks } from '@wordpress/block-library'; import { normalizeIconObject } from '@wordpress/blocks'; import { Component } from '@wordpress/element'; -import { __ } from '@wordpress/i18n'; +import { __, sprintf } from '@wordpress/i18n'; /** * Internal dependencies */ import styles from './style.scss'; -const isAndroid = Platform.OS === 'android'; -const platformText = isAndroid ? 'Android' : 'iOS'; export class UnsupportedBlockEdit extends Component { constructor( props ) { super( props ); @@ -64,6 +62,13 @@ export class UnsupportedBlockEdit extends Component { const infoTitleStyle = getStylesFromColorScheme( styles.infoTitle, styles.infoTitleDark ); const infoDescriptionStyle = getStylesFromColorScheme( styles.infoDescription, styles.infoDescriptionDark ); + const infoTitle = sprintf( + // translators: %s: Name of the block + Platform.OS === 'android' ? __( '\'%s\' isn\'t yet supported on WordPress for Android' ) : + __( '\'%s\' isn\'t yet supported on WordPress for iOS' ), + title, + ); + return - { __( '\'' + title + '\' isn\'t yet supported on WordPress for ' + platformText ) } + { infoTitle } { __( 'We are working hard to add more blocks with each release. In the meantime, you can also edit this post on the web.' ) }