浏览代码

Make strings translatable + escaped.

Kjell Reigstad 4 年之前
父节点
当前提交
d00944b331
共有 2 个文件被更改,包括 16 次插入16 次删除
  1. 10 10
      blank-canvas/inc/block-patterns.php
  2. 6 6
      blank-canvas/inc/wpcom.php

+ 10 - 10
blank-canvas/inc/block-patterns.php

@@ -510,20 +510,20 @@ if ( ! function_exists( 'blank_canvas_register_block_patterns' ) ) :
 					'categories' => array( 'coming-soon' ),
 					'content'    => '<!-- wp:cover {"url":"https://mywptesting.site/wp-content/uploads/2021/03/pattern-links-gradient-scaled.jpg","id":2794,"dimRatio":0,"minHeight":100,"minHeightUnit":"vh","align":"full"} -->
 									<div class="wp-block-cover alignfull" style="min-height:100vh"><img class="wp-block-cover__image-background wp-image-2794" alt="" src="https://mywptesting.site/wp-content/uploads/2021/03/pattern-links-gradient-scaled.jpg" data-object-fit="cover"/><div class="wp-block-cover__inner-container"><!-- wp:heading {"textAlign":"center","align":"full","style":{"typography":{"fontSize":"20px","lineHeight":"1"}},"textColor":"background"} -->
-									<h2 class="alignfull has-text-align-center has-background-color has-text-color" style="font-size:20px;line-height:1"><strong><span class="uppercase">COMING SOON</span></strong></h2>
+									<h2 class="alignfull has-text-align-center has-background-color has-text-color" style="font-size:20px;line-height:1"><strong><span class="uppercase">' . esc_html__( 'COMING SOON', 'blank-canvas' ) . '</span></strong></h2>
 									<!-- /wp:heading -->
 
 									<!-- wp:heading {"textAlign":"center","level":3,"align":"full","style":{"typography":{"fontSize":"120px","lineHeight":"1"}}} -->
-									<h3 class="alignfull has-text-align-center" style="font-size:120px;line-height:1"><strong><span class="uppercase">Six Feet Over</span></strong></h3>
+									<h3 class="alignfull has-text-align-center" style="font-size:120px;line-height:1"><strong><span class="uppercase">' . esc_html__( 'Six Feet Over', 'blank-canvas' ) . '</span></strong></h3>
 									<!-- /wp:heading -->
 
 									<!-- wp:paragraph {"align":"center"} -->
-									<p class="has-text-align-center">A new album from Rage Slump coming April 2021. Follow us on BandCamp now to be the first to hear some sneak peeks of the album.</p>
+									<p class="has-text-align-center">' . esc_html__( 'A new album from Rage Slump coming April 2021. Follow us on BandCamp now to be the first to hear some sneak peeks of the album.', 'blank-canvas' ) . '</p>
 									<!-- /wp:paragraph -->
 
 									<!-- wp:buttons {"contentJustification":"center"} -->
 									<div class="wp-block-buttons is-content-justification-center"><!-- wp:button {"textColor":"background","className":"is-style-outline"} -->
-									<div class="wp-block-button is-style-outline"><a class="wp-block-button__link has-background-color has-text-color"><strong>FOLLOW US</strong></a></div>
+									<div class="wp-block-button is-style-outline"><a class="wp-block-button__link has-background-color has-text-color"><strong>' . esc_html__( 'FOLLOW US', 'blank-canvas' ) . '</strong></a></div>
 									<!-- /wp:button --></div>
 									<!-- /wp:buttons --></div></div>
 									<!-- /wp:cover -->',
@@ -539,7 +539,7 @@ if ( ! function_exists( 'blank_canvas_register_block_patterns' ) ) :
 									<div class="wp-block-cover alignfull has-primary-background-color" style="min-height:100vh"><video class="wp-block-cover__video-background intrinsic-ignore" autoplay muted loop playsinline src="https://mywptesting.site/wp-content/uploads/2021/03/Gradient-bluegreen-slower_low.mp4" data-object-fit="cover"></video><div class="wp-block-cover__inner-container"><!-- wp:columns {"align":"full"} -->
 									<div class="wp-block-columns alignfull"><!-- wp:column {"width":"75%"} -->
 									<div class="wp-block-column" style="flex-basis:75%"><!-- wp:heading {"style":{"typography":{"lineHeight":"1","fontSize":"125px"}}} -->
