Skip to content

Commit

Permalink
i18n: make example and variations translatable in `post-navigation-li…
Browse files Browse the repository at this point in the history
…nk` (WordPress#68375)

* i18n: make example and variations translatable in `post-navigation-link`

* i18n: update label translation in `post-navigation-link` block

Co-authored-by: yogeshbhutkar <[email protected]>
Co-authored-by: t-hamano <[email protected]>
  • Loading branch information
3 people authored Jan 2, 2025
1 parent ab89b44 commit 1673ed8
Show file tree
Hide file tree
Showing 3 changed files with 13 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
11 changes: 11 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 { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
Expand All @@ -12,6 +17,12 @@ export { metadata, name };
export const settings = {
edit,
variations,
example: {
attributes: {
label: __( 'Next post' ),
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 1673ed8

Please sign in to comment.