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

Add support for internalized strings #131

Merged
merged 4 commits into from
Nov 28, 2023
Merged
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
2 changes: 1 addition & 1 deletion patterns/header-title-nav-button.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<!-- wp:buttons -->
<div class="wp-block-buttons">
<!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link">Get Started</a></div>
<div class="wp-block-button"><a class="wp-block-button__link"><?php echo esc_html_x( 'Get Started', 'Button text of this section', 'extendable' ); ?></a></div>
<!-- /wp:button -->
</div>
<!-- /wp:buttons -->
Expand Down
9 changes: 4 additions & 5 deletions patterns/hidden-404.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
<!-- wp:group {"style":{"spacing":{"margin":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group" style="margin-top:var(--wp--preset--spacing--60);margin-bottom:var(--wp--preset--spacing--60)">

<!-- wp:heading {"level":2} -->
<h2><?php echo esc_html__( 'Not found, error 404', 'extendable' ); ?></h2>
<!-- wp:heading {"level":1} -->
<h1 class="wp-block-heading" id="page-not-found"><?php echo esc_html_x( 'Page Not Found', 'Heading for a webpage that is not found', 'extendable' ); ?></h1>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><?php echo esc_html__( 'Oops, the page you are looking for does not exist or is no longer available. We are sorry about that. Just use the search form to find your way.', 'extendable' ); ?></p>
<p><?php echo esc_html_x( 'The page you are looking for does not exist, or it has been moved. Please try searching using the form below.', 'Message to convey that a webpage could not be found', 'extendable' ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:search {"width":75,"widthUnit":"%","showLabel":false,"buttonText":"Search"} /-->

<!-- wp:pattern {"slug":"extendable/hidden-search"} /-->
</div>
<!-- /wp:group -->
10 changes: 10 additions & 0 deletions patterns/hidden-no-results.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
/**
* Title: No results
* Slug: extendable/hidden-no-results
* Inserter: no
*/
?>
<!-- wp:paragraph -->
<p><?php echo esc_html_x( 'No posts were found.', 'Message explaining that there are no results returned from a search', 'extendable' ); ?></p>
<!-- /wp:paragraph -->
9 changes: 9 additions & 0 deletions patterns/hidden-search.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
/**
* Title: Search
* Slug: extendable/hidden-search
* Inserter: no
*/
?>

<!-- wp:search {"label":"<?php echo esc_attr_x( 'Search', 'search form label', 'extendable' ); ?>","showLabel":false,"buttonText":"<?php echo esc_attr_x( 'Search', 'search button text', 'extendable' ); ?>","buttonUseIcon":true} /-->
54 changes: 54 additions & 0 deletions patterns/posts-1-col.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
/**
* Title: List of posts, 1 column
* Slug: extendable/posts-1-col
* Categories: query
* Block Types: core/query
*/
?>

<!-- wp:query {"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"align":"wide","style":{"spacing":{"padding":{"bottom":"var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dspacing\u002d\u002dmedium)","top":"var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dspacing\u002d\u002dmedium)"},"margin":{"top":"0px","bottom":"0px"}}},"layout":{"inherit":true}} -->
<div class="wp-block-query alignwide"
style="margin-top:0px;margin-bottom:0px;padding-top:var(--wp--custom--spacing--medium);padding-bottom:var(--wp--custom--spacing--medium)">
<!-- wp:post-template {"align":"wide"} -->
<!-- wp:group {"style":{"spacing":{"blockGap":"2.5rem"}},"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:post-featured-image {"isLink":true,"align":"wide"} /-->

<!-- wp:group {"style":{"spacing":{"blockGap":"1rem"}},"layout":{"inherit":false},"fontSize":"small"} -->
<div class="wp-block-group has-small-font-size">
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:group {"style":{"spacing":{"blockGap":"1.5rem"}},"layout":{"type":"flex","flexWrap":"wrap"}} -->
<div class="wp-block-group">
<!-- wp:post-date /-->

<!-- wp:post-terms {"term":"category"} /-->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->

<!-- wp:post-excerpt {"style":{"spacing":{"margin":{"top":"1.5rem"}}}} /-->
</div>
<!-- /wp:group -->

<!-- wp:spacer {"height":"3rem"} -->
<div style="height:3rem" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- /wp:post-template -->

<!-- wp:query-pagination {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
<!-- wp:query-pagination-previous /-->

<!-- wp:query-pagination-numbers /-->

<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination -->

<!-- wp:query-no-results -->
<!-- wp:pattern {"slug":"extendable/hidden-no-results"} /-->
<!-- /wp:query-no-results -->

</div>
<!-- /wp:query -->
50 changes: 3 additions & 47 deletions templates/archive.html
Original file line number Diff line number Diff line change
@@ -1,60 +1,16 @@
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:group {"style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--medium)","bottom":"0px"},"margin":{"top":"0px","bottom":"0px"}}},"layout":{"inherit":true}} -->
<div class="wp-block-group" style="margin-top:0px;margin-bottom:0px;padding-top:var(--wp--custom--spacing--medium);padding-bottom:0px">
<div class="wp-block-group"
style="margin-top:0px;margin-bottom:0px;padding-top:var(--wp--custom--spacing--medium);padding-bottom:0px">
<!-- wp:query-title {"type":"archive","align":"wide","fontSize":"x-large"} /-->

<!-- wp:separator {"align":"wide","className":"is-style-wide"} -->
<hr class="wp-block-separator alignwide has-alpha-channel-opacity is-style-wide" />
<!-- /wp:separator -->

<!-- wp:query {"queryId":1,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"align":"wide","style":{"spacing":{"padding":{"bottom":"var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dspacing\u002d\u002dmedium)","top":"var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dspacing\u002d\u002dmedium)"},"margin":{"top":"0px","bottom":"0px"}}},"layout":{"inherit":true}} -->
<div class="wp-block-query alignwide"
style="margin-top:0px;margin-bottom:0px;padding-top:var(--wp--custom--spacing--medium);padding-bottom:var(--wp--custom--spacing--medium)">
<!-- wp:post-template {"align":"wide"} -->
<!-- wp:group {"style":{"spacing":{"blockGap":"2.5rem"}},"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:post-featured-image {"isLink":true,"align":"wide"} /-->
<!-- wp:pattern {"slug":"extendable/posts-1-col"} /-->

<!-- wp:group {"style":{"spacing":{"blockGap":"1rem"}},"layout":{"inherit":false},"fontSize":"small"} -->
<div class="wp-block-group has-small-font-size">
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:group {"style":{"spacing":{"blockGap":"1.5rem"}},"layout":{"type":"flex","flexWrap":"wrap"}} -->
<div class="wp-block-group">
<!-- wp:post-date /-->

<!-- wp:post-terms {"term":"category"} /-->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->

<!-- wp:post-excerpt {"style":{"spacing":{"margin":{"top":"1.5rem"}}}} /-->
</div>
<!-- /wp:group -->

<!-- wp:spacer {"height":"3rem"} -->
<div style="height:3rem" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- /wp:post-template -->

<!-- wp:query-pagination {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
<!-- wp:query-pagination-previous /-->

<!-- wp:query-pagination-numbers /-->

<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination -->

<!-- wp:query-no-results -->
<!-- wp:paragraph {"placeholder":"Add text or blocks that will display when the query returns no results."} -->
<p></p>
<!-- /wp:paragraph -->
<!-- /wp:query-no-results -->

</div>
<!-- /wp:query -->
</div>
<!-- /wp:group -->

Expand Down
49 changes: 2 additions & 47 deletions templates/home.html
Original file line number Diff line number Diff line change
@@ -1,50 +1,5 @@
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:query {"queryId":1,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"tagName":"main","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--medium)","top":"var(--wp--custom--spacing--medium)"},"margin":{"top":"0px","bottom":"0px"}}},"layout":{"inherit":true}} -->
<main class="wp-block-query" style="margin-top:0px;margin-bottom:0px;padding-top:var(--wp--custom--spacing--medium);padding-bottom:var(--wp--custom--spacing--medium)">
<!-- wp:post-template {"align":"wide"} -->
<!-- wp:group {"style":{"spacing":{"blockGap":"2.5rem"}},"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:post-featured-image {"isLink":true,"align":"wide"} /-->
<!-- wp:pattern {"slug":"extendable/posts-1-col"} /-->

<!-- wp:group {"style":{"spacing":{"blockGap":"1rem"}},"layout":{"inherit":false},"fontSize":"small"} -->
<div class="wp-block-group has-small-font-size">
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:group {"style":{"spacing":{"blockGap":"1.5rem"}},"layout":{"type":"flex","flexWrap":"wrap"}} -->
<div class="wp-block-group">
<!-- wp:post-date /-->

<!-- wp:post-terms {"term":"category"} /-->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->

<!-- wp:post-excerpt {"style":{"spacing":{"margin":{"top":"1.5rem"}}}} /-->
</div>
<!-- /wp:group -->

<!-- wp:spacer {"height":"3rem"} -->
<div style="height:3rem" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- /wp:post-template -->

<!-- wp:query-pagination {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
<!-- wp:query-pagination-previous /-->

<!-- wp:query-pagination-numbers /-->

<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination -->

<!-- wp:query-no-results -->
<!-- wp:paragraph {"placeholder":"Add text or blocks that will display when the query returns no results."} -->
<p></p>
<!-- /wp:paragraph -->
<!-- /wp:query-no-results -->

</main>
<!-- /wp:query -->

<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
47 changes: 1 addition & 46 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,50 +1,5 @@
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:query {"queryId":1,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"tagName":"main","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--medium)","top":"var(--wp--custom--spacing--medium)"},"margin":{"top":"0px","bottom":"0px"}}},"layout":{"inherit":true}} -->
<main class="wp-block-query" style="margin-top:0px;margin-bottom:0px;padding-top:var(--wp--custom--spacing--medium);padding-bottom:var(--wp--custom--spacing--medium)">
<!-- wp:post-template {"align":"wide"} -->
<!-- wp:group {"style":{"spacing":{"blockGap":"2.5rem"}},"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:post-featured-image {"isLink":true,"align":"wide"} /-->

<!-- wp:group {"style":{"spacing":{"blockGap":"1rem"}},"layout":{"inherit":false},"fontSize":"small"} -->
<div class="wp-block-group has-small-font-size">
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:group {"style":{"spacing":{"blockGap":"1.5rem"}},"layout":{"type":"flex","flexWrap":"wrap"}} -->
<div class="wp-block-group">
<!-- wp:post-date /-->

<!-- wp:post-terms {"term":"category"} /-->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->

<!-- wp:post-excerpt {"style":{"spacing":{"margin":{"top":"1.5rem"}}}} /-->
</div>
<!-- /wp:group -->

<!-- wp:spacer {"height":"3rem"} -->
<div style="height:3rem" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- /wp:post-template -->

<!-- wp:query-pagination {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
<!-- wp:query-pagination-previous /-->

<!-- wp:query-pagination-numbers /-->

<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination -->

<!-- wp:query-no-results -->
<!-- wp:paragraph {"placeholder":"Add text or blocks that will display when the query returns no results."} -->
<p></p>
<!-- /wp:paragraph -->
<!-- /wp:query-no-results -->

</main>
<!-- /wp:query -->
<!-- wp:pattern {"slug":"extendable/posts-1-col"} /-->

<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
65 changes: 32 additions & 33 deletions templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,53 @@

<!-- wp:group {"style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"layout":{"inherit":true}} -->
<div class="wp-block-group" style="padding-bottom:var(--wp--custom--spacing--large, 8rem)">
<!-- wp:search {"label":"Search","showLabel":false,"width":100,"widthUnit":"%","buttonText":"Search","buttonUseIcon":true} /-->
<!-- wp:pattern {"slug":"extendable/hidden-search"} /-->
</div>
<!-- /wp:group -->

<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"layout":{"inherit":true},"tagName":"main"} -->
<main class="wp-block-query">
<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"align":"wide","style":{"spacing":{"padding":{"bottom":"var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dspacing\u002d\u002dmedium)","top":"var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dspacing\u002d\u002dmedium)"},"margin":{"top":"0px","bottom":"0px"}}},"layout":{"inherit":true}} -->
<div class="wp-block-query alignwide"
style="margin-top:0px;margin-bottom:0px;padding-top:var(--wp--custom--spacing--medium);padding-bottom:var(--wp--custom--spacing--medium)">
<!-- wp:post-template {"align":"wide"} -->
<!-- wp:group {"style":{"spacing":{"blockGap":"2.5rem"}},"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:post-featured-image {"isLink":true,"align":"wide"} /-->

<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:post-title {"isLink":true,"align":"wide","fontSize":"var(--wp--custom--typography--font-size--xx-large, clamp(2.25rem, 4vw, 2.75rem))"} /-->
<!-- wp:group {"style":{"spacing":{"blockGap":"1rem"}},"layout":{"inherit":false},"fontSize":"small"} -->
<div class="wp-block-group has-small-font-size">
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:post-featured-image {"isLink":true,"align":"wide","style":{"spacing":{"margin":{"top":"calc(1.75 * var(--wp--style--block-gap))"}}}} /-->
<!-- wp:group {"style":{"spacing":{"blockGap":"1.5rem"}},"layout":{"type":"flex","flexWrap":"wrap"}} -->
<div class="wp-block-group">
<!-- wp:post-date /-->

<!-- wp:columns {"align":"wide","style":{"spacing":{"margin":{"bottom":"0"}}}} -->
<div class="wp-block-columns alignwide" style="margin-bottom: 0;">
<!-- wp:column {"width":"650px"} -->
<div class="wp-block-column" style="flex-basis:650px">
<!-- wp:post-excerpt /-->

<!-- wp:post-date {"isLink":true,"format":"F j, Y"} /-->
</div>
<!-- /wp:column -->

<!-- wp:column {"width":""} -->
<div class="wp-block-column">
</div>
<!-- /wp:column -->
<!-- wp:post-terms {"term":"category"} /-->
</div>
<!-- /wp:columns -->

<!-- wp:spacer {"height":100} -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- /wp:group -->
</div>
<!-- /wp:group -->

<!-- wp:post-excerpt {"style":{"spacing":{"margin":{"top":"1.5rem"}}}} /-->
</div>
<!-- /wp:group -->

<!-- wp:spacer {"height":"3rem"} -->
<div style="height:3rem" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- /wp:post-template -->

<!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
<!-- wp:query-pagination-previous /-->
<!-- wp:query-pagination {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
<!-- wp:query-pagination-previous /-->

<!-- wp:query-pagination-numbers /-->
<!-- wp:query-pagination-numbers /-->

<!-- wp:query-pagination-next /-->
<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination -->

</main>
<!-- /wp:query -->
<!-- wp:query-no-results -->
<!-- wp:pattern {"slug":"extendable/hidden-no-results"} /-->
<!-- /wp:query-no-results -->

<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
</div>
<!-- /wp:query -->
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->