From fd70868a4b7c569ff5eeddfa36b71709c24b3555 Mon Sep 17 00:00:00 2001 From: Niels de Blaauw Date: Wed, 13 Mar 2019 09:42:41 +0100 Subject: Fixes #1, deprecates and replaces variable text domain usage This should be removed as it breaks compatibility with translate.wordpress.org --- .../PostmanConfigurationController.php | 140 ++++++++++----------- .../PostmanRegisterConfigurationSettings.php | 138 ++++++++++---------- 2 files changed, 139 insertions(+), 139 deletions(-) (limited to 'Postman/Postman-Configuration') diff --git a/Postman/Postman-Configuration/PostmanConfigurationController.php b/Postman/Postman-Configuration/PostmanConfigurationController.php index bc9c274..a58f18d 100644 --- a/Postman/Postman-Configuration/PostmanConfigurationController.php +++ b/Postman/Postman-Configuration/PostmanConfigurationController.php @@ -94,11 +94,11 @@ class PostmanConfigurationController { /** */ private function addLocalizeScriptsToPage() { - $warning = __( 'Warning', Postman::TEXT_DOMAIN ); + $warning = __( 'Warning', 'post-smtp' ); /* translators: where %s is the name of the SMTP server */ - wp_localize_script( 'postman_wizard_script', 'postman_smtp_mitm', sprintf( '%s: %s', $warning, __( 'connected to %1$s instead of %2$s.', Postman::TEXT_DOMAIN ) ) ); + wp_localize_script( 'postman_wizard_script', 'postman_smtp_mitm', sprintf( '%s: %s', $warning, __( 'connected to %1$s instead of %2$s.', 'post-smtp' ) ) ); /* translators: where %d is a port number */ - wp_localize_script( 'postman_wizard_script', 'postman_wizard_bad_redirect_url', __( 'You are about to configure OAuth 2.0 with an IP address instead of a domain name. This is not permitted. Either assign a real domain name to your site or add a fake one in your local host file.', Postman::TEXT_DOMAIN ) ); + wp_localize_script( 'postman_wizard_script', 'postman_wizard_bad_redirect_url', __( 'You are about to configure OAuth 2.0 with an IP address instead of a domain name. This is not permitted. Either assign a real domain name to your site or add a fake one in your local host file.', 'post-smtp' ) ); // user input wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_input_sender_email', '#input_' . PostmanOptions::MESSAGE_SENDER_EMAIL ); @@ -131,7 +131,7 @@ class PostmanConfigurationController { * Register the Configuration screen */ public function addConfigurationSubmenu() { - $page = add_submenu_page( null, sprintf( __( '%s Setup', Postman::TEXT_DOMAIN ), __( 'Postman SMTP', Postman::TEXT_DOMAIN ) ), __( 'Postman SMTP', Postman::TEXT_DOMAIN ), Postman::MANAGE_POSTMAN_CAPABILITY_NAME, PostmanConfigurationController::CONFIGURATION_SLUG, array( + $page = add_submenu_page( null, sprintf( __( '%s Setup', 'post-smtp' ), __( 'Postman SMTP', 'post-smtp' ) ), __( 'Postman SMTP', 'post-smtp' ), Postman::MANAGE_POSTMAN_CAPABILITY_NAME, PostmanConfigurationController::CONFIGURATION_SLUG, array( $this, 'outputManualConfigurationContent', ) ); @@ -155,7 +155,7 @@ class PostmanConfigurationController { * Register the Setup Wizard screen */ public function addSetupWizardSubmenu() { - $page = add_submenu_page( null, sprintf( __( '%s Setup', Postman::TEXT_DOMAIN ), __( 'Postman SMTP', Postman::TEXT_DOMAIN ) ), __( 'Postman SMTP', Postman::TEXT_DOMAIN ), Postman::MANAGE_POSTMAN_CAPABILITY_NAME, PostmanConfigurationController::CONFIGURATION_WIZARD_SLUG, array( + $page = add_submenu_page( null, sprintf( __( '%s Setup', 'post-smtp' ), __( 'Postman SMTP', 'post-smtp' ) ), __( 'Postman SMTP', 'post-smtp' ), Postman::MANAGE_POSTMAN_CAPABILITY_NAME, PostmanConfigurationController::CONFIGURATION_WIZARD_SLUG, array( $this, 'outputWizardContent', ) ); @@ -194,14 +194,14 @@ class PostmanConfigurationController { public function outputManualConfigurationContent() { print '
'; - PostmanViewController::outputChildPageHeader( __( 'Settings', Postman::TEXT_DOMAIN ), 'advanced_config' ); + PostmanViewController::outputChildPageHeader( __( 'Settings', 'post-smtp' ), 'advanced_config' ); print '
    '; - print sprintf( '
  • %s
  • ', __( 'Account', Postman::TEXT_DOMAIN ) ); - print sprintf( '
  • %s
  • ', __( 'Fallback', Postman::TEXT_DOMAIN ) ); - print sprintf( '
  • %s
  • ', __( 'Message', Postman::TEXT_DOMAIN ) ); - print sprintf( '
  • %s
  • ', __( 'Logging', Postman::TEXT_DOMAIN ) ); - print sprintf( '
  • %s
  • ', __( 'Advanced', Postman::TEXT_DOMAIN ) ); - print sprintf( '
  • %s
  • ', __( 'Notifications', Postman::TEXT_DOMAIN ) ); + print sprintf( '
  • %s
  • ', __( 'Account', 'post-smtp' ) ); + print sprintf( '
  • %s
  • ', __( 'Fallback', 'post-smtp' ) ); + print sprintf( '
  • %s
  • ', __( 'Message', 'post-smtp' ) ); + print sprintf( '
  • %s
  • ', __( 'Logging', 'post-smtp' ) ); + print sprintf( '
  • %s
  • ', __( 'Advanced', 'post-smtp' ) ); + print sprintf( '
  • %s
  • ', __( 'Notifications', 'post-smtp' ) ); print '
