Skip to content

Commit

Permalink
Make theme available for translation as much as possible (#6484)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
arthur791004 and pbking authored Oct 28, 2022
1 parent af6c670 commit 721d8e8
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 4 deletions.
2 changes: 2 additions & 0 deletions archeo/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
2 changes: 2 additions & 0 deletions block-canvas/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion blockbase/functions.php
Original file line number Diff line number Diff line change
@@ -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' );

Expand All @@ -23,7 +29,7 @@ function blockbase_support() {
// Enqueue editor styles.
add_editor_style(
array(
'/assets/ponyfill.css'
'/assets/ponyfill.css',
)
);

Expand Down
2 changes: 2 additions & 0 deletions disco/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
8 changes: 5 additions & 3 deletions livro/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down Expand Up @@ -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' ) ),
);

/**
Expand Down
2 changes: 2 additions & 0 deletions loudness/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions pendant/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

Expand Down
2 changes: 2 additions & 0 deletions pixl/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions rainfall/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions remote/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
2 changes: 2 additions & 0 deletions skatepark/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
2 changes: 2 additions & 0 deletions stewart/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
2 changes: 2 additions & 0 deletions vivre/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down

0 comments on commit 721d8e8

Please sign in to comment.