Skip to content

Commit

Permalink
Blocks: add translation context to block search keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
simison committed Apr 11, 2019
1 parent 9e361f8 commit 1ff4173
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 12 deletions.
8 changes: 6 additions & 2 deletions extensions/blocks/contact-form/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';
import { getBlockType, createBlock } from '@wordpress/blocks';
import { Path, Circle } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
Expand All @@ -26,7 +26,11 @@ export const settings = {
icon: renderMaterialIcon(
<Path d="M13 7.5h5v2h-5zm0 7h5v2h-5zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM11 6H6v5h5V6zm-1 4H7V7h3v3zm1 3H6v5h5v-5zm-1 4H7v-3h3v3z" />
),
keywords: [ __( 'email', 'jetpack' ), __( 'feedback', 'jetpack' ), __( 'contact', 'jetpack' ) ],
keywords: [
_x( 'email', 'block search term', 'jetpack' ),
_x( 'feedback', 'block search term', 'jetpack' ),
_x( 'contact', 'block search term', 'jetpack' ),
],
category: 'jetpack',
supports: {
reusable: false,
Expand Down
8 changes: 6 additions & 2 deletions extensions/blocks/gif/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';
import { Path, SVG } from '@wordpress/components';

/**
Expand All @@ -27,7 +27,11 @@ export const settings = {
title,
icon,
category: 'jetpack',
keywords: [ __( 'animated', 'jetpack' ), __( 'giphy', 'jetpack' ), __( 'image', 'jetpack' ) ],
keywords: [
_x( 'animated', 'block search term', 'jetpack' ),
_x( 'giphy', 'block search term', 'jetpack' ),
_x( 'image', 'block search term', 'jetpack' ),
],
description: __( 'Search for and insert an animated image.', 'jetpack' ),
attributes: {
align: {
Expand Down
8 changes: 6 additions & 2 deletions extensions/blocks/map/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';

export const settings = {
name: 'map',
Expand All @@ -25,7 +25,11 @@ export const settings = {
</svg>
),
category: 'jetpack',
keywords: [ __( 'map', 'jetpack' ), __( 'location', '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: {
Expand Down
8 changes: 6 additions & 2 deletions extensions/blocks/markdown/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';
import { ExternalLink, Path, Rect, SVG } from '@wordpress/components';
import { Fragment } from '@wordpress/element';

Expand Down Expand Up @@ -49,7 +49,11 @@ export const settings = {

category: 'jetpack',

keywords: [ __( 'formatting', 'jetpack' ), __( 'syntax', 'jetpack' ), __( 'markup', 'jetpack' ) ],
keywords: [
_x( 'formatting', 'block search term', 'jetpack' ),
_x( 'syntax', 'block search term', 'jetpack' ),
_x( 'markup', 'block search term', 'jetpack' ),
],

attributes: {
//The Markdown source is saved in the block content comments delimiter
Expand Down
8 changes: 6 additions & 2 deletions extensions/blocks/slideshow/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';
import { Path, SVG } from '@wordpress/components';

/**
Expand Down Expand Up @@ -71,7 +71,11 @@ export const name = 'slideshow';
export const settings = {
title: __( 'Slideshow', 'jetpack' ),
category: 'jetpack',
keywords: [ __( 'image', 'jetpack' ), __( 'gallery', 'jetpack' ), __( 'slider', 'jetpack' ) ],
keywords: [
_x( 'image', 'block search term', 'jetpack' ),
_x( 'gallery', 'block search term', 'jetpack' ),
_x( 'slider', 'block search term', 'jetpack' ),
],
description: __( 'Add an interactive slideshow.', 'jetpack' ),
attributes,
supports: {
Expand Down
8 changes: 6 additions & 2 deletions extensions/blocks/subscriptions/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';
import { isEmpty } from 'lodash';
import { Path } from '@wordpress/components';
import { RawHTML } from '@wordpress/element';
Expand Down Expand Up @@ -30,7 +30,11 @@ export const settings = {
),
category: 'jetpack',

keywords: [ __( 'subscribe', 'jetpack' ), __( 'join', 'jetpack' ), __( 'follow', 'jetpack' ) ],
keywords: [
_x( 'subscribe', 'block search term', 'jetpack' ),
_x( 'join', 'block search term', 'jetpack' ),
_x( 'follow', 'block search term', 'jetpack' ),
],

attributes: {
subscribePlaceholder: { type: 'string', default: __( 'Email Address', 'jetpack' ) },
Expand Down

0 comments on commit 1ff4173

Please sign in to comment.