diff --git a/.changeset/nine-timers-eat.md b/.changeset/nine-timers-eat.md new file mode 100644 index 000000000..3a6e26a64 --- /dev/null +++ b/.changeset/nine-timers-eat.md @@ -0,0 +1,5 @@ +--- +'@faustwp/wordpress-plugin': patch +--- + +Ensure's any related translations will properly load by calling `load_text_domain` diff --git a/.gitignore b/.gitignore index 4eb2de83e..b2d4a139c 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ process.yml build/ examples/next/getting-started/package-lock.json faustjs.code-workspace + +# Ignore the WordPress source where used by various development environments +wordpress/ diff --git a/plugins/faustwp/includes/utilities/callbacks.php b/plugins/faustwp/includes/utilities/callbacks.php index 9e563c2cf..2d81aff2a 100644 --- a/plugins/faustwp/includes/utilities/callbacks.php +++ b/plugins/faustwp/includes/utilities/callbacks.php @@ -92,3 +92,15 @@ function handle_new_site_creation( $new_site ) { maybe_set_default_settings(); restore_current_blog(); } + +add_action( 'init', __NAMESPACE__ . '\\load_faustwp_textdomain' ); +/** + * Load the plugin text domain for translation. + * + * @link https://developer.wordpress.org/reference/hooks/init/ + * + * @return void + */ +function load_faustwp_textdomain() { + load_plugin_textdomain( 'faustwp', false, FAUSTWP_DIR . '/languages' ); +}