How to use the @wordpress/i18n._x function in @wordpress/i18n

To help you get started, weā€™ve selected a few @wordpress/i18n examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WordPress / gutenberg / packages / components / src / mobile / bottom-sheet / cell.native.js View on Github external
const getAccessibilityLabel = () => {
			if ( accessibilityLabel || ! showValue ) {
				return accessibilityLabel || label;
			}
			return isEmpty( value ) ?
				sprintf(
					/* translators: accessibility text. Empty state of a inline textinput cell. %s: The cell's title */
					_x( '%s. Empty', 'inline textinput cell' ),
					label
				) :
				// Separating by ',' is necessary to make a pause on urls (non-capitalized text)
				sprintf(
					/* translators: accessibility text. Inline textinput title and value.%1: Cell title, %2: cell value. */
					_x( '%1$s, %2$s', 'inline textinput cell' ),
					label,
					value
				);
		};
github Automattic / jetpack / extensions / blocks / tiled-gallery / index.js View on Github external
/>
	
);

export const settings = {
	attributes: blockAttributes,
	category: 'jetpack',
	description: __(
		"Display multiple images in an elegantly organized tiled layout. Serves images using Jetpack's fast global network of servers.",
		'jetpack'
	),
	icon,
	keywords: [
		_x( 'images', 'block search term', 'jetpack' ),
		_x( 'photos', 'block search term', 'jetpack' ),
		_x( 'pictures', 'block search term', 'jetpack' ),
	],
	styles: layoutStylesWithLabels,
	supports: {
		align: [ 'center', 'wide', 'full' ],
		customClassName: false,
		html: false,
	},
	title: __( 'Tiled Gallery', 'jetpack' ),
	transforms: {
		from: [
			{
				type: 'block',
				isMultiBlock: true,
				blocks: [ 'core/image' ],
				isMatch: images => getValidImages( images ).length > 0,
				transform: images => {
github Automattic / vip-go-mu-plugins-built / jetpack / extensions / blocks / videopress / edit.js View on Github external
checked={ muted }
							/>
							
							 setAttributes( { preload: value } ) }
								options={ [
									{ value: 'auto', label: _x( 'Auto', 'VideoPress preload setting', 'jetpack' ) },
									{
										value: 'metadata',
										label: _x( 'Metadata', 'VideoPress preload setting', 'jetpack' ),
									},
									{ value: 'none', label: _x( 'None', 'VideoPress preload setting', 'jetpack' ) },
								] }
							/>
							
								
									 (
github WordPress / gutenberg / packages / editor / src / components / post-taxonomies / hierarchical-term-selector.js View on Github external
.then( ( term ) => {
				const hasTerm = !! find( this.state.availableTerms, ( availableTerm ) => availableTerm.id === term.id );
				const newAvailableTerms = hasTerm ? this.state.availableTerms : [ term, ...this.state.availableTerms ];
				const termAddedMessage = sprintf(
					_x( '%s added', 'term' ),
					get(
						this.props.taxonomy,
						[ 'labels', 'singular_name' ],
						slug === 'category' ? __( 'Category' ) : __( 'Term' )
					)
				);
				this.props.speak( termAddedMessage, 'assertive' );
				this.addRequest = null;
				this.setState( {
					adding: false,
					formName: '',
					formParent: '',
					availableTerms: newAvailableTerms,
					availableTermsTree: this.sortBySelected( buildTermsTree( newAvailableTerms ) ),
				} );
				onUpdateTerms( [ ...terms, term.id ], taxonomy.rest_base );
github WordPress / gutenberg / packages / block-editor / src / components / inserter / menu.js View on Github external
ref={ this.inserterResults }
						tabIndex="0"
						role="region"
						aria-label={ __( 'Available block types' ) }
					>

						

						{ !! suggestedItems.length &&
							
								
							
						}

						{ map( getCategories(), ( category ) => {
							const categoryItems = itemsPerCategory[ category.slug ];
							if ( ! categoryItems || ! categoryItems.length ) {
								return null;
							}
							return (
github Automattic / jetpack / extensions / blocks / map / settings.js View on Github external
<svg aria-hidden="true" role="img" viewBox="0 0 24 24" height="24" width="24" xmlns="http://www.w3.org/2000/svg">
			<path d="M0 0h24v24H0V0z" fill="none"></path>
			<path d="M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM10 5.47l4 1.4v11.66l-4-1.4V5.47zm-5 .99l3-1.01v11.7l-3 1.16V6.46zm14 11.08l-3 1.01V6.86l3-1.16v11.84z"></path>
		</svg>
	),
	category: 'jetpack',
	keywords: [
		_x( 'map', 'block search term', 'jetpack' ),
		_x( 'location', 'block search term', 'jetpack' ),
		_x( 'navigation', 'block search term', 'jetpack' ),
	],
	description: __( 'Add an interactive map showing one or more locations.', 'jetpack' ),
	attributes: {
		align: {
			type: 'string',
		},
		points: {
			type: 'array',
			default: [],
		},
		mapStyle: {
			type: 'string',
			default: 'default',
		},
github devowlio / wp-react-starter / packages / utils / lib / factory / i18n.tsx View on Github external
function _x(single: string, context: string, ...args: any[]): string {
        return wpi18n.sprintf(wpi18n._x(single, context, slug), ...args) as string;
    }
github Automattic / jetpack / extensions / blocks / eventbrite / edit.js View on Github external
type="url"
							value={ editedUrl }
							className="components-placeholder__input"
							aria-label={ __( 'Eventbrite URL', 'jetpack' ) }
							placeholder={ __( 'Enter an event URL to embed hereā€¦', 'jetpack' ) }
							onChange={ event =&gt; this.setState( { editedUrl: event.target.value } ) }
						/&gt;
						<button type="submit">
							{ _x( 'Embed', 'button label', 'jetpack' ) }
						</button>
						{ this.cannotEmbed() &amp;&amp; (
							<p>
								{ __( 'Sorry, this content could not be embedded.', 'jetpack' ) }
								<br>
								<button> fallback( editedUrl, this.props.onReplace ) }&gt;
									{ _x( 'Convert to link', 'button label', 'jetpack' ) }
								</button>
							</p>
						) }
					
				
			
		);
	}
github Automattic / vip-go-mu-plugins-built / jetpack / extensions / blocks / related-posts / index.js View on Github external
title: __( 'Related Posts', 'jetpack' ),

	icon: (
		<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
			<g stroke="currentColor">
				<path d="M4,4 L4,19 M4,4 L19,4 M4,9 L19,9 M4,14 L19,14 M4,19 L19,19 M9,4 L9,19 M19,4 L19,19"></path>
			</g>
		</svg>
	),

	category: 'embed',

	keywords: [
		_x( 'similar content', 'block search term', 'jetpack' ),
		_x( 'linked', 'block search term', 'jetpack' ),
		_x( 'connected', 'block search term', 'jetpack' ),
	],

	attributes: {
		postLayout: {
			type: 'string',
			default: 'grid',
		},
		displayDate: {
			type: 'boolean',
			default: true,
		},
		displayThumbnails: {
			type: 'boolean',
			default: false,
		},
		displayContext: {

@wordpress/i18n

WordPress internationalization (i18n) library.

GPL-2.0-or-later
Latest version published 1 day ago

Package Health Score

98 / 100
Full package analysis