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: make example and variations translatable in post-navigation-link #68375

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
i18n: make example and variations translatable in post-navigation-link
  • Loading branch information
yogeshbhutkar committed Dec 30, 2024
commit 63b891e80fb08aa977ce5b4fd78a53c13394138b
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 } );
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
Loading