'; print '
'; @@ -239,29 +239,29 @@ class PostmanConfigurationController {
-

-

+

+

- + - + options->getFallbackHostname(); ?> - + options->getFallbackPort(); ?> - + __( 'None', Postman::TEXT_DOMAIN ), - 'ssl' => __( 'SSL', Postman::TEXT_DOMAIN ), - 'tls' => __( 'TLS', Postman::TEXT_DOMAIN ), + 'none' => __( 'None', 'post-smtp' ), + 'ssl' => __( 'SSL', 'post-smtp' ), + 'tls' => __( 'TLS', 'post-smtp' ), ); ?> - + - + - + - +
 
@@ -302,36 +302,36 @@ class PostmanConfigurationController {

- +
 
'; - PostmanViewController::outputChildPageHeader( __( 'Setup Wizard', Postman::TEXT_DOMAIN ) ); + PostmanViewController::outputChildPageHeader( __( 'Setup Wizard', 'post-smtp' ) ); print ''; @@ -440,12 +440,12 @@ class PostmanConfigurationController { settings_fields( PostmanAdminController::SETTINGS_GROUP_NAME ); // Wizard Step 0 - printf( '
%s
', _x( 'Import Configuration', 'Wizard Step Title', Postman::TEXT_DOMAIN ) ); + printf( '
%s
', _x( 'Import Configuration', 'Wizard Step Title', 'post-smtp' ) ); print '
'; - printf( '%s', _x( 'Import configuration from another plugin?', 'Wizard Step Title', Postman::TEXT_DOMAIN ) ); - printf( '

%s

', __( 'If you had a working configuration with another Plugin, the Setup Wizard can begin with those settings.', Postman::TEXT_DOMAIN ) ); + printf( '%s', _x( 'Import configuration from another plugin?', 'Wizard Step Title', 'post-smtp' ) ); + printf( '

%s

', __( 'If you had a working configuration with another Plugin, the Setup Wizard can begin with those settings.', 'post-smtp' ) ); print ''; - printf( '', 'none', __( 'None', Postman::TEXT_DOMAIN ) ); + printf( '', 'none', __( 'None', 'post-smtp' ) ); if ( $this->importableConfiguration->isImportAvailable() ) { foreach ( $this->importableConfiguration->getAvailableOptions() as $options ) { @@ -456,20 +456,20 @@ class PostmanConfigurationController { print ''; // Wizard Step 1 - printf( '
%s
', _x( 'Sender Details', 'Wizard Step Title', Postman::TEXT_DOMAIN ) ); + printf( '
%s
', _x( 'Sender Details', 'Wizard Step Title', 'post-smtp' ) ); print '
'; - printf( '%s', _x( 'Who is the mail coming from?', 'Wizard Step Title', Postman::TEXT_DOMAIN ) ); - printf( '

%s

', __( 'Enter the email address and name you\'d like to send mail as.', Postman::TEXT_DOMAIN ) ); - printf( '

%s

', __( 'Please note that to prevent abuse, many email services will not let you send from an email address other than the one you authenticate with.', Postman::TEXT_DOMAIN ) ); - printf( '', __( 'Email Address', Postman::TEXT_DOMAIN ) ); + printf( '%s', _x( 'Who is the mail coming from?', 'Wizard Step Title', 'post-smtp' ) ); + printf( '

%s

', __( 'Enter the email address and name you\'d like to send mail as.', 'post-smtp' ) ); + printf( '

%s

', __( 'Please note that to prevent abuse, many email services will not let you send from an email address other than the one you authenticate with.', 'post-smtp' ) ); + printf( '', __( 'Email Address', 'post-smtp' ) ); print $this->settingsRegistry->from_email_callback(); print '
'; - printf( '', __( 'Name', Postman::TEXT_DOMAIN ) ); + printf( '', __( 'Name', 'post-smtp' ) ); print $this->settingsRegistry->sender_name_callback(); print '
'; // Wizard Step 2 - printf( '
%s
', __( 'Outgoing Mail Server Hostname', Postman::TEXT_DOMAIN ) ); + printf( '
%s
', __( 'Outgoing Mail Server Hostname', 'post-smtp' ) ); print '
'; foreach ( PostmanTransportRegistry::getInstance()->getTransports() as $transport ) { $transport->printWizardMailServerHostnameStep(); @@ -477,11 +477,11 @@ class PostmanConfigurationController { print '
'; // Wizard Step 3 - printf( '
%s
', __( 'Connectivity Test', Postman::TEXT_DOMAIN ) ); + printf( '
%s
', __( 'Connectivity Test', 'post-smtp' ) ); print '
'; - printf( '%s', __( 'How will the connection to the mail server be established?', Postman::TEXT_DOMAIN ) ); - printf( '

%s

', __( 'Your connection settings depend on what your email service provider offers, and what your WordPress host allows.', Postman::TEXT_DOMAIN ) ); - printf( '

%s: %s

', __( 'Connectivity Test', Postman::TEXT_DOMAIN ), _x( 'Ready', 'TCP Port Test Status', Postman::TEXT_DOMAIN ) ); + printf( '%s', __( 'How will the connection to the mail server be established?', 'post-smtp' ) ); + printf( '

%s

', __( 'Your connection settings depend on what your email service provider offers, and what your WordPress host allows.', 'post-smtp' ) ); + printf( '

%s: %s

', __( 'Connectivity Test', 'post-smtp' ), _x( 'Ready', 'TCP Port Test Status', 'post-smtp' ) ); printf( '', plugins_url( 'post-smtp/style/ajax-loader.gif' ) ); printf( '', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::TRANSPORT_TYPE ); printf( '', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::PORT ); @@ -489,27 +489,27 @@ class PostmanConfigurationController { printf( '', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::AUTHENTICATION_TYPE ); print '

'; /* Translators: Where %1$s is the socket identifier and %2$s is the authentication type */ - printf( '

', _x( 'Socket', 'A socket is the network term for host and port together', Postman::TEXT_DOMAIN ) ); - printf( '', __( 'Authentication', Postman::TEXT_DOMAIN ) ); + printf( '', _x( 'Socket', 'A socket is the network term for host and port together', 'post-smtp' ) ); + printf( '', __( 'Authentication', 'post-smtp' ) ); print ('

') ; - $warning = __( 'Warning', Postman::TEXT_DOMAIN ); - $clearCredentialsWarning = __( 'This configuration option will send your authorization credentials in the clear.', Postman::TEXT_DOMAIN ); + $warning = __( 'Warning', 'post-smtp' ); + $clearCredentialsWarning = __( 'This configuration option will send your authorization credentials in the clear.', 'post-smtp' ); printf( '', $warning, $clearCredentialsWarning ); print '
'; // Wizard Step 4 - printf( '
%s
', __( 'Authentication', Postman::TEXT_DOMAIN ) ); + printf( '
%s
', __( 'Authentication', 'post-smtp' ) ); print '
'; - printf( '%s', __( 'How will you prove your identity to the mail server?', Postman::TEXT_DOMAIN ) ); + printf( '%s', __( 'How will you prove your identity to the mail server?', 'post-smtp' ) ); foreach ( PostmanTransportRegistry::getInstance()->getTransports() as $transport ) { $transport->printWizardAuthenticationStep(); } print '
'; // Wizard Step 5 - Notificiations - printf( '
%s
', __( 'Notifications', Postman::TEXT_DOMAIN ) ); + printf( '
%s
', __( 'Notifications', 'post-smtp' ) ); print '
'; - printf( '%s', __( 'Select a notify service to notify you when an email is failed to delivered.', Postman::TEXT_DOMAIN ) ); + printf( '%s', __( 'Select a notify service to notify you when an email is failed to delivered.', 'post-smtp' ) ); ?>