-									<h2 style="font-size:125px;line-height:1"><strong>The High Fives</strong></h2>
+									<h2 style="font-size:125px;line-height:1"><strong>' . esc_html__( 'The High Fives', 'blank-canvas' ) . '</strong></h2>
 									<!-- /wp:heading -->
 
 									<!-- wp:social-links {"align":"left"} -->
@@ -617,7 +617,7 @@ if ( ! function_exists( 'blank_canvas_register_block_patterns' ) ) :
 
 									<!-- wp:column {"width":"35%"} -->
 									<div class="wp-block-column" style="flex-basis:35%"><!-- wp:paragraph -->
-									<p><strong>OAK &amp; ANCHOR</strong></p>
+									<p><strong>' . esc_html__( 'OAK & ANCHOR', 'blank-canvas' ) . '</strong></p>
 									<!-- /wp:paragraph -->
 
 									<!-- wp:spacer {"height":250} -->
@@ -625,23 +625,23 @@ if ( ! function_exists( 'blank_canvas_register_block_patterns' ) ) :
 									<!-- /wp:spacer -->
 
 									<!-- wp:heading {"style":{"typography":{"fontSize":"64px"}}} -->
-									<h2 style="font-size:64px"><strong>Coming Soon</strong></h2>
+									<h2 style="font-size:64px"><strong>' . esc_html__( 'Coming Soon', 'blank-canvas' ) . '</strong></h2>
 									<!-- /wp:heading -->
 
 									<!-- wp:paragraph -->
-									<p>A new restaurant featuring farm-to-table dining.</p>
+									<p>' . esc_html__( 'A new restaurant featuring farm-to-table dining.', 'blank-canvas' ) . '</p>
 									<!-- /wp:paragraph -->
 
 									<!-- wp:columns -->
 									<div class="wp-block-columns"><!-- wp:column -->
 									<div class="wp-block-column"><!-- wp:paragraph -->
-									<p>1234 S Main Street<br>Townsville, MA, 01010</p>
+									<p>' . esc_html__( '1234 S Main Street', 'blank-canvas' ) . '<br>' . esc_html__( 'Townsville, MA, 01010', 'blank-canvas' ) . '</p>
 									<!-- /wp:paragraph --></div>
 									<!-- /wp:column -->
 
 									<!-- wp:column -->
 									<div class="wp-block-column"><!-- wp:paragraph {"style":{"color":{"text":"#ffffff","link":"#ffffff"}}} -->
-									<p class="has-text-color has-link-color" style="--wp--style--color--link:#ffffff;color:#ffffff"><a href="mailto:info@example.com">info@example.com<br></a>(123) 456-7890</p>
+									<p class="has-text-color has-link-color" style="--wp--style--color--link:#ffffff;color:#ffffff"><a href="mailto:info@example.com">' . esc_html__( 'info@example.com', 'blank-canvas' ) . '<br></a>(123) 456-7890</p>
 									<!-- /wp:paragraph --></div>
 									<!-- /wp:column --></div>
 									<!-- /wp:columns -->

+ 6 - 6
blank-canvas/inc/wpcom.php

@@ -225,11 +225,11 @@ if ( ! function_exists( 'blank_canvas_register_wpcom_block_patterns' ) ) :
 									<div class="wp-block-cover alignfull has-background-background-color has-background-dim" style="min-height:948px"><div class="wp-block-cover__inner-container"><!-- wp:columns {"align":"full"} -->
 									<div class="wp-block-columns alignfull"><!-- wp:column -->
 									<div class="wp-block-column"><!-- wp:heading {"textColor":"primary","style":{"typography":{"lineHeight":"0.9","fontSize":"120px"}}} -->
-									<h2 class="has-primary-color has-text-color" style="font-size:120px;line-height:0.9"><strong>Coming Soon</strong></h2>
+									<h2 class="has-primary-color has-text-color" style="font-size:120px;line-height:0.9"><strong>' . esc_html__( 'Coming Soon', 'blank-canvas' ) . '</strong></h2>
 									<!-- /wp:heading -->
 
 									<!-- wp:paragraph {"textColor":"primary"} -->
