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>
This commit is contained in:
arthur791004 2022-10-28 23:43:41 +08:00 committed by GitHub
parent af6c6707d4
commit 721d8e8e04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 36 additions and 4 deletions

View file

@ -19,6 +19,8 @@ if ( ! function_exists( 'archeo_support' ) ) :
* @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' );

View file

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

View file

@ -1,6 +1,12 @@
<?php
if ( ! function_exists( '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.
add_theme_support( 'align-wide' );
@ -23,7 +29,7 @@ if ( ! function_exists( 'blockbase_support' ) ) :
// Enqueue editor styles.
add_editor_style(
array(
'/assets/ponyfill.css'
'/assets/ponyfill.css',
)
);

View file

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

View file

@ -19,6 +19,8 @@ if ( ! function_exists( 'livro_support' ) ) :
* @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' ) ),
);
/**

View file

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

View file

@ -19,6 +19,9 @@ if ( ! function_exists( 'pendant_support' ) ) :
* @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' );

View file

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

View file

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

View file

@ -19,6 +19,8 @@ if ( ! function_exists( 'remote_support' ) ) :
* @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' );

View file

@ -30,6 +30,8 @@ if ( ! function_exists( 'skatepark_support' ) ) :
* @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' );

View file

@ -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' );

View file

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