Browse Source

Make theme available for translation as much as possible (#6484)

* Add the load_theme_textdomain function call

* Fix incorrect domain

* Load blockbase translations

* Moved all calls to load_theme_textdomain to be handled by Blockbase (not the children)

* Refactored calls to load_theme_textdomain to not include the default location to simplify the call

* Added load_theme_textdomain call to block canvas

* Removed unrelated videomaker changes

Co-authored-by: Jason Crist <jcrist@pbking.com>
arthur791004 2 years ago
parent
commit
721d8e8e04

+ 2 - 0
archeo/functions.php

@@ -19,6 +19,8 @@ if ( ! function_exists( 'archeo_support' ) ) :
 	 * @return void
 	 * @return void
 	 */
 	 */
 	function archeo_support() {
 	function archeo_support() {
+		// Make theme available for translation.
+		load_theme_textdomain( 'archeo' );
 
 
 		// Add support for block styles.
 		// Add support for block styles.
 		add_theme_support( 'wp-block-styles' );
 		add_theme_support( 'wp-block-styles' );

+ 2 - 0
block-canvas/functions.php

@@ -23,6 +23,8 @@ if ( ! function_exists( 'block_canvas_support' ) ) :
 		// Enqueue editor styles.
 		// Enqueue editor styles.
 		add_editor_style( 'style.css' );
 		add_editor_style( 'style.css' );
 
 
+		// Make theme available for translation.
+		load_theme_textdomain( 'block-canvas' );
 	}
 	}
 
 
 endif;
 endif;

+ 7 - 1
blockbase/functions.php

@@ -1,6 +1,12 @@
 <?php
 <?php
 if ( ! function_exists( 'blockbase_support' ) ) :
 if ( ! function_exists( 'blockbase_support' ) ) :
 	function blockbase_support() {
 	function blockbase_support() {
+		// Make theme available for translation.
+		load_theme_textdomain( 'blockbase' );
+		if ( ! 'blockbase' === wp_get_theme()->get( 'TextDomain' ) ) {
+			load_theme_textdomain( wp_get_theme()->get( 'TextDomain' ) );
+		}
+
 		// Alignwide and alignfull classes in the block editor.
 		// Alignwide and alignfull classes in the block editor.
 		add_theme_support( 'align-wide' );
 		add_theme_support( 'align-wide' );
 
 
@@ -23,7 +29,7 @@ if ( ! function_exists( 'blockbase_support' ) ) :
 		// Enqueue editor styles.
 		// Enqueue editor styles.
 		add_editor_style(
 		add_editor_style(
 			array(
 			array(
-				'/assets/ponyfill.css'
+				'/assets/ponyfill.css',
 			)
 			)
 		);
 		);
 
 

+ 2 - 0
disco/functions.php

@@ -19,6 +19,8 @@ if ( ! function_exists( 'disco_support' ) ) :
 	 * @return void
 	 * @return void
 	 */
 	 */
 	function disco_support() {
 	function disco_support() {
+		// Make theme available for translation.
+		load_theme_textdomain( 'disco' );
 
 
 		// Enqueue editor styles.
 		// Enqueue editor styles.
 		add_editor_style( 'style.css' );
 		add_editor_style( 'style.css' );

+ 5 - 3
livro/functions.php

@@ -19,6 +19,8 @@ if ( ! function_exists( 'livro_support' ) ) :
 	 * @return void
 	 * @return void
 	 */
 	 */
 	function livro_support() {
 	function livro_support() {
+		// Make theme available for translation.
+		load_theme_textdomain( 'livro' );
 
 
 		// Add support for block styles.
 		// Add support for block styles.
 		add_theme_support( 'wp-block-styles' );
 		add_theme_support( 'wp-block-styles' );
@@ -75,9 +77,9 @@ function livro_register_block_pattern_categories() {
 
 
 	//Needed until https://github.com/WordPress/gutenberg/issues/39500 is fixed.
 	//Needed until https://github.com/WordPress/gutenberg/issues/39500 is fixed.
 	$block_pattern_categories = array(
 	$block_pattern_categories = array(
-		'pages'    => array( 'label' => __( 'Pages', 'livro' ) ),
-		'footer'   => array( 'label' => __( 'Footers', 'livro' ) ),
-		'header'   => array( 'label' => __( 'Headers', 'livro' ) )
+		'pages'  => array( 'label' => __( 'Pages', 'livro' ) ),
+		'footer' => array( 'label' => __( 'Footers', 'livro' ) ),
+		'header' => array( 'label' => __( 'Headers', 'livro' ) ),
 	);
 	);
 
 
 	/**
 	/**

+ 2 - 0
loudness/functions.php

@@ -23,6 +23,8 @@ if ( ! function_exists( 'loudness_support' ) ) :
 		// Enqueue editor styles.
 		// Enqueue editor styles.
 		add_editor_style( 'style.css' );
 		add_editor_style( 'style.css' );
 
 
+		// Make theme available for translation.
+		load_theme_textdomain( 'loudness' );
 	}
 	}
 
 
 endif;
 endif;

+ 3 - 0
pendant/functions.php

@@ -19,6 +19,9 @@ if ( ! function_exists( 'pendant_support' ) ) :
 	 * @return void
 	 * @return void
 	 */
 	 */
 	function pendant_support() {
 	function pendant_support() {
+		// Make theme available for translation.
+		load_theme_textdomain( 'pendant' );
+
 		// Add support for block styles.
 		// Add support for block styles.
 		add_theme_support( 'wp-block-styles' );
 		add_theme_support( 'wp-block-styles' );
 
 

+ 2 - 0
pixl/functions.php

@@ -23,6 +23,8 @@ if ( ! function_exists( 'pixl_support' ) ) :
 		// Enqueue editor styles.
 		// Enqueue editor styles.
 		add_editor_style( 'style.css' );
 		add_editor_style( 'style.css' );
 
 
+		// Make theme available for translation.
+		load_theme_textdomain( 'pixl' );
 	}
 	}
 
 
 endif;
 endif;

+ 3 - 0
rainfall/functions.php

@@ -22,6 +22,9 @@ if ( ! function_exists( 'rainfall_support' ) ) :
 
 
 		// Enqueue editor styles.
 		// Enqueue editor styles.
 		add_editor_style( 'style.css' );
 		add_editor_style( 'style.css' );
+
+		// Make theme available for translation.
+		load_theme_textdomain( 'rainfall' );
 	}
 	}
 
 
 endif;
 endif;

+ 2 - 0
remote/functions.php

@@ -19,6 +19,8 @@ if ( ! function_exists( 'remote_support' ) ) :
 	 * @return void
 	 * @return void
 	 */
 	 */
 	function remote_support() {
 	function remote_support() {
+		// Make theme available for translation.
+		load_theme_textdomain( 'remote' );
 
 
 		// Add support for block styles.
 		// Add support for block styles.
 		add_theme_support( 'wp-block-styles' );
 		add_theme_support( 'wp-block-styles' );

+ 2 - 0
skatepark/functions.php

@@ -30,6 +30,8 @@ if ( ! function_exists( 'skatepark_support' ) ) :
 	 * @return void
 	 * @return void
 	 */
 	 */
 	function skatepark_support() {
 	function skatepark_support() {
+		// Make theme available for translation.
+		load_theme_textdomain( 'skatepark' );
 
 
 		// Add support for block styles.
 		// Add support for block styles.
 		add_theme_support( 'wp-block-styles' );
 		add_theme_support( 'wp-block-styles' );

+ 2 - 0
stewart/functions.php

@@ -4,6 +4,8 @@
  * Sets up theme defaults and registers support for various WordPress features.
  * Sets up theme defaults and registers support for various WordPress features.
  */
  */
 function stewart_support() {
 function stewart_support() {
+	// Make theme available for translation.
+	load_theme_textdomain( 'stewart' );
 
 
 	// Add support for block styles.
 	// Add support for block styles.
 	add_theme_support( 'wp-block-styles' );
 	add_theme_support( 'wp-block-styles' );

+ 2 - 0
vivre/functions.php

@@ -19,6 +19,8 @@ if ( ! function_exists( 'vivre_support' ) ) :
 	 * @return void
 	 * @return void
 	 */
 	 */
 	function vivre_support() {
 	function vivre_support() {
+		// Make theme available for translation.
+		load_theme_textdomain( 'vivre' );
 
 
 		// Enqueue editor styles.
 		// Enqueue editor styles.
 		add_editor_style( 'style.css' );
 		add_editor_style( 'style.css' );