-									<p class="has-primary-color has-text-color">A new blog by MindStomp. Sign up to be notified when we launch.</p>
+									<p class="has-primary-color has-text-color">' . esc_html__( 'A new blog by MindStomp. Sign up to be notified when we launch.', 'blank-canvas' ) . '</p>
 									<!-- /wp:paragraph -->
 
 									<!-- wp:jetpack/subscriptions {"buttonBackgroundColor":"background","textColor":"primary","borderRadius":0,"borderWeight":3,"borderColor":"#000000","customBorderColor":"#000000"} -->
@@ -252,15 +252,15 @@ if ( ! function_exists( 'blank_canvas_register_wpcom_block_patterns' ) ) :
 					'categories' => array( 'coming-soon' ),
 					'content'    => '<!-- wp:media-text {"align":"full","mediaPosition":"right","mediaId":2787,"mediaLink":"https://mywptesting.site/coming-soon-colors/stocksnap_6embfcxu0j-cropped/","mediaType":"image","mediaWidth":54,"imageFill":false} -->
 									<div class="wp-block-media-text alignfull has-media-on-the-right is-stacked-on-mobile" style="grid-template-columns:auto 54%"><figure class="wp-block-media-text__media"><img src="https://mywptesting.site/wp-content/uploads/2021/03/StockSnap_6EMBFCXU0J-cropped-1024x778.jpg" alt="" class="wp-image-2787 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:heading {"style":{"color":{"text":"#2b353a"},"typography":{"fontSize":"50px","lineHeight":"1.2"}}} -->
-									<h2 class="has-text-color" style="color:#2b353a;font-size:50px;line-height:1.2"><strong>A new app for designers</strong></h2>
+									<h2 class="has-text-color" style="color:#2b353a;font-size:50px;line-height:1.2"><strong>' . esc_html__( 'A new app for designers', 'blank-canvas' ) . '</strong></h2>
 									<!-- /wp:heading -->
 
 									<!-- wp:paragraph {"textColor":"primary"} -->
-									<p class="has-primary-color has-text-color">We’re launching soon. Be the first to sign up!</p>
+									<p class="has-primary-color has-text-color">' . esc_html__( 'We’re launching soon. Be the first to sign up!', 'blank-canvas' ) . '</p>
 									<!-- /wp:paragraph -->
 
-									<!-- wp:jetpack/subscriptions {"submitButtonText":"\u003cstrong\u003eSIGN UP\u003c/strong\u003e","customButtonBackgroundColor":"#dfcbda","textColor":"primary","borderRadius":4,"padding":20} -->
-									<div class="wp-block-jetpack-subscriptions wp-block-jetpack-subscriptions__supports-newline">[jetpack_subscription_form show_subscribers_total="false" button_on_newline="false" submit_button_text="<strong>SIGN UP</strong>" custom_background_button_color="#dfcbda" custom_font_size="16px" custom_border_radius="4" custom_border_weight="1" custom_padding="20" custom_spacing="10" submit_button_classes="has-text-color has-primary-color" email_field_classes="" show_only_email_and_button="true"]</div>
+									<!-- wp:jetpack/subscriptions {"submitButtonText":"\u003cstrong\u003eSUBSCRIBE\u003c/strong\u003e","customButtonBackgroundColor":"#dfcbda","textColor":"primary","borderRadius":4,"padding":20} -->
+									<div class="wp-block-jetpack-subscriptions wp-block-jetpack-subscriptions__supports-newline">[jetpack_subscription_form show_subscribers_total="false" button_on_newline="false" submit_button_text="<strong>' . esc_html__( 'SUBSCRIBE', 'blank-canvas' ) . '</strong>" custom_background_button_color="#dfcbda" custom_font_size="16px" custom_border_radius="4" custom_border_weight="1" custom_padding="20" custom_spacing="10" submit_button_classes="has-text-color has-primary-color" email_field_classes="" show_only_email_and_button="true"]</div>
 									<!-- /wp:jetpack/subscriptions --></div></div>
 									<!-- /wp:media-text -->',
 				)