Automattic\WooCommerce\Internal\Admin

Translations::potentially_generate_translation_strings()publicWC 1.0

Run when plugin is activated (can be WooCommerce or WooCommerce Admin).

Method of the class: Translations{}

No Hooks.

Return

null. Nothing (null).

Usage

$Translations = new Translations();
$Translations->potentially_generate_translation_strings( $filename );
$filename(string) (required)
Activated plugin filename.

Translations::potentially_generate_translation_strings() code WC 8.7.0

public function potentially_generate_translation_strings( $filename ) {
	$plugin_domain           = explode( '/', plugin_basename( __FILE__ ) )[0];
	$activated_plugin_domain = explode( '/', $filename )[0];

	// Ensure we're only running only on activation hook that originates from our plugin.
	if ( $plugin_domain === $activated_plugin_domain ) {
		$this->generate_translation_strings();
	}
}