From 721d8e8e0486e1a0a5402fa6e2a92c1745be1ee8 Mon Sep 17 00:00:00 2001 From: arthur791004 Date: Fri, 28 Oct 2022 23:43:41 +0800 Subject: [PATCH] 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 --- archeo/functions.php | 2 ++ block-canvas/functions.php | 2 ++ blockbase/functions.php | 8 +++++++- disco/functions.php | 2 ++ livro/functions.php | 8 +++++--- loudness/functions.php | 2 ++ pendant/functions.php | 3 +++ pixl/functions.php | 2 ++ rainfall/functions.php | 3 +++ remote/functions.php | 2 ++ skatepark/functions.php | 2 ++ stewart/functions.php | 2 ++ vivre/functions.php | 2 ++ 13 files changed, 36 insertions(+), 4 deletions(-) diff --git a/archeo/functions.php b/archeo/functions.php index 2900a3de73..8205c8f295 100644 --- a/archeo/functions.php +++ b/archeo/functions.php @@ -19,6 +19,8 @@ * @return void */ function archeo_support() { + // Make theme available for translation. + load_theme_textdomain( 'archeo' ); // Add support for block styles. add_theme_support( 'wp-block-styles' ); diff --git a/block-canvas/functions.php b/block-canvas/functions.php index 0e642df19e..4187f2f2fe 100644 --- a/block-canvas/functions.php +++ b/block-canvas/functions.php @@ -23,6 +23,8 @@ function block_canvas_support() { // Enqueue editor styles. add_editor_style( 'style.css' ); + // Make theme available for translation. + load_theme_textdomain( 'block-canvas' ); } endif; diff --git a/blockbase/functions.php b/blockbase/functions.php index 02423118e1..0629802670 100644 --- a/blockbase/functions.php +++ b/blockbase/functions.php @@ -1,6 +1,12 @@ get( 'TextDomain' ) ) { + load_theme_textdomain( wp_get_theme()->get( 'TextDomain' ) ); + } + // Alignwide and alignfull classes in the block editor. add_theme_support( 'align-wide' ); @@ -23,7 +29,7 @@ function blockbase_support() { // Enqueue editor styles. add_editor_style( array( - '/assets/ponyfill.css' + '/assets/ponyfill.css', ) ); diff --git a/disco/functions.php b/disco/functions.php index 6b340bc45c..1bdca533aa 100644 --- a/disco/functions.php +++ b/disco/functions.php @@ -19,6 +19,8 @@ * @return void */ function disco_support() { + // Make theme available for translation. + load_theme_textdomain( 'disco' ); // Enqueue editor styles. add_editor_style( 'style.css' ); diff --git a/livro/functions.php b/livro/functions.php index 320e550c8f..f504f5b06c 100644 --- a/livro/functions.php +++ b/livro/functions.php @@ -19,6 +19,8 @@ * @return void */ function livro_support() { + // Make theme available for translation. + load_theme_textdomain( 'livro' ); // Add support for 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. $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' ) ), ); /** diff --git a/loudness/functions.php b/loudness/functions.php index 256fd654ad..69b43f6126 100644 --- a/loudness/functions.php +++ b/loudness/functions.php @@ -23,6 +23,8 @@ function loudness_support() { // Enqueue editor styles. add_editor_style( 'style.css' ); + // Make theme available for translation. + load_theme_textdomain( 'loudness' ); } endif; diff --git a/pendant/functions.php b/pendant/functions.php index 24c36cd738..e6634e2a08 100644 --- a/pendant/functions.php +++ b/pendant/functions.php @@ -19,6 +19,9 @@ * @return void */ function pendant_support() { + // Make theme available for translation. + load_theme_textdomain( 'pendant' ); + // Add support for block styles. add_theme_support( 'wp-block-styles' ); diff --git a/pixl/functions.php b/pixl/functions.php index d86e71afd3..ab8d7edfb1 100644 --- a/pixl/functions.php +++ b/pixl/functions.php @@ -23,6 +23,8 @@ function pixl_support() { // Enqueue editor styles. add_editor_style( 'style.css' ); + // Make theme available for translation. + load_theme_textdomain( 'pixl' ); } endif; diff --git a/rainfall/functions.php b/rainfall/functions.php index 0b4c86fb59..84685d1445 100644 --- a/rainfall/functions.php +++ b/rainfall/functions.php @@ -22,6 +22,9 @@ function rainfall_support() { // Enqueue editor styles. add_editor_style( 'style.css' ); + + // Make theme available for translation. + load_theme_textdomain( 'rainfall' ); } endif; diff --git a/remote/functions.php b/remote/functions.php index 239a70897c..1aab79854d 100644 --- a/remote/functions.php +++ b/remote/functions.php @@ -19,6 +19,8 @@ * @return void */ function remote_support() { + // Make theme available for translation. + load_theme_textdomain( 'remote' ); // Add support for block styles. add_theme_support( 'wp-block-styles' ); diff --git a/skatepark/functions.php b/skatepark/functions.php index 4f78b9634a..0dcd16b8a6 100644 --- a/skatepark/functions.php +++ b/skatepark/functions.php @@ -30,6 +30,8 @@ function skatepark_add_featured_image_class( $classes ) { * @return void */ function skatepark_support() { + // Make theme available for translation. + load_theme_textdomain( 'skatepark' ); // Add support for block styles. add_theme_support( 'wp-block-styles' ); diff --git a/stewart/functions.php b/stewart/functions.php index ce34baee0b..366178a18a 100644 --- a/stewart/functions.php +++ b/stewart/functions.php @@ -4,6 +4,8 @@ * Sets up theme defaults and registers support for various WordPress features. */ function stewart_support() { + // Make theme available for translation. + load_theme_textdomain( 'stewart' ); // Add support for block styles. add_theme_support( 'wp-block-styles' ); diff --git a/vivre/functions.php b/vivre/functions.php index dbbdf8091c..0af21e1d6d 100644 --- a/vivre/functions.php +++ b/vivre/functions.php @@ -19,6 +19,8 @@ * @return void */ function vivre_support() { + // Make theme available for translation. + load_theme_textdomain( 'vivre' ); // Enqueue editor styles. add_editor_style( 'style.css' );