Skip to content

Commit 5b73011

Browse files
committed
Make integration name translation lazy, fixing #3
1 parent 6beab07 commit 5b73011

6 files changed

Lines changed: 8 additions & 6 deletions

conversion-tracking.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function __construct() {
8181

8282
register_activation_hook( __FILE__, array( $this, 'activate' ) );
8383

84-
// Add High Performance Order Storage Support
84+
// // Add High Performance Order Storage Support
8585
add_action( 'before_woocommerce_init', [ $this, 'declare_woocommerce_feature_compatibility' ] );
8686

8787
do_action( 'wcct_loaded' );

includes/class-abstract-integration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,12 @@ public function get_id() {
6565

6666
/**
6767
* Get the integration name
68+
* Lazy translation so that we don't trigger autoload of the woocommerce-conversion-tracking textdomain
6869
*
6970
* @return string
7071
*/
7172
public function get_name() {
72-
return $this->name;
73+
return __( $this->name, 'woocommerce-conversion-tracking' );
7374
}
7475

7576
/**

includes/integrations/class-integration-custom.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class WCCT_Integration_Custom extends WCCT_Integration {
1010
*/
1111
function __construct() {
1212
$this->id = 'custom';
13-
$this->name = __( 'Custom', 'woocommerce-conversion-tracking' );
13+
$this->name = 'Custom';
1414
$this->enabled = true;
1515
$this->supports = array(
1616
'checkout',

includes/integrations/class-integration-facebook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class WCCT_Integration_Facebook extends WCCT_Integration {
1010
*/
1111
function __construct() {
1212
$this->id = 'facebook';
13-
$this->name = __( 'Facebook', 'woocommerce-conversion-tracking' );
13+
$this->name = 'Facebook';
1414
$this->enabled = true;
1515
$this->supports = array(
1616
'add_to_cart',

includes/integrations/class-integration-google.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class WCCT_Integration_Google extends WCCT_Integration {
1010
*/
1111
function __construct() {
1212
$this->id = 'adwords';
13-
$this->name = __( 'Google Ads', 'woocommerce-conversion-tracking' );
13+
// $this->name = __( 'Google Ads', 'woocommerce-conversion-tracking' );
14+
$this->name = 'Google Ads';
1415
$this->enabled = true;
1516
$this->supports = array(
1617
'checkout',

includes/integrations/class-integration-twitter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class WCCT_Integration_Twitter extends WCCT_Integration {
1010
*/
1111
function __construct() {
1212
$this->id = 'twitter';
13-
$this->name = __( 'Twitter', 'woocommerce-conversion-tracking' );
13+
$this->name = 'Twitter';
1414
$this->enabled = true;
1515
$this->supports = array(
1616
'checkout',

0 commit comments

Comments
 (0)