Version Description
- Rearranged and renamed some languages in the options dropdown
- Fixed flag of Khmer language
- Added Automatic Language Detection notice and included it on add-ons page
- Fixed an issue with WooCommerce checkout and Stripe Gateway
- Fixed issues with some improper responses from the WP Remote API functions
- Fixed minor issues with ajax
Download this release
Release Info
| Developer | madalin.ungureanu |
| Plugin | |
| Version | 1.2.9 |
| Comparing to | |
| See all releases | |
Code changes from version 1.2.8 to 1.2.9
- assets/images/auto-detect-language-add-on.png +0 -0
- assets/images/flags/km.png +0 -0
- class-translate-press.php +4 -3
- includes/class-languages.php +65 -13
- includes/class-plugin-notices.php +34 -3
- includes/class-translation-manager.php +30 -4
- index.php +1 -1
- languages/translatepress-multilingual.catalog.php +8 -1
- languages/translatepress-multilingual.pot +39 -11
- partials/addons-settings-page.php +8 -0
- readme.txt +9 -1
assets/images/auto-detect-language-add-on.png
ADDED
|
Binary file
|
assets/images/flags/km.png
CHANGED
|
Binary file
|
class-translate-press.php
CHANGED
|
@@ -39,7 +39,7 @@ class TRP_Translate_Press{
|
|
| 39 |
define( 'TRP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
| 40 |
define( 'TRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
| 41 |
define( 'TRP_PLUGIN_SLUG', 'translatepress-multilingual' );
|
| 42 |
-
define( 'TRP_PLUGIN_VERSION', '1.2.
|
| 43 |
|
| 44 |
$this->load_dependencies();
|
| 45 |
$this->initialize_components();
|
|
@@ -184,8 +184,9 @@ class TRP_Translate_Press{
|
|
| 184 |
/* define an update hook here */
|
| 185 |
$this->loader->add_action( 'plugins_loaded', $this->query, 'check_for_necessary_updates', 10 );
|
| 186 |
|
| 187 |
-
$this->loader->add_filter( 'trp_language_name', $this->languages, 'beautify_language_name', 10,
|
| 188 |
-
|
|
|
|
| 189 |
/* set up wp_mail hooks */
|
| 190 |
$this->loader->add_filter( 'wp_mail', $this->translation_render, 'wp_mail_filter', 200 );
|
| 191 |
|
| 39 |
define( 'TRP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
| 40 |
define( 'TRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
| 41 |
define( 'TRP_PLUGIN_SLUG', 'translatepress-multilingual' );
|
| 42 |
+
define( 'TRP_PLUGIN_VERSION', '1.2.9' );
|
| 43 |
|
| 44 |
$this->load_dependencies();
|
| 45 |
$this->initialize_components();
|
| 184 |
/* define an update hook here */
|
| 185 |
$this->loader->add_action( 'plugins_loaded', $this->query, 'check_for_necessary_updates', 10 );
|
| 186 |
|
| 187 |
+
$this->loader->add_filter( 'trp_language_name', $this->languages, 'beautify_language_name', 10, 4 );
|
| 188 |
+
$this->loader->add_filter( 'trp_languages', $this->languages, 'reorder_languages', 10, 2 );
|
| 189 |
+
|
| 190 |
/* set up wp_mail hooks */
|
| 191 |
$this->loader->add_filter( 'wp_mail', $this->translation_render, 'wp_mail_filter', 200 );
|
| 192 |
|
includes/class-languages.php
CHANGED
|
@@ -24,7 +24,7 @@ class TRP_Languages{
|
|
| 24 |
if ( empty( $this->languages[$english_or_native_name] ) ) {
|
| 25 |
$wp_languages = $this->get_wp_languages();
|
| 26 |
foreach ( $wp_languages as $wp_language ) {
|
| 27 |
-
$this->languages[$english_or_native_name][$wp_language['language']] =
|
| 28 |
}
|
| 29 |
}
|
| 30 |
|
|
@@ -137,13 +137,53 @@ class TRP_Languages{
|
|
| 137 |
$languages = $this->get_languages( $english_or_native_name );
|
| 138 |
foreach ( $language_codes as $language_code ){
|
| 139 |
if( isset( $languages[$language_code] ) ) {
|
| 140 |
-
$return[$language_code] = $languages[$language_code];
|
| 141 |
}
|
| 142 |
}
|
| 143 |
|
| 144 |
return $return;
|
| 145 |
}
|
| 146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
/**
|
| 148 |
* Return the short language name for English name.
|
| 149 |
*
|
|
@@ -152,21 +192,33 @@ class TRP_Languages{
|
|
| 152 |
* @param string $english_or_native 'english_name' | 'native_name'
|
| 153 |
* @return string Short language name.
|
| 154 |
*/
|
| 155 |
-
public function beautify_language_name( $name, $code, $english_or_native = 'english_name' ){
|
| 156 |
if ( $english_or_native == 'english_name' ) {
|
| 157 |
-
$
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
}
|
| 167 |
}
|
| 168 |
-
return apply_filters( 'trp_beautify_language_name', $name, $code, $english_or_native );
|
| 169 |
|
|
|
|
| 170 |
}
|
| 171 |
|
| 172 |
/**
|
| 24 |
if ( empty( $this->languages[$english_or_native_name] ) ) {
|
| 25 |
$wp_languages = $this->get_wp_languages();
|
| 26 |
foreach ( $wp_languages as $wp_language ) {
|
| 27 |
+
$this->languages[$english_or_native_name][$wp_language['language']] = $wp_language[$english_or_native_name];
|
| 28 |
}
|
| 29 |
}
|
| 30 |
|
| 137 |
$languages = $this->get_languages( $english_or_native_name );
|
| 138 |
foreach ( $language_codes as $language_code ){
|
| 139 |
if( isset( $languages[$language_code] ) ) {
|
| 140 |
+
$return[$language_code] = apply_filters( 'trp_language_name', $languages[$language_code], $language_code, $english_or_native_name, $language_codes );
|
| 141 |
}
|
| 142 |
}
|
| 143 |
|
| 144 |
return $return;
|
| 145 |
}
|
| 146 |
|
| 147 |
+
/**
|
| 148 |
+
* Returns substring of the string from the beginning until the occurrence of character
|
| 149 |
+
*
|
| 150 |
+
* If character not found do nothing.
|
| 151 |
+
*
|
| 152 |
+
* @param $string string String to trim
|
| 153 |
+
* @param $character string Delimitator string
|
| 154 |
+
*
|
| 155 |
+
* @return string
|
| 156 |
+
*/
|
| 157 |
+
public function string_trim_after_character( $string, $character ){
|
| 158 |
+
if ( strpos( $string, $character ) !== false ) {
|
| 159 |
+
$string = substr($string, 0, strpos($string, $character ));
|
| 160 |
+
}
|
| 161 |
+
return $string;
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
/**
|
| 165 |
+
* Return true if the language (without country) of the language_code is present multiple times in the array
|
| 166 |
+
*
|
| 167 |
+
* (ex. For language code en_UK, language_code_array [en_US, en_UK], return true)
|
| 168 |
+
*
|
| 169 |
+
* @param $language_code string Language code (ex. en_US)
|
| 170 |
+
* @param $language_code_array array Array of language codes
|
| 171 |
+
*
|
| 172 |
+
* @return bool
|
| 173 |
+
*/
|
| 174 |
+
public function duplicated_language( $language_code, $language_code_array ){
|
| 175 |
+
// strip country from code ( ex. en_US => en )
|
| 176 |
+
$stripped_language_code = $this->string_trim_after_character( $language_code, "_" );
|
| 177 |
+
foreach ( $language_code_array as $key => $value ){
|
| 178 |
+
$stripped_value = $this->string_trim_after_character( $value, "_" );
|
| 179 |
+
if ( $language_code != $value && $stripped_language_code == $stripped_value ){
|
| 180 |
+
return true;
|
| 181 |
+
}
|
| 182 |
+
}
|
| 183 |
+
return false;
|
| 184 |
+
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
/**
|
| 188 |
* Return the short language name for English name.
|
| 189 |
*
|
| 192 |
* @param string $english_or_native 'english_name' | 'native_name'
|
| 193 |
* @return string Short language name.
|
| 194 |
*/
|
| 195 |
+
public function beautify_language_name( $name, $code, $english_or_native = 'english_name', $language_codes ){
|
| 196 |
if ( $english_or_native == 'english_name' ) {
|
| 197 |
+
if ( ! $this->duplicated_language( $code, $language_codes ) ){
|
| 198 |
+
$name = $this->string_trim_after_character( $name, " (" );
|
| 199 |
+
}
|
| 200 |
+
}
|
| 201 |
+
return apply_filters( 'trp_beautify_language_name', $name, $code, $english_or_native, $language_codes );
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
/**
|
| 205 |
+
* Return language arrays with English languages first
|
| 206 |
+
*
|
| 207 |
+
* @param $languages_array array Languages array
|
| 208 |
+
* @param $english_or_native_name string 'english_name' | 'native_name'
|
| 209 |
+
*
|
| 210 |
+
* @return array
|
| 211 |
+
*/
|
| 212 |
+
public function reorder_languages( $languages_array, $english_or_native_name ){
|
| 213 |
+
$english_array = array();
|
| 214 |
+
foreach( $languages_array as $key => $value ){
|
| 215 |
+
if ( $this->string_trim_after_character( $key, '_' ) == 'en' ){
|
| 216 |
+
$english_array[$key] = $value;
|
| 217 |
+
unset( $languages_array[$key] );
|
| 218 |
}
|
| 219 |
}
|
|
|
|
| 220 |
|
| 221 |
+
return $english_array + $languages_array;
|
| 222 |
}
|
| 223 |
|
| 224 |
/**
|
includes/class-plugin-notices.php
CHANGED
|
@@ -68,11 +68,12 @@ Class TRP_Plugin_Notifications {
|
|
| 68 |
private static $_instance = null;
|
| 69 |
private $prefix = 'trp';
|
| 70 |
private $menu_slug = 'options-general.php';
|
| 71 |
-
public $pluginPages = array( 'translate-press', 'trp_addons_page' );
|
| 72 |
|
| 73 |
protected function __construct() {
|
| 74 |
add_action( 'admin_init', array( $this, 'dismiss_admin_notifications' ), 200 );
|
| 75 |
add_action( 'admin_init', array( $this, 'add_admin_menu_notification_counts' ), 1000 );
|
|
|
|
| 76 |
}
|
| 77 |
|
| 78 |
|
|
@@ -109,6 +110,36 @@ Class TRP_Plugin_Notifications {
|
|
| 109 |
}
|
| 110 |
}
|
| 111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
/**
|
| 113 |
*
|
| 114 |
*
|
|
@@ -286,9 +317,9 @@ class TRP_Trigger_Plugin_Notifications{
|
|
| 286 |
|
| 287 |
|
| 288 |
/* this must be unique */
|
| 289 |
-
$notification_id = '
|
| 290 |
|
| 291 |
-
$message = '<p style="padding-right:30px;">' . __('
|
| 292 |
//make sure to use the trp_dismiss_admin_notification arg
|
| 293 |
$message .= '<a href="' . add_query_arg(array('trp_dismiss_admin_notification' => $notification_id)) . '" type="button" class="notice-dismiss"><span class="screen-reader-text">' . __('Dismiss this notice.', 'translatepress-multilingual') . '</span></a>';
|
| 294 |
|
| 68 |
private static $_instance = null;
|
| 69 |
private $prefix = 'trp';
|
| 70 |
private $menu_slug = 'options-general.php';
|
| 71 |
+
public $pluginPages = array( 'translate-press', 'trp_addons_page', 'trp_license_key' );
|
| 72 |
|
| 73 |
protected function __construct() {
|
| 74 |
add_action( 'admin_init', array( $this, 'dismiss_admin_notifications' ), 200 );
|
| 75 |
add_action( 'admin_init', array( $this, 'add_admin_menu_notification_counts' ), 1000 );
|
| 76 |
+
add_action( 'admin_init', array( $this, 'remove_other_plugin_notices' ), 1001 );
|
| 77 |
}
|
| 78 |
|
| 79 |
|
| 110 |
}
|
| 111 |
}
|
| 112 |
|
| 113 |
+
/* handle other plugin notifications on our plugin pages */
|
| 114 |
+
function remove_other_plugin_notices(){
|
| 115 |
+
/* remove all other plugin notifications except our own from the rest of the PB pages */
|
| 116 |
+
if( $this->is_plugin_page() ) {
|
| 117 |
+
global $wp_filter;
|
| 118 |
+
if (!empty($wp_filter['admin_notices'])) {
|
| 119 |
+
if (!empty($wp_filter['admin_notices']->callbacks)) {
|
| 120 |
+
foreach ($wp_filter['admin_notices']->callbacks as $priority => $callbacks_level) {
|
| 121 |
+
if (!empty($callbacks_level)) {
|
| 122 |
+
foreach ($callbacks_level as $key => $callback) {
|
| 123 |
+
if( is_array( $callback['function'] ) ){
|
| 124 |
+
if( is_object($callback['function'][0])) {//object here
|
| 125 |
+
if (strpos(get_class($callback['function'][0]), 'PMS_') !== 0 && strpos(get_class($callback['function'][0]), 'WPPB_') !== 0 && strpos(get_class($callback['function'][0]), 'TRP_') !== 0 && strpos(get_class($callback['function'][0]), 'WCK_') !== 0) {
|
| 126 |
+
unset($wp_filter['admin_notices']->callbacks[$priority][$key]);//unset everything that doesn't come from our plugins
|
| 127 |
+
}
|
| 128 |
+
}
|
| 129 |
+
} else if( is_string( $callback['function'] ) ){//it should be a function name
|
| 130 |
+
if (strpos($callback['function'], 'pms_') !== 0 && strpos($callback['function'], 'wppb_') !== 0 && strpos($callback['function'], 'trp_') !== 0 && strpos($callback['function'], 'wck_') !== 0) {
|
| 131 |
+
unset($wp_filter['admin_notices']->callbacks[$priority][$key]);//unset everything that doesn't come from our plugins
|
| 132 |
+
}
|
| 133 |
+
}
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
}
|
| 137 |
+
}
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
/**
|
| 144 |
*
|
| 145 |
*
|
| 317 |
|
| 318 |
|
| 319 |
/* this must be unique */
|
| 320 |
+
$notification_id = 'trp_new_addon_auto_detect_language';
|
| 321 |
|
| 322 |
+
$message = '<p style="padding-right:30px;">' . __('Redirect users to their preferred language based on their browser language or IP address using our new <a href="https://translatepress.com/docs/addons/automatic-user-language-detection/" >Automatic User Language Detection Add-on</a>.' , 'translatepress-multilingual' ) . '</p>';
|
| 323 |
//make sure to use the trp_dismiss_admin_notification arg
|
| 324 |
$message .= '<a href="' . add_query_arg(array('trp_dismiss_admin_notification' => $notification_id)) . '" type="button" class="notice-dismiss"><span class="screen-reader-text">' . __('Dismiss this notice.', 'translatepress-multilingual') . '</span></a>';
|
| 325 |
|
includes/class-translation-manager.php
CHANGED
|
@@ -753,14 +753,35 @@ class TRP_Translation_Manager{
|
|
| 753 |
* @return bool
|
| 754 |
*/
|
| 755 |
static function is_ajax_on_frontend(){
|
|
|
|
|
|
|
|
|
|
| 756 |
//check here for wp ajax or woocommerce ajax
|
| 757 |
if( ( defined('DOING_AJAX') && DOING_AJAX ) || ( defined('WC_DOING_AJAX') && WC_DOING_AJAX ) ){
|
| 758 |
$referer = '';
|
| 759 |
-
if ( ! empty( $_REQUEST['_wp_http_referer'] ) )
|
| 760 |
-
|
| 761 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 762 |
$referer = wp_unslash( esc_url_raw( $_SERVER['HTTP_REFERER'] ) );
|
| 763 |
|
|
|
|
|
|
|
| 764 |
//if the request did not come from the admin set propper variables for the request (being processed in ajax they got lost) and return true
|
| 765 |
if( ( strpos( $referer, admin_url() ) === false ) ){
|
| 766 |
TRP_Translation_Manager::set_vars_in_frontend_ajax_request( $referer );
|
|
@@ -906,12 +927,17 @@ class TRP_Translation_Manager{
|
|
| 906 |
) {
|
| 907 |
return $translation;
|
| 908 |
}
|
| 909 |
-
|
| 910 |
/* make sure we don't touch the woocommerce permalink rewrite slugs that are translated */
|
| 911 |
if( $callstack_function['function'] == 'wc_get_permalink_structure' ){
|
| 912 |
return $translation;
|
| 913 |
}
|
| 914 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 915 |
}
|
| 916 |
}
|
| 917 |
|
| 753 |
* @return bool
|
| 754 |
*/
|
| 755 |
static function is_ajax_on_frontend(){
|
| 756 |
+
$trp = TRP_Translate_Press::get_trp_instance();
|
| 757 |
+
$url_converter = $trp->get_component("url_converter");
|
| 758 |
+
|
| 759 |
//check here for wp ajax or woocommerce ajax
|
| 760 |
if( ( defined('DOING_AJAX') && DOING_AJAX ) || ( defined('WC_DOING_AJAX') && WC_DOING_AJAX ) ){
|
| 761 |
$referer = '';
|
| 762 |
+
if ( ! empty( $_REQUEST['_wp_http_referer'] ) ){
|
| 763 |
+
// this one is actually REQUEST_URI from the previous page. It's set by the wp_nonce_field() and wp_referer_field()
|
| 764 |
+
// confusingly enough, wp_get_referer() basically returns $_SERVER['REQUEST_URL'] from the prev page (not a full URL) or
|
| 765 |
+
// $_SERVER['HTTP_REFERER'] that's setup by the client/browser as a full URL (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer)
|
| 766 |
+
$referer_uri = wp_unslash( esc_url_raw( $_REQUEST['_wp_http_referer'] ) );
|
| 767 |
+
$req_uri = $referer_uri;
|
| 768 |
+
|
| 769 |
+
$home_path = trim( parse_url( $url_converter->get_abs_home(), PHP_URL_PATH ), '/' );
|
| 770 |
+
$home_path_regex = sprintf( '|^%s|i', preg_quote( $home_path, '|' ) );
|
| 771 |
+
|
| 772 |
+
// Trim path info from the end and the leading home path from the front.
|
| 773 |
+
$req_uri = ltrim($req_uri, '/');
|
| 774 |
+
$req_uri = preg_replace( $home_path_regex, '', $req_uri );
|
| 775 |
+
$req_uri = trim($url_converter->get_abs_home(), '/') . '/' . ltrim( $req_uri, '/' );
|
| 776 |
+
|
| 777 |
+
$referer = $req_uri;
|
| 778 |
+
|
| 779 |
+
} elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
|
| 780 |
+
// this one is an actual URL that the browser sets.
|
| 781 |
$referer = wp_unslash( esc_url_raw( $_SERVER['HTTP_REFERER'] ) );
|
| 782 |
|
| 783 |
+
}
|
| 784 |
+
|
| 785 |
//if the request did not come from the admin set propper variables for the request (being processed in ajax they got lost) and return true
|
| 786 |
if( ( strpos( $referer, admin_url() ) === false ) ){
|
| 787 |
TRP_Translation_Manager::set_vars_in_frontend_ajax_request( $referer );
|
| 927 |
) {
|
| 928 |
return $translation;
|
| 929 |
}
|
| 930 |
+
|
| 931 |
/* make sure we don't touch the woocommerce permalink rewrite slugs that are translated */
|
| 932 |
if( $callstack_function['function'] == 'wc_get_permalink_structure' ){
|
| 933 |
return $translation;
|
| 934 |
}
|
| 935 |
|
| 936 |
+
/* make sure we don't touch the woocommerce process_payment function in WC_Gateway_Stripe. It does a wp_remote_post() call to stripe with localized parameters */
|
| 937 |
+
if( $callstack_function['function'] == 'process_payment' && $callstack_function['class'] == 'WC_Gateway_Stripe' ){
|
| 938 |
+
return $translation;
|
| 939 |
+
}
|
| 940 |
+
|
| 941 |
}
|
| 942 |
}
|
| 943 |
|
index.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
Plugin Name: TranslatePress - Multilingual
|
| 4 |
Plugin URI: https://translatepress.com/
|
| 5 |
Description: Experience a better way of translating your WordPress site, with full support for WooCommerce and site builders.
|
| 6 |
-
Version: 1.2.
|
| 7 |
Author: Cozmoslabs, Razvan Mocanu, Madalin Ungureanu, Cristophor Hurduban
|
| 8 |
Author URI: https://cozmoslabs.com/
|
| 9 |
Text Domain: translatepress-multilingual
|
| 3 |
Plugin Name: TranslatePress - Multilingual
|
| 4 |
Plugin URI: https://translatepress.com/
|
| 5 |
Description: Experience a better way of translating your WordPress site, with full support for WooCommerce and site builders.
|
| 6 |
+
Version: 1.2.9
|
| 7 |
Author: Cozmoslabs, Razvan Mocanu, Madalin Ungureanu, Cristophor Hurduban
|
| 8 |
Author URI: https://cozmoslabs.com/
|
| 9 |
Text Domain: translatepress-multilingual
|
languages/translatepress-multilingual.catalog.php
CHANGED
|
@@ -2,11 +2,18 @@
|
|
| 2 |
<?php __("Error! Duplicate Url slug values.", "translatepress-multilingual"); ?>
|
| 3 |
<?php __("Limit this menu item to the following languages", "translatepress-multilingual"); ?>
|
| 4 |
<?php __("The Yoast SEO Sitemaps will now contain the default language slug: example.com/en/sitemap_index.xml <br/> This works perfectly, just take it into account when you submit the sitemap to Google.", "translatepress-multilingual"); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
<?php __("TranslatePress Settings", "translatepress-multilingual"); ?>
|
| 6 |
<?php __("License Key", "translatepress-multilingual"); ?>
|
| 7 |
<?php __("Enter your license key.", "translatepress-multilingual"); ?>
|
| 8 |
<?php __("Activate License", "translatepress-multilingual"); ?>
|
| 9 |
<?php __("Deactivate License", "translatepress-multilingual"); ?>
|
|
|
|
|
|
|
| 10 |
<?php __("Translation Languages", "translatepress-multilingual"); ?>
|
| 11 |
<?php __("Language", "translatepress-multilingual"); ?>
|
| 12 |
<?php __("Slug", "translatepress-multilingual"); ?>
|
|
@@ -18,7 +25,7 @@
|
|
| 18 |
<?php __("Select the languages you wish to make your website available in.", "translatepress-multilingual"); ?>
|
| 19 |
<?php __("You are not using a permalink structure! Please <a href=\"%s\">enable</a> one or install our <a href=\"%s\">\"Language by GET parameter\"</a> addon so TranslatePress can function properly.", "translatepress-multilingual"); ?>
|
| 20 |
<?php __("Dismiss this notice.", "translatepress-multilingual"); ?>
|
| 21 |
-
<?php __("
|
| 22 |
<?php __("Full Language Names", "translatepress-multilingual"); ?>
|
| 23 |
<?php __("Short Language Names", "translatepress-multilingual"); ?>
|
| 24 |
<?php __("Flags with Full Language Names", "translatepress-multilingual"); ?>
|
| 2 |
<?php __("Error! Duplicate Url slug values.", "translatepress-multilingual"); ?>
|
| 3 |
<?php __("Limit this menu item to the following languages", "translatepress-multilingual"); ?>
|
| 4 |
<?php __("The Yoast SEO Sitemaps will now contain the default language slug: example.com/en/sitemap_index.xml <br/> This works perfectly, just take it into account when you submit the sitemap to Google.", "translatepress-multilingual"); ?>
|
| 5 |
+
<?php __("First by browser language, then IP address (recommended)", "translatepress-multilingual"); ?>
|
| 6 |
+
<?php __("First by IP address, then browser language", "translatepress-multilingual"); ?>
|
| 7 |
+
<?php __("Only by browser language", "translatepress-multilingual"); ?>
|
| 8 |
+
<?php __("Only by IP address", "translatepress-multilingual"); ?>
|
| 9 |
+
<?php __("<div class=\"warning\">WARNING. Cannot determine your language preference based on your current IP.<br>This is most likely because the website is on a local environment.</div>", "translatepress-multilingual"); ?>
|
| 10 |
<?php __("TranslatePress Settings", "translatepress-multilingual"); ?>
|
| 11 |
<?php __("License Key", "translatepress-multilingual"); ?>
|
| 12 |
<?php __("Enter your license key.", "translatepress-multilingual"); ?>
|
| 13 |
<?php __("Activate License", "translatepress-multilingual"); ?>
|
| 14 |
<?php __("Deactivate License", "translatepress-multilingual"); ?>
|
| 15 |
+
<?php __("Method of language detection", "translatepress-multilingual"); ?>
|
| 16 |
+
<?php __("Select how the language should be detected for first time visitors.<br>The visitor's last displayed language will be remembered through cookies.", "translatepress-multilingual"); ?>
|
| 17 |
<?php __("Translation Languages", "translatepress-multilingual"); ?>
|
| 18 |
<?php __("Language", "translatepress-multilingual"); ?>
|
| 19 |
<?php __("Slug", "translatepress-multilingual"); ?>
|
| 25 |
<?php __("Select the languages you wish to make your website available in.", "translatepress-multilingual"); ?>
|
| 26 |
<?php __("You are not using a permalink structure! Please <a href=\"%s\">enable</a> one or install our <a href=\"%s\">\"Language by GET parameter\"</a> addon so TranslatePress can function properly.", "translatepress-multilingual"); ?>
|
| 27 |
<?php __("Dismiss this notice.", "translatepress-multilingual"); ?>
|
| 28 |
+
<?php __("Redirect users to their preferred language based on their browser language or IP address using our new <a href=\"https://translatepress.com/docs/addons/automatic-user-language-detection/\" >Automatic User Language Detection Add-on</a>.", "translatepress-multilingual"); ?>
|
| 29 |
<?php __("Full Language Names", "translatepress-multilingual"); ?>
|
| 30 |
<?php __("Short Language Names", "translatepress-multilingual"); ?>
|
| 31 |
<?php __("Flags with Full Language Names", "translatepress-multilingual"); ?>
|
languages/translatepress-multilingual.pot
CHANGED
|
@@ -17,7 +17,7 @@ msgstr ""
|
|
| 17 |
msgid "Error! Duplicate Url slug values."
|
| 18 |
msgstr ""
|
| 19 |
|
| 20 |
-
#:
|
| 21 |
msgid "Limit this menu item to the following languages"
|
| 22 |
msgstr ""
|
| 23 |
|
|
@@ -25,26 +25,54 @@ msgstr ""
|
|
| 25 |
msgid "The Yoast SEO Sitemaps will now contain the default language slug: example.com/en/sitemap_index.xml <br/> This works perfectly, just take it into account when you submit the sitemap to Google."
|
| 26 |
msgstr ""
|
| 27 |
|
| 28 |
-
#: ../tp-add-on-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
msgid "TranslatePress Settings"
|
| 30 |
msgstr ""
|
| 31 |
|
| 32 |
-
#: ../tp-add-on-
|
| 33 |
msgid "License Key"
|
| 34 |
msgstr ""
|
| 35 |
|
| 36 |
-
#: ../tp-add-on-
|
| 37 |
msgid "Enter your license key."
|
| 38 |
msgstr ""
|
| 39 |
|
| 40 |
-
#: ../tp-add-on-
|
| 41 |
msgid "Activate License"
|
| 42 |
msgstr ""
|
| 43 |
|
| 44 |
-
#: ../tp-add-on-
|
| 45 |
msgid "Deactivate License"
|
| 46 |
msgstr ""
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
#: ../tp-add-on-extra-languages/partials/language-selector-pro.php:2
|
| 49 |
msgid "Translation Languages"
|
| 50 |
msgstr ""
|
|
@@ -81,16 +109,16 @@ msgstr ""
|
|
| 81 |
msgid "Select the languages you wish to make your website available in."
|
| 82 |
msgstr ""
|
| 83 |
|
| 84 |
-
#: ../translatepress/includes/class-plugin-notices.php:
|
| 85 |
msgid "You are not using a permalink structure! Please <a href=\"%s\">enable</a> one or install our <a href=\"%s\">\"Language by GET parameter\"</a> addon so TranslatePress can function properly."
|
| 86 |
msgstr ""
|
| 87 |
|
| 88 |
-
#: ../translatepress/includes/class-plugin-notices.php:
|
| 89 |
msgid "Dismiss this notice."
|
| 90 |
msgstr ""
|
| 91 |
|
| 92 |
-
#: ../translatepress/includes/class-plugin-notices.php:
|
| 93 |
-
msgid "
|
| 94 |
msgstr ""
|
| 95 |
|
| 96 |
#: ../translatepress/includes/class-settings.php:25
|
|
@@ -176,7 +204,7 @@ msgstr ""
|
|
| 176 |
msgid "Settings"
|
| 177 |
msgstr ""
|
| 178 |
|
| 179 |
-
#: ../translatepress/includes/class-translation-manager.php:
|
| 180 |
msgid "Security check"
|
| 181 |
msgstr ""
|
| 182 |
|
| 17 |
msgid "Error! Duplicate Url slug values."
|
| 18 |
msgstr ""
|
| 19 |
|
| 20 |
+
#: class-navigation-based-on-language.php:85
|
| 21 |
msgid "Limit this menu item to the following languages"
|
| 22 |
msgstr ""
|
| 23 |
|
| 25 |
msgid "The Yoast SEO Sitemaps will now contain the default language slug: example.com/en/sitemap_index.xml <br/> This works perfectly, just take it into account when you submit the sitemap to Google."
|
| 26 |
msgstr ""
|
| 27 |
|
| 28 |
+
#: ../tp-add-on-automatic-language-detection/includes/class-ald-settings.php:37
|
| 29 |
+
msgid "First by browser language, then IP address (recommended)"
|
| 30 |
+
msgstr ""
|
| 31 |
+
|
| 32 |
+
#: ../tp-add-on-automatic-language-detection/includes/class-ald-settings.php:38
|
| 33 |
+
msgid "First by IP address, then browser language"
|
| 34 |
+
msgstr ""
|
| 35 |
+
|
| 36 |
+
#: ../tp-add-on-automatic-language-detection/includes/class-ald-settings.php:39
|
| 37 |
+
msgid "Only by browser language"
|
| 38 |
+
msgstr ""
|
| 39 |
+
|
| 40 |
+
#: ../tp-add-on-automatic-language-detection/includes/class-ald-settings.php:40
|
| 41 |
+
msgid "Only by IP address"
|
| 42 |
+
msgstr ""
|
| 43 |
+
|
| 44 |
+
#: ../tp-add-on-automatic-language-detection/includes/class-ald-settings.php:110
|
| 45 |
+
msgid "<div class=\"warning\">WARNING. Cannot determine your language preference based on your current IP.<br>This is most likely because the website is on a local environment.</div>"
|
| 46 |
+
msgstr ""
|
| 47 |
+
|
| 48 |
+
#: ../tp-add-on-automatic-language-detection/partials/license-settings-page.php:4, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:4, ../tp-add-on-extra-languages/partials/license-settings-page.php:4, partials/license-settings-page.php:4, ../tp-add-on-seo-pack/partials/license-settings-page.php:4, ../translatepress/partials/addons-settings-page.php:3, ../translatepress/partials/main-settings-page.php:5, ../translatepress/partials/test-google-key-settings-page.php:17, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:4
|
| 49 |
msgid "TranslatePress Settings"
|
| 50 |
msgstr ""
|
| 51 |
|
| 52 |
+
#: ../tp-add-on-automatic-language-detection/partials/license-settings-page.php:10, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:10, ../tp-add-on-extra-languages/partials/license-settings-page.php:10, partials/license-settings-page.php:10, ../tp-add-on-seo-pack/partials/license-settings-page.php:10, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:10
|
| 53 |
msgid "License Key"
|
| 54 |
msgstr ""
|
| 55 |
|
| 56 |
+
#: ../tp-add-on-automatic-language-detection/partials/license-settings-page.php:15, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:15, ../tp-add-on-extra-languages/partials/license-settings-page.php:15, partials/license-settings-page.php:15, ../tp-add-on-seo-pack/partials/license-settings-page.php:15, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:15
|
| 57 |
msgid "Enter your license key."
|
| 58 |
msgstr ""
|
| 59 |
|
| 60 |
+
#: ../tp-add-on-automatic-language-detection/partials/license-settings-page.php:22, ../tp-add-on-automatic-language-detection/partials/license-settings-page.php:31, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:22, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:31, ../tp-add-on-extra-languages/partials/license-settings-page.php:22, ../tp-add-on-extra-languages/partials/license-settings-page.php:31, partials/license-settings-page.php:22, partials/license-settings-page.php:31, ../tp-add-on-seo-pack/partials/license-settings-page.php:22, ../tp-add-on-seo-pack/partials/license-settings-page.php:31, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:22, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:31
|
| 61 |
msgid "Activate License"
|
| 62 |
msgstr ""
|
| 63 |
|
| 64 |
+
#: ../tp-add-on-automatic-language-detection/partials/license-settings-page.php:28, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:28, ../tp-add-on-extra-languages/partials/license-settings-page.php:28, partials/license-settings-page.php:28, ../tp-add-on-seo-pack/partials/license-settings-page.php:28, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:28
|
| 65 |
msgid "Deactivate License"
|
| 66 |
msgstr ""
|
| 67 |
|
| 68 |
+
#: ../tp-add-on-automatic-language-detection/partials/settings-option.php:2
|
| 69 |
+
msgid "Method of language detection"
|
| 70 |
+
msgstr ""
|
| 71 |
+
|
| 72 |
+
#: ../tp-add-on-automatic-language-detection/partials/settings-option.php:14
|
| 73 |
+
msgid "Select how the language should be detected for first time visitors.<br>The visitor's last displayed language will be remembered through cookies."
|
| 74 |
+
msgstr ""
|
| 75 |
+
|
| 76 |
#: ../tp-add-on-extra-languages/partials/language-selector-pro.php:2
|
| 77 |
msgid "Translation Languages"
|
| 78 |
msgstr ""
|
| 109 |
msgid "Select the languages you wish to make your website available in."
|
| 110 |
msgstr ""
|
| 111 |
|
| 112 |
+
#: ../translatepress/includes/class-plugin-notices.php:311
|
| 113 |
msgid "You are not using a permalink structure! Please <a href=\"%s\">enable</a> one or install our <a href=\"%s\">\"Language by GET parameter\"</a> addon so TranslatePress can function properly."
|
| 114 |
msgstr ""
|
| 115 |
|
| 116 |
+
#: ../translatepress/includes/class-plugin-notices.php:313, ../translatepress/includes/class-plugin-notices.php:324
|
| 117 |
msgid "Dismiss this notice."
|
| 118 |
msgstr ""
|
| 119 |
|
| 120 |
+
#: ../translatepress/includes/class-plugin-notices.php:322
|
| 121 |
+
msgid "Redirect users to their preferred language based on their browser language or IP address using our new <a href=\"https://translatepress.com/docs/addons/automatic-user-language-detection/\" >Automatic User Language Detection Add-on</a>."
|
| 122 |
msgstr ""
|
| 123 |
|
| 124 |
#: ../translatepress/includes/class-settings.php:25
|
| 204 |
msgid "Settings"
|
| 205 |
msgstr ""
|
| 206 |
|
| 207 |
+
#: ../translatepress/includes/class-translation-manager.php:1143
|
| 208 |
msgid "Security check"
|
| 209 |
msgstr ""
|
| 210 |
|
partials/addons-settings-page.php
CHANGED
|
@@ -34,6 +34,14 @@
|
|
| 34 |
</div>
|
| 35 |
</div>
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
<div class="grid">
|
| 38 |
<div class="grid-cell" style="overflow:hidden;">
|
| 39 |
<a href="https://translatepress.com/pricing/" target="_blank"><img src="<?php echo plugins_url('../assets/images/translator-accounts-addon.png', __FILE__) ?>" alt="Translator Account" style="float: left; margin: 0 1.5rem 1.5rem 0;"></a>
|
| 34 |
</div>
|
| 35 |
</div>
|
| 36 |
|
| 37 |
+
<div class="grid">
|
| 38 |
+
<div class="grid-cell" style="overflow:hidden;">
|
| 39 |
+
<a href="https://translatepress.com/pricing/" target="_blank"><img src="<?php echo plugins_url('../assets/images/auto-detect-language-add-on.png', __FILE__) ?>" alt="Automatic User Language Detection" style="float: left; margin: 0 1.5rem 1.5rem 0;"></a>
|
| 40 |
+
<h3><a href=" <?php echo trp_add_affiliate_id_to_link('https://translatepress.com/pricing/?utm_source=wpbackend&utm_medium=clientsite&utm_content=addons_tab&utm_campaign=tpfree') ?> " target="_blank"> Automatic User Language Detection</a></h3>
|
| 41 |
+
<p>Automatically redirects new visitors to their preferred language based on browser settings or IP address</br> and remembers the last visited language.</p>
|
| 42 |
+
</div>
|
| 43 |
+
</div>
|
| 44 |
+
|
| 45 |
<div class="grid">
|
| 46 |
<div class="grid-cell" style="overflow:hidden;">
|
| 47 |
<a href="https://translatepress.com/pricing/" target="_blank"><img src="<?php echo plugins_url('../assets/images/translator-accounts-addon.png', __FILE__) ?>" alt="Translator Account" style="float: left; margin: 0 1.5rem 1.5rem 0;"></a>
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: https://www.cozmoslabs.com/
|
|
| 4 |
Tags: translate, translation, multilingual, automatic translation, bilingual, front-end translation, google translate, language
|
| 5 |
Requires at least: 3.1.0
|
| 6 |
Tested up to: 4.9.8
|
| 7 |
-
Stable tag: 1.2.
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
|
@@ -117,6 +117,14 @@ For more information please check out [TranslatePress documentation](https://tra
|
|
| 117 |
6. Menu Language Switcher
|
| 118 |
|
| 119 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
= 1.2.8 =
|
| 121 |
* Added a lot of hooks in the translation manager interface so other people can insert new content there.
|
| 122 |
* We now take into account the presence of www or lack of it in custom links that might be local
|
| 4 |
Tags: translate, translation, multilingual, automatic translation, bilingual, front-end translation, google translate, language
|
| 5 |
Requires at least: 3.1.0
|
| 6 |
Tested up to: 4.9.8
|
| 7 |
+
Stable tag: 1.2.9
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
| 117 |
6. Menu Language Switcher
|
| 118 |
|
| 119 |
== Changelog ==
|
| 120 |
+
= 1.2.9 =
|
| 121 |
+
* Rearranged and renamed some languages in the options dropdown
|
| 122 |
+
* Fixed flag of Khmer language
|
| 123 |
+
* Added Automatic Language Detection notice and included it on add-ons page
|
| 124 |
+
* Fixed an issue with WooCommerce checkout and Stripe Gateway
|
| 125 |
+
* Fixed issues with some improper responses from the WP Remote API functions
|
| 126 |
+
* Fixed minor issues with ajax
|
| 127 |
+
|
| 128 |
= 1.2.8 =
|
| 129 |
* Added a lot of hooks in the translation manager interface so other people can insert new content there.
|
| 130 |
* We now take into account the presence of www or lack of it in custom links that might be local
|
