Skip to content

Commit 3761fd0

Browse files
committed
add translators comments and fix strings
1 parent 4cbd909 commit 3761fd0

File tree

12 files changed

+561
-339
lines changed

12 files changed

+561
-339
lines changed

inc/admin.php

Lines changed: 527 additions & 321 deletions
Large diffs are not rendered by default.

inc/api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private function request( $path, $method = 'GET', $params = [], $extra_headers =
198198

199199
if ( intval( $response['code'] ) !== 200 ) {
200200
if ( isset( $response['error'] ) && $response['error'] === 'domain_not_accessible' ) {
201-
return new WP_Error( 'domain_not_accessible', sprintf( __( 'It seems Optimole is having trouble reaching your website. This issue often occurs if your website is private, local, or protected by a firewall. But don\'t stress – it\'s an easy fix! Ensure your website is live and accessible to the public. If a firewall is in place, just tweak the settings to allow the %1$sOptimole(1.0)%2$s user agent access to your website. %3$sLearn More%4$s', 'optimole-wp' ), '<i>', '</i>', '<a href="https://docs.optimole.com/article/1976-resolving-optimole-access-to-your-website" target="_blank">', '</a>' ) );
201+
return new WP_Error( 'domain_not_accessible', sprintf( /* translators: 1 start of the italic tag, 2 is the end of italic tag, 3 is starting anchor tag, 4 is the ending anchor tag. */ __( 'It seems Optimole is having trouble reaching your website. This issue often occurs if your website is private, local, or protected by a firewall. But don\'t stress – it\'s an easy fix! Ensure your website is live and accessible to the public. If a firewall is in place, just tweak the settings to allow the %1$sOptimole(1.0)%2$s user agent access to your website. %3$sLearn More%4$s', 'optimole-wp' ), '<i>', '</i>', '<a href="https://docs.optimole.com/article/1976-resolving-optimole-access-to-your-website" target="_blank">', '</a>' ) );
202202
}
203203
if ( $path === 'optml/v2/account/complete_register_remote' && isset( $response['error'] ) ) {
204204
if ( strpos( $response['error'], 'This email address is already registered.' ) !== false ) {

inc/cli/cli_setting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function connect( $args ) {
3737
*
3838
* @var WP_Error $data Error object.
3939
*/
40-
$extra = sprintf( __( '. ERROR details: %s', 'optimole-wp' ), $data->get_error_message() );
40+
$extra = sprintf( /* translators: errors details */ __( '. ERROR details: %s', 'optimole-wp' ), $data->get_error_message() );
4141
}
4242

4343
return \WP_CLI::error( __( 'Can not connect to Optimole service', 'optimole-wp' ) . $extra );

inc/conflicts/divi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct() {
2323
* @access public
2424
*/
2525
public function define_message() {
26-
$this->message = sprintf( __( 'It seems your are using %1$sDivi%2$s right now. %3$s In order for Optimole to replace the images in your Divi pages, you will need to go to %4$sDivi -> Theme Options -> Builder -> Advanced -> Static CSS File Generations%5$s and click on Clear for the images to be processed. ', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=et_divi_options' ) . '">', '</a>' );
26+
$this->message = sprintf( /* translators: 1 is the start of the bold tag, 2 is ending bold tag, 3 is new line tag, 4 is anchor tag start, 5 is ending anchor tag */ __( 'It seems your are using %1$sDivi%2$s right now. %3$s In order for Optimole to replace the images in your Divi pages, you will need to go to %4$sDivi -> Theme Options -> Builder -> Advanced -> Static CSS File Generations%5$s and click on Clear for the images to be processed. ', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=et_divi_options' ) . '">', '</a>' );
2727
}
2828

2929

inc/conflicts/jetpack_lazyload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct() {
2222
* @access public
2323
*/
2424
public function define_message() {
25-
$this->message = sprintf( __( 'It seems your are using %1$sJetpack%2$s with Lazy loading option ON. %3$s Optimole already provides a lazy loading mechanism by it\'s own which might conflict with this. If you would like to further use Optimole lazy loading feature, you can turn that off from %4$sJetpack -> Perfomance%5$s page. ', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=jetpack#/performance' ) . '">', '</a>' );
25+
$this->message = sprintf( /* translators: 1 is the start of the bold tag, 2 is ending bold tag, 3 is new line tag, 4 is anchor tag start, 5 is ending anchor tag */__( 'It seems your are using %1$sJetpack%2$s with Lazy loading option ON. %3$s Optimole already provides a lazy loading mechanism by it\'s own which might conflict with this. If you would like to further use Optimole lazy loading feature, you can turn that off from %4$sJetpack -> Perfomance%5$s page. ', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=jetpack#/performance' ) . '">', '</a>' );
2626
}
2727

2828
/**

inc/conflicts/jetpack_photon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct() {
2323
* @access public
2424
*/
2525
public function define_message() {
26-
$this->message = sprintf( __( 'It seems your are using %1$sJetpack%2$s with site accelerator option enabled for images. %3$s To avoid any possible conflicts with Optimole replacement mechanism, you can go to %4$sJetpack -> Perfomance%5$s and turn off the site accelerator option for %6$simages%7$s ', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=jetpack#/performance' ) . '">', '</a>', '<b>', '</b>' );
26+
$this->message = sprintf( /* translators: 1 is the start of the bold tag, 2 is ending bold tag, 3 is new line tag, 4 is anchor tag start, 5 is ending anchor tag, 6 is start of bold tag, 7 is ending bold tag */ __( 'It seems your are using %1$sJetpack%2$s with site accelerator option enabled for images. %3$s To avoid any possible conflicts with Optimole replacement mechanism, you can go to %4$sJetpack -> Perfomance%5$s and turn off the site accelerator option for %6$simages%7$s', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=jetpack#/performance' ) . '">', '</a>', '<b>', '</b>' );
2727
}
2828

2929
/**

inc/conflicts/w3_total_cache_cdn.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ public function __construct() {
2222
* @access public
2323
*/
2424
public function define_message() {
25-
$this->message = sprintf( __( 'It seems your are using W3 Total Cache. %1$s If you are using the css or javascript minify/combine option from %2$sW3 Total Cache -> Perfomance -> Minify page.%3$s %1$s Add this line: %4$s to Include external files/libraries and check Use regular expressions for file matching checkbox. ', 'optimole-wp' ), '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=w3tc_minify' ) . '">', '</a>', 'https://' . Optml_Main::instance()->admin->settings->get_cdn_url() . '/*' );
25+
26+
/* translators: 1 is new line tag, 2 is the starting anchor tag, 3 is the ending anchor tag and 4 is the domain name of Optimole */
27+
$this->message = sprintf( __( 'It seems your are using W3 Total Cache. %1$s If you are using the CSS or JavaScript minify/combine option from %2$sW3 Total Cache -> Performance -> Minify page %3$s %1$s add this line: %4$s to Include external files/libraries and check Use regular expressions for file matching checkbox.', 'optimole-wp' ), '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=w3tc_minify' ) . '">', '</a>', 'https://' . Optml_Main::instance()->admin->settings->get_cdn_url() . '/*' );
2628
}
2729

2830
/**

inc/conflicts/wprocket.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct() {
2222
* @access public
2323
*/
2424
public function define_message() {
25-
$this->message = sprintf( __( 'It seems your are using %1$sWP Rocket%2$s with Lazy loading for images option active. %3$s Optimole already provides a lazy loading mechanism by it\'s own which might conflict with this. If you would like to further use Optimole lazy loading feature, you can turn that off from %4$sSettings -> WP Rocket -> Media%5$s page. ', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'options-general.php?page=wprocket#media' ) . '">', '</a>' );
25+
$this->message = sprintf( /* translators: 1 is the start of the bold tag, 2 is ending bold tag, 3 is new line tag, 4 is anchor tag start, 5 is ending anchor tag */__( 'It seems your are using %1$sWP Rocket%2$s with Lazy loading for images option active. %3$s Optimole already provides a lazy loading mechanism by it\'s own which might conflict with this. If you would like to further use Optimole lazy loading feature, you can turn that off from %4$sSettings -> WP Rocket -> Media%5$s page.', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'options-general.php?page=wprocket#media' ) . '">', '</a>' );
2626
}
2727

2828
/**

inc/rest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public function connect( WP_REST_Request $request ) {
281281
*
282282
* @var WP_Error $data Error object.
283283
*/
284-
$extra = sprintf( __( '. ERROR details: %s', 'optimole-wp' ), $data->get_error_message() );
284+
$extra = sprintf( /* translators: Error details */ __( '. ERROR details: %s', 'optimole-wp' ), $data->get_error_message() );
285285
}
286286
return $this->response( __( 'Can not connect to Optimole service', 'optimole-wp' ) . $extra, 400 );
287287
}
@@ -318,7 +318,7 @@ public function select_application( WP_REST_Request $request ) {
318318
*
319319
* @var WP_Error $data Error object.
320320
*/
321-
$extra = sprintf( __( '. ERROR details: %s', 'optimole-wp' ), $data->get_error_message() );
321+
$extra = sprintf( /* translators: Error details */ __( '. ERROR details: %s', 'optimole-wp' ), $data->get_error_message() );
322322
}
323323
wp_send_json_error( __( 'Can not connect to Optimole service', 'optimole-wp' ) . $extra );
324324
}
@@ -392,7 +392,7 @@ public function register_service( WP_REST_Request $request ) {
392392
return new WP_REST_Response(
393393
[
394394
'data' => null,
395-
'message' => sprintf( __( 'Error: This site has been previously registered. You can login to your account from %1$shere%2$s ', 'optimole-wp' ), '<a href="https://dashboard.optimole.com/login" target="_blank"> ', '</a>' ),
395+
'message' => sprintf( /* translators: 1 start anchor tag to register page, 2 is ending anchor tag. */ __( 'Error: This site has been previously registered. You can login to your account from %1$shere%2$s', 'optimole-wp' ), '<a href="https://dashboard.optimole.com/login" target="_blank"> ', '</a>' ),
396396
'code' => 'site_exists',
397397
],
398398
200
@@ -652,7 +652,7 @@ public function add_watermark( WP_REST_Request $request ) {
652652
return $this->response( __( 'Error uploading image. Please try again.', 'optimole-wp' ), 'error' );
653653
}
654654

655-
return $this->response( __( 'Watermark image uploaded succesfully ! ', 'optimole-wp' ) );
655+
return $this->response( __( 'Watermark image uploaded succesfully !', 'optimole-wp' ) );
656656
}
657657

658658
/**
@@ -771,7 +771,7 @@ public function check_redirects( WP_REST_Request $request ) {
771771
$processed_images = count( $value['src'] );
772772
}
773773
if ( isset( $value['ignoredUrls'] ) && $value['ignoredUrls'] > $processed_images ) {
774-
$result .= '<li>❌ ' . sprintf( __( 'The images from: %1$s are not optimized by Optimole. If you would like to do so, you can follow this: %2$sWhy Optimole does not optimize all the images from my site?%3$s.', 'optimole-wp' ), $domain, '<a target="_blank" href="https://docs.optimole.com/article/1290-how-to-optimize-images-using-optimole-from-my-domain">', '</a>' ) . '</li>';
774+
$result .= '<li>❌ ' . sprintf( /* translators: 1 is the domain name, 2 is starting anchor tag, 3 is the ending anchor tag. */__( 'The images from: %1$s are not optimized by Optimole. If you would like to do so, you can follow this: %2$sWhy Optimole does not optimize all the images from my site?%3$s.', 'optimole-wp' ), $domain, '<a target="_blank" href="https://docs.optimole.com/article/1290-how-to-optimize-images-using-optimole-from-my-domain">', '</a>' ) . '</li>';
775775
$status = 'log';
776776
continue;
777777
}
@@ -783,19 +783,19 @@ public function check_redirects( WP_REST_Request $request ) {
783783
$status_code = $response['response']['code'];
784784
if ( $status_code === 301 ) {
785785
$status = 'deactivated';
786-
$result = '<li>❌ ' . sprintf( __( 'Your account is currently disabled due to exceeding quota and Optimole is no longer able to optimize the images. In order to fix this you will need to %1$supgrade%2$s.', 'optimole-wp' ), '<a target="_blank" href="https://optimole.com/pricing">', '</a>' ) . '</li>';
786+
$result = '<li>❌ ' . sprintf( /* translators: 1 is starting anchor tag, 2 is the ending anchor tag. */ __( 'Your account is currently disabled due to exceeding quota and Optimole is no longer able to optimize the images. In order to fix this you will need to %1$supgrade%2$s.', 'optimole-wp' ), '<a target="_blank" href="https://optimole.com/pricing">', '</a>' ) . '</li>';
787787
break;
788788
}
789789
if ( $status_code === 302 ) {
790790
if ( isset( $headers['x-redirect-o'] ) ) {
791791
$optimole_code = (int) $headers['x-redirect-o'];
792792
if ( $optimole_code === 1 ) {
793793
$status = 'log';
794-
$result .= '<li>❌ ' . sprintf( __( 'The domain: %1$s is not allowed to optimize images using your Optimole account. You can add this to the allowed list %2$shere%3$s.', 'optimole-wp' ), '<b>' . $domain . '</b>', '<a target="_blank" href="https://dashboard.optimole.com/whitelist">', '</a>' ) . '</li>';
794+
$result .= '<li>❌ ' . sprintf( /* translators: 1 is the domain, 2 is starting anchor tag, 3 is the ending anchor tag. */ __( 'The domain: %1$s is not allowed to optimize images using your Optimole account. You can add this to the allowed list %2$shere%3$s.', 'optimole-wp' ), '<b>' . $domain . '</b>', '<a target="_blank" href="https://dashboard.optimole.com/whitelist">', '</a>' ) . '</li>';
795795
}
796796
if ( $optimole_code === 4 ) {
797797
$status = 'log';
798-
$result .= '<li>❌ ' . sprintf( __( 'We are not able to download the images from %1$s. Please check %2$sthis%3$s document for a more advanced guide on how to solve this. ', 'optimole-wp' ), '<b>' . $domain . '</b>', '<a target="_blank" href="https://docs.optimole.com/article/1291-why-optimole-is-not-able-to-download-the-images-from-my-site">', '</a>' ) . '<br />' . '</li>';
798+
$result .= '<li>❌ ' . sprintf( /* translators: 1 is the domain, 2 is starting anchor tag, 3 is the ending anchor tag. */ __( 'We are not able to download the images from %1$s. Please check %2$sthis%3$s document for a more advanced guide on how to solve this.', 'optimole-wp' ), '<b>' . $domain . '</b>', '<a target="_blank" href="https://docs.optimole.com/article/1291-why-optimole-is-not-able-to-download-the-images-from-my-site">', '</a>' ) . '<br />' . '</li>';
799799
}
800800
}
801801
}

inc/settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ public function clear_cache( $type = '' ) {
758758
*
759759
* @var WP_Error $data Error object.
760760
*/
761-
$extra = sprintf( __( '. ERROR details: %s', 'optimole-wp' ), $data->get_error_message() );
761+
$extra = sprintf( /* translators: Error details */ __( '. ERROR details: %s', 'optimole-wp' ), $data->get_error_message() );
762762
}
763763

764764
return new WP_Error( 'optimole_cache_buster_error', __( 'Can not get new token from Optimole service', 'optimole-wp' ) . $extra );

0 commit comments

Comments
 (0)