Skip to content

Commit

Permalink
#830 load_plugin_textdomain() を init から後に変更
Browse files Browse the repository at this point in the history
  • Loading branch information
inc2734 committed Nov 6, 2024
1 parent 029a687 commit 8c6b8de
Show file tree
Hide file tree
Showing 3 changed files with 1,436 additions and 480 deletions.
10 changes: 9 additions & 1 deletion App/Setup/TextDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@ class TextDomain {
*/
public function __construct() {
add_filter( 'load_textdomain_mofile', array( $this, '_load_textdomain_mofile' ), 10, 2 );
load_plugin_textdomain( 'snow-monkey-blocks', false, basename( SNOW_MONKEY_BLOCKS_DIR_PATH ) . '/languages' );

add_action( 'init', array( $this, '_init' ), 11 );
add_action( 'enqueue_block_assets', array( $this, '_enqueue_block_assets' ), 11 );
}

/**
* Load textdomain.
*/
public function _init() {
load_plugin_textdomain( 'snow-monkey-blocks', false, basename( SNOW_MONKEY_BLOCKS_DIR_PATH ) . '/languages' );
}

/**
* When local .mo file exists, load this.
*
Expand Down
Loading

0 comments on commit 8c6b8de

Please sign in to comment.