Skip to content

Commit

Permalink
i18n: make example and variations translatable in post-navigation-link
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshbhutkar committed Dec 30, 2024
1 parent b4304f8 commit 63b891e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
6 changes: 0 additions & 6 deletions packages/block-library/src/post-navigation-link/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@
"default": ""
}
},
"example": {
"attributes": {
"label": "Next post",
"arrow": "arrow"
}
},
"usesContext": [ "postType" ],
"supports": {
"reusable": false,
Expand Down
14 changes: 14 additions & 0 deletions packages/block-library/src/post-navigation-link/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* WordPress dependencies
*/
import { _x } from '@wordpress/i18n';

/**
* Internal dependencies
*/
Expand All @@ -12,6 +17,15 @@ export { metadata, name };
export const settings = {
edit,
variations,
example: {
attributes: {
label: _x(
'Next post',
'Example label for Post Navigation Link block'
),
arrow: 'arrow',
},
},
};

export const init = () => initBlock( { name, metadata, settings } );
4 changes: 2 additions & 2 deletions packages/block-library/src/post-navigation-link/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const variations = [
scope: [ 'inserter', 'transform' ],
example: {
attributes: {
label: 'Next post',
label: __( 'Next post' ),
arrow: 'arrow',
},
},
Expand All @@ -33,7 +33,7 @@ const variations = [
scope: [ 'inserter', 'transform' ],
example: {
attributes: {
label: 'Previous post',
label: __( 'Previous post' ),
arrow: 'arrow',
},
},
Expand Down

0 comments on commit 63b891e

Please sign in to comment.