| 1 |
<?php |
| 2 |
/** |
| 3 |
* WPSEO plugin file. |
| 4 |
* |
| 5 |
* @package WPSEO\Admin |
| 6 |
*/ |
| 7 |
|
| 8 |
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Reason: The class is deprecated. |
| 9 |
|
| 10 |
/** |
| 11 |
* Class to print out the translatable strings for the Add Keyword modal. |
| 12 |
* |
| 13 |
* @deprecated 15.5 |
| 14 |
*/ |
| 15 |
class WPSEO_Add_Keyword_Modal { |
| 16 |
|
| 17 |
/** |
| 18 |
* Returns the translations for the Add Keyword modal. |
| 19 |
* |
| 20 |
* These strings are not escaped because they're meant to be used with React |
| 21 |
* which already takes care of that. If used in PHP, they should be escaped. |
| 22 |
* |
| 23 |
* @deprecated 15.5 |
| 24 |
* @codeCoverageIgnore |
| 25 |
* |
| 26 |
* @return array Translated text strings for the Add Keyword modal. |
| 27 |
*/ |
| 28 |
public function get_translations() { |
| 29 |
_deprecated_function( __METHOD__, 'WPSEO 15.5' ); |
| 30 |
|
| 31 |
return [ |
| 32 |
'title' => __( 'Would you like to add more than one keyphrase?', 'wordpress-seo' ), |
| 33 |
'intro' => sprintf( |
| 34 |
/* translators: %s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */ |
| 35 |
__( 'Great news: you can, with %s!', 'wordpress-seo' ), |
| 36 |
'{{link}}Yoast SEO Premium{{/link}}' |
| 37 |
), |
| 38 |
'link' => WPSEO_Shortlinker::get( 'https://yoa.st/pe-premium-page' ), |
| 39 |
'other' => sprintf( |
| 40 |
/* translators: %s expands to 'Yoast SEO Premium'. */ |
| 41 |
__( 'Other benefits of %s for you:', 'wordpress-seo' ), |
| 42 |
'Yoast SEO Premium' |
| 43 |
), |
| 44 |
'buylink' => WPSEO_Shortlinker::get( 'https://yoa.st/add-keywords-popup' ), |
| 45 |
'buy' => sprintf( |
| 46 |
/* translators: %s expands to 'Yoast SEO Premium'. */ |
| 47 |
__( 'Get %s', 'wordpress-seo' ), |
| 48 |
'Yoast SEO Premium' |
| 49 |
), |
| 50 |
'small' => __( '1 year free support and updates included!', 'wordpress-seo' ), |
| 51 |
'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ), |
| 52 |
]; |
| 53 |
} |
| 54 |
|
| 55 |
/** |
| 56 |
* Passes translations to JS for the Add Keyword modal component. |
| 57 |
* |
| 58 |
* @deprecated 15.5 |
| 59 |
* @codeCoverageIgnore |
| 60 |
* |
| 61 |
* @return array Translated text strings for the Add Keyword modal component. |
| 62 |
*/ |
| 63 |
public function get_translations_for_js() { |
| 64 |
_deprecated_function( __METHOD__, 'WPSEO 15.5' ); |
| 65 |
|
| 66 |
$translations = $this->get_translations(); |
| 67 |
return [ |
| 68 |
'locale' => get_user_locale(), |
| 69 |
'intl' => $translations, |
| 70 |
]; |
| 71 |
} |
| 72 |
|
| 73 |
/** |
| 74 |
* Prints the localized Add Keyword modal translations for JS. |
| 75 |
* |
| 76 |
* @deprecated 15.5 |
| 77 |
* @codeCoverageIgnore |
| 78 |
*/ |
| 79 |
public function enqueue_translations() { |
| 80 |
_deprecated_function( __METHOD__, 'WPSEO 15.5' ); |
| 81 |
|
| 82 |
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'admin-global-script', 'yoastAddKeywordModalL10n', $this->get_translations_for_js() ); |
| 83 |
} |
| 84 |
} |
| 85 |
|