Skip to content

Commit

Permalink
Load plugin textdomain (#1877)
Browse files Browse the repository at this point in the history
* Ignore the WordPress source code.

* fix: Load the plugin's text domain to allow translations to be utilized.

* Add changeset
  • Loading branch information
ChrisWiegman committed Apr 15, 2024
1 parent f946d7a commit bced682
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-timers-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@faustwp/wordpress-plugin': patch
---

Ensure's any related translations will properly load by calling `load_text_domain`
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
12 changes: 12 additions & 0 deletions plugins/faustwp/includes/utilities/callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}

0 comments on commit bced682

Please sign in to comment.