Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: Block/JS Translations #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
*.map
/vendor
6 changes: 3 additions & 3 deletions blocks/bullet/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@ class BulletEdit extends Component {
</BlockControls>
<InspectorControls>
<PanelColorSettings
title={ __( 'Color Settings' ) }
title={ __( 'Color Settings', '_svbk' ) }
initialOpen={ false }
colorSettings={ [
{
value: backgroundColor.color,
onChange: setBackgroundColor,
label: __( 'Background Color' ),
label: __( 'Background Color', '_svbk' ),
},
{
value: textColor.color,
onChange: setTextColor,
label: __( 'Text Color' ),
label: __( 'Text Color', '_svbk' ),
},
] }
/>
Expand Down
6 changes: 3 additions & 3 deletions blocks/bullet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ export const settings = {
icon: 'pressthis',
category: 'common',
keywords: [
__( 'bullet' ),
__( 'card' ),
__( 'bullet', '_svbk' ),
__( 'card', '_svbk' ),
],

styles: [
// Mark style as default.
{
name: 'default',
label: __( 'Default' ),
label: __( 'Default', '_svbk' ),
isDefault: true
},
{
Expand Down
8 changes: 4 additions & 4 deletions blocks/call-us/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ class CallUsEdit extends Component {
return (
<div classNames={ classNames } >
<RichText
placeholder={ __( 'Action text…' ) }
placeholder={ __( 'Action text…', '_svbk' ) }
value={ action }
onChange={ ( value ) => setAttributes( { action: value } ) }
formattingControls={ [ 'bold', 'italic', 'strikethrough' ] }
className={ 'wp-block-svbk-hero__link block-library-button'}
/>
<RichText
placeholder={ __( 'Wide button action text…' ) }
placeholder={ __( 'Wide button action text…', '_svbk' ) }
value={ actionWide }
onChange={ ( value ) => setAttributes( { actionWide: value } ) }
formattingControls={ [ 'bold', 'italic', 'strikethrough' ] }
Expand All @@ -76,11 +76,11 @@ class CallUsEdit extends Component {
required
value={ number }
onChange={ ( event ) => setAttributes( { number: event.target.value } ) }
placeholder={ __( '01 23456789' ) }
placeholder={ __( '01 23456789', '_svbk' ) }
role="combobox"
/>
</div>
<IconButton icon="editor-break" label={ __( 'Apply' ) } type="submit" />
<IconButton icon="editor-break" label={ __( 'Apply', '_svbk' ) } type="submit" />
</form>
) }
<BlockControls>
Expand Down
24 changes: 12 additions & 12 deletions blocks/card/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,27 +152,27 @@ class CardEdit extends Component {
{ !imageType && (
<Placeholder
icon="format-image"
label={ __( 'Image' ) }
instructions={ __( 'Please select if you want to use an image or an icon' ) }
label={ __( 'Image', '_svbk' ) }
instructions={ __( 'Please select if you want to use an image or an icon', '_svbk' ) }
>
<Button
isLarge={ true }
onClick={ () => { setAttributes( { imageType: 'picture' }) } }
>
{ __( 'Image' ) }
{ __( 'Image', '_svbk' ) }
</Button>
<Button
isLarge={ true }
onClick={ () => { setAttributes( { imageType: 'icon' }) } }
>
{ __( 'Icon' ) }
{ __( 'Icon', '_svbk' ) }
</Button>
</Placeholder>
) }
{ imageType && (
<IconButton
icon="no"
label={ __( 'Back to picture type choice' ) }
label={ __( 'Back to picture type choice', '_svbk' ) }
onClick={ () => { setAttributes( { imageType: null }) } }
/>
) }
Expand Down Expand Up @@ -211,7 +211,7 @@ class CardEdit extends Component {
template={ TEMPLATE }
/>
<RichText
placeholder={ __( 'Button text…' ) }
placeholder={ __( 'Button text…', '_svbk' ) }
value={ buttonText }
onChange={ ( value ) => setAttributes( { buttonText: value } ) }
formattingControls={ [ 'bold', 'italic', 'strikethrough' ] }
Expand All @@ -226,7 +226,7 @@ class CardEdit extends Component {
value={ buttonUrl }
onChange={ ( value ) => setAttributes( { buttonUrl: value } ) }
/>
<IconButton icon="editor-break" label={ __( 'Apply' ) } type="submit" />
<IconButton icon="editor-break" label={ __( 'Apply', '_svbk' ) } type="submit" />
</form>
) }
</div>
Expand All @@ -240,25 +240,25 @@ class CardEdit extends Component {
/>
</BlockControls>
<InspectorControls>
<PanelBody title={ __( 'Text Settings' ) } className="blocks-font-size">
<PanelBody title={ __( 'Text Settings', '_svbk' ) } className="blocks-font-size">
<FontSizePicker
value={ fontSize.size }
onChange={ setFontSize }
/>
</PanelBody>
<PanelColorSettings
title={ __( 'Color Settings' ) }
title={ __( 'Color Settings', '_svbk' ) }
initialOpen={ false }
colorSettings={ [
{
value: backgroundColor.color,
onChange: setBackgroundColor,
label: __( 'Background Color' ),
label: __( 'Background Color', '_svbk' ),
},
{
value: textColor.color,
onChange: setTextColor,
label: __( 'Text Color' ),
label: __( 'Text Color', '_svbk' ),
},
] }
/>
Expand All @@ -283,7 +283,7 @@ class CardEdit extends Component {
{
value: ribbonColor.color,
onChange: setRibbonColor,
label: __( 'Ribbon Color' ),
label: __( 'Ribbon Color', '_svbk' ),
},
] }
/>
Expand Down
10 changes: 5 additions & 5 deletions blocks/card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ export const settings = {
icon: 'id',
category: 'common',
keywords: [
__( 'card' ),
__( 'block' ),
__( 'content' ),
__( 'card', '_svbk' ),
__( 'block', '_svbk' ),
__( 'content', '_svbk' ),
],

styles: [
// Mark style as default.
{
name: 'default',
label: __( 'Default' ),
label: __( 'Default', '_svbk' ),
isDefault: true
},
{
name: 'featured',
label: __( 'Featured' ),
label: __( 'Featured', '_svbk' ),
},
],

Expand Down
6 changes: 3 additions & 3 deletions blocks/collapse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ export const settings = {
icon: 'feedback',
category: 'common',
keywords: [
__( 'collapse' ),
__( 'accordion' ),
__( 'collapse', '_svbk' ),
__( 'accordion', '_svbk' ),
],

styles: [
// Mark style as default.
{
name: 'default',
label: __( 'Default' ),
label: __( 'Default', '_svbk' ),
isDefault: true
},
{
Expand Down
4 changes: 2 additions & 2 deletions blocks/common/Post.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Post extends Component {
{ titleTrimmed }
</RawHTML>
) :
__( '(no title)' )
__( '(no title)', '_svbk' )
}
</h3>
{ display === 'excerpt' &&
Expand All @@ -88,7 +88,7 @@ class Post extends Component {
key="html"
>
{ excerptLength < excerpt.trim().split( ' ' ).length ?
excerpt.trim().split( ' ', excerptLength ).join( ' ' ) + ' ... <a href=' + post.link + 'target="_blank" rel="noopener noreferrer">' + __( 'Read more' ) + '</a>' :
excerpt.trim().split( ' ', excerptLength ).join( ' ' ) + ' ... <a href=' + post.link + 'target="_blank" rel="noopener noreferrer">' + __( 'Read more', '_svbk' ) + '</a>' :
excerpt.trim().split( ' ', excerptLength ).join( ' ' ) }
</RawHTML>
</div>
Expand Down
2 changes: 1 addition & 1 deletion blocks/common/PostEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class PostList extends Component {
const inspectorControls = (
<InspectorControls>

<PanelBody title={ __( 'Post Content Settings' ) }>
<PanelBody title={ __( 'Post Content Settings', '_svbk' ) }>
<RadioControl
label="Show:"
selected={ display }
Expand Down
10 changes: 5 additions & 5 deletions blocks/common/PostListEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class PostListEdit extends Component {
const inspectorControls = (
<InspectorControls>

<PanelBody title={ __( 'Post Content Settings' ) }>
<PanelBody title={ __( 'Post Content Settings', '_svbk' ) }>
<RadioControl
label="Show:"
selected={ display }
Expand Down Expand Up @@ -143,7 +143,7 @@ class PostListEdit extends Component {
</PanelBody>

{ postLayout === 'grid' &&
<PanelBody title={ __( 'Layout' ) }>
<PanelBody title={ __( 'Layout', '_svbk' ) }>
<RangeControl
label={ __( 'Columns', '_svbk' ) }
value={ columns }
Expand All @@ -167,7 +167,7 @@ class PostListEdit extends Component {
>
{ ! Array.isArray( posts ) ?
<Spinner /> :
__( 'No posts found.' )
__( 'No posts found.', '_svbk' )
}
</Placeholder>
</Fragment>
Expand All @@ -182,13 +182,13 @@ class PostListEdit extends Component {
const layoutControls = [
{
icon: 'list-view',
title: __( 'List View' ),
title: __( 'List View', '_svbk' ),
onClick: () => setAttributes( { postLayout: 'list' } ),
isActive: postLayout === 'list',
},
{
icon: 'grid-view',
title: __( 'Grid View' ),
title: __( 'Grid View', '_svbk' ),
onClick: () => setAttributes( { postLayout: 'grid' } ),
isActive: postLayout === 'grid',
},
Expand Down
6 changes: 3 additions & 3 deletions blocks/common/appearance-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ const withAppearanceControls = createHigherOrderComponent( ( BlockEdit ) => {
<InspectorControls>
<PanelBody title={ __( 'Appearance', '_svbk' ) } initialOpen={ false } >
<ToggleControl
label={ __( 'Critical Rendering' ) }
label={ __( 'Critical Rendering', '_svbk' ) }
onChange={ ( value ) => setAttributes( { criticalRendering: value } ) }
checked={ criticalRendering }
/>
<ToggleControl
label={ __( 'Hide on Mobile' ) }
label={ __( 'Hide on Mobile', '_svbk' ) }
onChange={ ( value ) => setAttributes( { mobileHidden: value } ) }
checked={ mobileHidden }
/>
<ToggleControl
label={ __( 'Enable Animation' ) }
label={ __( 'Enable Animation', '_svbk' ) }
onChange={ ( value ) => setAttributes( { enableAnimation: value } ) }
checked={ enableAnimation }
/>
Expand Down
2 changes: 1 addition & 1 deletion blocks/common/heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class HeadingToolbar extends Component {
return {
icon: 'heading',
// translators: %s: heading level e.g: "1", "2", "3"
title: sprintf( __( 'Heading %d' ), targetLevel ),
title: sprintf( __( 'Heading %d', '_svbk' ), targetLevel ),
isActive: targetLevel === selectedLevel,
onClick: () => onChange( targetLevel ),
subscript: String( targetLevel ),
Expand Down
12 changes: 6 additions & 6 deletions blocks/common/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,18 @@ class ImageEdit extends Component {
<Fragment>
{ ! isEmpty( imageSizeOptions ) && changeSize && (
<SelectControl
label={ __( 'Image Size' ) }
label={ __( 'Image Size', '_svbk' ) }
value={ size }
options={ imageSizeOptions }
onChange={ this.updateImageSize }
/>
) }
{ (typeof alt !== 'undefined') && (
<TextareaControl
label={ __( 'Alt Text (Alternative Text)' ) }
label={ __( 'Alt Text (Alternative Text)', '_svbk' ) }
value={ alt }
onChange={ this.updateAlt }
help={ __( 'Alternative text describes your image to people who can’t see it. Add a short description with its key details.' ) }
help={ __( 'Alternative text describes your image to people who can’t see it. Add a short description with its key details.', '_svbk' ) }
/>
) }
</Fragment>
Expand All @@ -228,15 +228,15 @@ class ImageEdit extends Component {
render={ ( { open } ) => (
<IconButton
className="components-toolbar__control"
label={ __( 'Edit image' ) }
label={ __( 'Edit image', '_svbk' ) }
icon={ editImageIcon }
onClick={ open }
/>
) }
/>
<IconButton
className="components-toolbar__control"
label={ __( 'Remove image' ) }
label={ __( 'Remove image', '_svbk' ) }
icon='trash'
onClick={ () => { this.onSelectImage() } }
/>
Expand Down Expand Up @@ -277,7 +277,7 @@ class ImageEdit extends Component {
}
{ inInspector ? settings : (
<InspectorControls>
<PanelBody title={ __( 'Image Settings' ) }>
<PanelBody title={ __( 'Image Settings', '_svbk' ) }>
{ settings }
</PanelBody>
</InspectorControls>
Expand Down
Loading