TranslatePress – Translate Multilingual sites - Version 1.1.7

Version Description

  • Compatibility fix with Elementor Page Builder
  • Added translation .pot file
  • Add proper encoding for mysqli connection in our trp-ajax.php file so we fixed some translation
  • Fixed infinite loop related to mutation observer on javascript strings by not re-adding detected strings again if they are similar to existing ones
  • Aligned text from add-ons tab.
Download this release

Release Info

Developer madalin.ungureanu
Plugin Icon 128x128 TranslatePress – Translate Multilingual sites
Version 1.1.7
Comparing to
See all releases

Code changes from version 1.1.6 to 1.1.7

assets/js/trp-editor-script.js CHANGED
@@ -760,7 +760,9 @@ function TRP_String( language, array_index ){
760
  }else if( _this.jquery_object.attr( 'data-trp-button' ) ){
761
  _this.jquery_object.children('button').text(text_to_set);
762
  }else {
763
- _this.jquery_object.html( text_to_set );
 
 
764
  }
765
  }
766
  }
760
  }else if( _this.jquery_object.attr( 'data-trp-button' ) ){
761
  _this.jquery_object.children('button').text(text_to_set);
762
  }else {
763
+ if (_this.jquery_object.text().trim() !== text_to_set.trim() ){
764
+ _this.jquery_object.html( text_to_set );
765
+ }
766
  }
767
  }
768
  }
class-translate-press.php CHANGED
@@ -1,213 +1,213 @@
1
- <?php
2
-
3
- /**
4
- * Class TRP_Translate_Press
5
- *
6
- * Singleton. Loads required files, initializes components and hooks methods.
7
- *
8
- */
9
- class TRP_Translate_Press{
10
- protected $loader;
11
- protected $settings;
12
- protected $translation_render;
13
- protected $machine_translator;
14
- protected $query;
15
- protected $language_switcher;
16
- protected $translation_manager;
17
- protected $url_converter;
18
- protected $languages;
19
- protected $slug_manager;
20
- public static $translate_press = null;
21
-
22
- /**
23
- * Get singleton object.
24
- *
25
- * @return TRP_Translate_Press Singleton object.
26
- */
27
- public static function get_trp_instance(){
28
- if ( self::$translate_press == null ){
29
- self::$translate_press = new TRP_Translate_Press();
30
- }
31
-
32
- return self::$translate_press;
33
- }
34
-
35
- /**
36
- * TRP_Translate_Press constructor.
37
- */
38
- public function __construct() {
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.1.6' );
43
-
44
- $this->load_dependencies();
45
- $this->initialize_components();
46
- $this->define_admin_hooks();
47
- $this->define_frontend_hooks();
48
- }
49
-
50
- /**
51
- * Returns particular component by name.
52
- *
53
- * @param string $component 'loader' | 'settings' | 'translation_render' |
54
- * 'machine_translator' | 'query' | 'language_switcher' |
55
- * 'translation_manager' | 'url_converter' | 'languages'
56
- * @return mixed
57
- */
58
- public function get_component( $component ){
59
- return $this->$component;
60
- }
61
-
62
- /**
63
- * Includes necessary files.
64
- */
65
- protected function load_dependencies() {
66
- require_once TRP_PLUGIN_DIR . 'includes/class-settings.php';
67
- require_once TRP_PLUGIN_DIR . 'includes/class-translation-manager.php';
68
- require_once TRP_PLUGIN_DIR . 'includes/class-hooks-loader.php';
69
- require_once TRP_PLUGIN_DIR . 'includes/class-languages.php';
70
- require_once TRP_PLUGIN_DIR . 'includes/class-translation-render.php';
71
- require_once TRP_PLUGIN_DIR . 'includes/class-language-switcher.php';
72
- require_once TRP_PLUGIN_DIR . 'includes/class-machine-translator.php';
73
- require_once TRP_PLUGIN_DIR . 'includes/class-query.php';
74
- require_once TRP_PLUGIN_DIR . 'includes/class-url-converter.php';
75
- require_once TRP_PLUGIN_DIR . 'includes/class-plugin-notices.php';
76
- require_once TRP_PLUGIN_DIR . 'includes/functions.php';
77
- require_once TRP_PLUGIN_DIR . 'assets/lib/simplehtmldom/simple_html_dom.php';
78
- require_once TRP_PLUGIN_DIR . 'includes/shortcodes.php';
79
- }
80
-
81
- /**
82
- * Instantiates components.
83
- */
84
- protected function initialize_components() {
85
- $this->loader = new TRP_Hooks_Loader();
86
- $this->languages = new TRP_Languages();
87
- $this->settings = new TRP_Settings();
88
- $this->translation_render = new TRP_Translation_Render( $this->settings->get_settings() );
89
- $this->url_converter = new TRP_Url_Converter( $this->settings->get_settings() );
90
- $this->language_switcher = new TRP_Language_Switcher( $this->settings->get_settings(), $this->url_converter );
91
- $this->query = new TRP_Query( $this->settings->get_settings() );
92
- $this->machine_translator = new TRP_Machine_Translator( $this->settings->get_settings() );
93
- $this->translation_manager = new TRP_Translation_Manager( $this->settings->get_settings() );
94
- $this->notifications = new TRP_Trigger_Plugin_Notifications();
95
- }
96
-
97
- /**
98
- * Hooks methods used in admin area.
99
- */
100
- protected function define_admin_hooks() {
101
- $this->loader->add_action( 'admin_menu', $this->settings, 'register_menu_page' );
102
- $this->loader->add_action( 'admin_init', $this->settings, 'register_setting' );
103
- $this->loader->add_action( 'admin_notices', $this->settings, 'admin_notices' );
104
- $this->loader->add_action( 'admin_enqueue_scripts', $this->settings, 'enqueue_scripts_and_styles', 10, 1 );
105
- $this->loader->add_action( 'trp_settings_navigation_tabs', $this->settings, 'add_navigation_tabs' );
106
- $this->loader->add_action( 'trp_language_selector', $this->settings, 'languages_selector', 10, 1 );
107
-
108
-
109
- $this->loader->add_action( 'wp_ajax_nopriv_trp_get_translations', $this->translation_manager, 'get_translations' );
110
- $this->loader->add_action( 'wp_head', $this->translation_manager, 'add_slug_as_meta_tag', 1 );
111
-
112
-
113
- $this->loader->add_action( 'wp_ajax_trp_get_translations', $this->translation_manager, 'get_translations' );
114
- $this->loader->add_action( 'wp_ajax_trp_save_translations', $this->translation_manager, 'save_translations' );
115
-
116
- $this->loader->add_action( 'wp_ajax_trp_process_js_strings_in_translation_editor', $this->translation_render, 'process_js_strings_in_translation_editor' );
117
-
118
- $this->loader->add_action( 'wp_ajax_trp_gettext_get_translations', $this->translation_manager, 'gettext_get_translations' );
119
- $this->loader->add_action( 'wp_ajax_trp_gettext_save_translations', $this->translation_manager, 'gettext_save_translations' );
120
-
121
- $this->loader->add_action( 'wp_ajax_trp_publish_language', $this->translation_manager, 'publish_language' );
122
-
123
- }
124
-
125
- /**
126
- * Hooks methods used in front-end
127
- */
128
- protected function define_frontend_hooks(){
129
- $this->loader->add_action( 'wp', $this->translation_render, 'start_output_buffer' );
130
- $this->loader->add_action( 'admin_init', $this->translation_render, 'start_output_buffer' );
131
- $this->loader->add_action( 'wp_enqueue_scripts', $this->translation_render, 'enqueue_dynamic_translation', 1 );
132
- $this->loader->add_filter( 'wp_redirect', $this->translation_render, 'force_preview_on_url_redirect', 99, 2 );
133
- $this->loader->add_filter( 'wp_redirect', $this->translation_render, 'force_language_on_form_url_redirect', 99, 2 );
134
- $this->loader->add_filter( 'trp_before_translate_content', $this->translation_render, 'force_preview_on_url_in_ajax', 10 );
135
- $this->loader->add_filter( 'trp_before_translate_content', $this->translation_render, 'force_form_language_on_url_in_ajax', 20 );
136
- /* handle CDATA str replacement from the content as it is messing up the renderer */
137
- $this->loader->add_filter( "trp_before_translate_content", $this->translation_render, 'handle_cdata', 1000 );
138
-
139
-
140
- $this->loader->add_action( 'wp_enqueue_scripts', $this->language_switcher, 'enqueue_language_switcher_scripts' );
141
- $this->loader->add_action( 'wp_footer', $this->language_switcher, 'add_floater_language_switcher' );
142
- $this->loader->add_filter( 'init', $this->language_switcher, 'register_ls_menu_switcher' );
143
- $this->loader->add_action( 'wp_get_nav_menu_items', $this->language_switcher, 'ls_menu_permalinks', 10, 3 );
144
- add_shortcode( 'language-switcher', array( $this->language_switcher, 'language_switcher' ) );
145
-
146
-
147
- $this->loader->add_action( 'trp_head', $this->translation_manager, 'enqueue_scripts_and_styles' );
148
- $this->loader->add_filter( 'template_include', $this->translation_manager, 'translation_editor', 9999 );
149
- $this->loader->add_action( 'wp_enqueue_scripts', $this->translation_manager, 'enqueue_preview_scripts_and_styles' );
150
- $this->loader->add_action( 'admin_bar_menu', $this->translation_manager, 'add_shortcut_to_translation_editor', 90, 1 );
151
- $this->loader->add_filter( 'show_admin_bar', $this->translation_manager, 'hide_admin_bar_when_in_editor', 90 );
152
-
153
-
154
-
155
- $this->loader->add_action( 'template_redirect', $this->url_converter, 'redirect_to_default_language' );
156
- $this->loader->add_filter( 'home_url', $this->url_converter, 'add_language_to_home_url', 1, 4 );
157
- $this->loader->add_action( 'wp_head', $this->url_converter, 'add_hreflang_to_head' );
158
- $this->loader->add_filter( 'language_attributes', $this->url_converter, 'change_lang_attr_in_html_tag', 10, 1 );
159
-
160
-
161
- $this->loader->add_filter( 'widget_text', null, 'do_shortcode', 11 );
162
- $this->loader->add_filter( 'widget_text', null, 'shortcode_unautop', 11 );
163
-
164
- /* handle dynamic texts with gettext */
165
- $this->loader->add_filter( 'locale', $this->languages, 'change_locale' );
166
-
167
- $this->loader->add_action( 'init', $this->translation_manager, 'create_gettext_translated_global' );
168
- $this->loader->add_action( 'admin_init', $this->translation_manager, 'create_gettext_translated_global' );
169
- $this->loader->add_action( 'init', $this->translation_manager, 'apply_gettext_filter_on_frontend' );
170
- $this->loader->add_action( 'admin_init', $this->translation_manager, 'apply_gettext_filter' );
171
- $this->loader->add_action( 'shutdown', $this->translation_manager, 'machine_translate_gettext', 100 );
172
-
173
- /* we need the esc_ functions for html and attributes not to escape our tags so we put them back */
174
- $this->loader->add_filter( 'esc_html', $this->translation_manager, 'handle_esc_functions_for_gettext', 10, 2 );
175
- $this->loader->add_filter( 'attribute_escape', $this->translation_manager, 'handle_esc_functions_for_gettext', 10, 2 );
176
- /* we need to allow the trp-gettext tag in ksses functions */
177
- $this->loader->add_filter( 'wp_kses_allowed_html', $this->translation_manager, 'handle_kses_functions_for_gettext', 10 );
178
- /* we need to treat the date_i18n function differently so we remove the gettext wraps */
179
- $this->loader->add_filter( 'date_i18n', $this->translation_manager, 'handle_date_i18n_function_for_gettext', 1, 4 );
180
-
181
- /* define an update hook here */
182
- $this->loader->add_action( 'plugins_loaded', $this->query, 'check_for_necessary_updates' );
183
-
184
- $this->loader->add_filter( 'trp_language_name', $this->languages, 'beautify_language_name', 10, 3 );
185
-
186
- /* set up wp_mail hooks */
187
- $this->loader->add_filter( 'wp_mail', $this->translation_render, 'wp_mail_filter', 200 );
188
-
189
- /* hide php ors and notice when we are storing strings in db */
190
- $this->loader->add_action( 'wp', $this->translation_render, 'trp_debug_mode_off' );
191
-
192
- /* ?or init ? hook here where you can change the $current_user global */
193
- $this->loader->add_action( 'init', $this->translation_manager, 'trp_view_as_user' );
194
-
195
- /**
196
- * we need to modify the permalinks structure for woocommerce when we switch languages
197
- * when woo registers post_types and taxonomies in the rewrite parameter of the function they change the slugs of the items (they are localized with _x )
198
- * we can't flush the permalinks on every page load so we filter the rewrite_rules option
199
- */
200
- $this->loader->add_filter( "option_rewrite_rules", $this->url_converter, 'woocommerce_filter_permalinks_on_other_languages' );
201
-
202
- /* add to the body class the current language */
203
- $this->loader->add_filter( "body_class", $this->translation_manager, 'add_language_to_body_class' );
204
- }
205
-
206
- /**
207
- * Register hooks to WP.
208
- */
209
- public function run() {
210
- $this->loader->run();
211
- }
212
-
213
  }
1
+ <?php
2
+
3
+ /**
4
+ * Class TRP_Translate_Press
5
+ *
6
+ * Singleton. Loads required files, initializes components and hooks methods.
7
+ *
8
+ */
9
+ class TRP_Translate_Press{
10
+ protected $loader;
11
+ protected $settings;
12
+ protected $translation_render;
13
+ protected $machine_translator;
14
+ protected $query;
15
+ protected $language_switcher;
16
+ protected $translation_manager;
17
+ protected $url_converter;
18
+ protected $languages;
19
+ protected $slug_manager;
20
+ public static $translate_press = null;
21
+
22
+ /**
23
+ * Get singleton object.
24
+ *
25
+ * @return TRP_Translate_Press Singleton object.
26
+ */
27
+ public static function get_trp_instance(){
28
+ if ( self::$translate_press == null ){
29
+ self::$translate_press = new TRP_Translate_Press();
30
+ }
31
+
32
+ return self::$translate_press;
33
+ }
34
+
35
+ /**
36
+ * TRP_Translate_Press constructor.
37
+ */
38
+ public function __construct() {
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.1.7' );
43
+
44
+ $this->load_dependencies();
45
+ $this->initialize_components();
46
+ $this->define_admin_hooks();
47
+ $this->define_frontend_hooks();
48
+ }
49
+
50
+ /**
51
+ * Returns particular component by name.
52
+ *
53
+ * @param string $component 'loader' | 'settings' | 'translation_render' |
54
+ * 'machine_translator' | 'query' | 'language_switcher' |
55
+ * 'translation_manager' | 'url_converter' | 'languages'
56
+ * @return mixed
57
+ */
58
+ public function get_component( $component ){
59
+ return $this->$component;
60
+ }
61
+
62
+ /**
63
+ * Includes necessary files.
64
+ */
65
+ protected function load_dependencies() {
66
+ require_once TRP_PLUGIN_DIR . 'includes/class-settings.php';
67
+ require_once TRP_PLUGIN_DIR . 'includes/class-translation-manager.php';
68
+ require_once TRP_PLUGIN_DIR . 'includes/class-hooks-loader.php';
69
+ require_once TRP_PLUGIN_DIR . 'includes/class-languages.php';
70
+ require_once TRP_PLUGIN_DIR . 'includes/class-translation-render.php';
71
+ require_once TRP_PLUGIN_DIR . 'includes/class-language-switcher.php';
72
+ require_once TRP_PLUGIN_DIR . 'includes/class-machine-translator.php';
73
+ require_once TRP_PLUGIN_DIR . 'includes/class-query.php';
74
+ require_once TRP_PLUGIN_DIR . 'includes/class-url-converter.php';
75
+ require_once TRP_PLUGIN_DIR . 'includes/class-plugin-notices.php';
76
+ require_once TRP_PLUGIN_DIR . 'includes/functions.php';
77
+ require_once TRP_PLUGIN_DIR . 'assets/lib/simplehtmldom/simple_html_dom.php';
78
+ require_once TRP_PLUGIN_DIR . 'includes/shortcodes.php';
79
+ }
80
+
81
+ /**
82
+ * Instantiates components.
83
+ */
84
+ protected function initialize_components() {
85
+ $this->loader = new TRP_Hooks_Loader();
86
+ $this->languages = new TRP_Languages();
87
+ $this->settings = new TRP_Settings();
88
+ $this->translation_render = new TRP_Translation_Render( $this->settings->get_settings() );
89
+ $this->url_converter = new TRP_Url_Converter( $this->settings->get_settings() );
90
+ $this->language_switcher = new TRP_Language_Switcher( $this->settings->get_settings(), $this->url_converter );
91
+ $this->query = new TRP_Query( $this->settings->get_settings() );
92
+ $this->machine_translator = new TRP_Machine_Translator( $this->settings->get_settings() );
93
+ $this->translation_manager = new TRP_Translation_Manager( $this->settings->get_settings() );
94
+ $this->notifications = new TRP_Trigger_Plugin_Notifications();
95
+ }
96
+
97
+ /**
98
+ * Hooks methods used in admin area.
99
+ */
100
+ protected function define_admin_hooks() {
101
+ $this->loader->add_action( 'admin_menu', $this->settings, 'register_menu_page' );
102
+ $this->loader->add_action( 'admin_init', $this->settings, 'register_setting' );
103
+ $this->loader->add_action( 'admin_notices', $this->settings, 'admin_notices' );
104
+ $this->loader->add_action( 'admin_enqueue_scripts', $this->settings, 'enqueue_scripts_and_styles', 10, 1 );
105
+ $this->loader->add_action( 'trp_settings_navigation_tabs', $this->settings, 'add_navigation_tabs' );
106
+ $this->loader->add_action( 'trp_language_selector', $this->settings, 'languages_selector', 10, 1 );
107
+
108
+
109
+ $this->loader->add_action( 'wp_ajax_nopriv_trp_get_translations', $this->translation_manager, 'get_translations' );
110
+ $this->loader->add_action( 'wp_head', $this->translation_manager, 'add_slug_as_meta_tag', 1 );
111
+
112
+
113
+ $this->loader->add_action( 'wp_ajax_trp_get_translations', $this->translation_manager, 'get_translations' );
114
+ $this->loader->add_action( 'wp_ajax_trp_save_translations', $this->translation_manager, 'save_translations' );
115
+
116
+ $this->loader->add_action( 'wp_ajax_trp_process_js_strings_in_translation_editor', $this->translation_render, 'process_js_strings_in_translation_editor' );
117
+
118
+ $this->loader->add_action( 'wp_ajax_trp_gettext_get_translations', $this->translation_manager, 'gettext_get_translations' );
119
+ $this->loader->add_action( 'wp_ajax_trp_gettext_save_translations', $this->translation_manager, 'gettext_save_translations' );
120
+
121
+ $this->loader->add_action( 'wp_ajax_trp_publish_language', $this->translation_manager, 'publish_language' );
122
+
123
+ }
124
+
125
+ /**
126
+ * Hooks methods used in front-end
127
+ */
128
+ protected function define_frontend_hooks(){
129
+ $this->loader->add_action( 'wp', $this->translation_render, 'start_output_buffer' );
130
+ $this->loader->add_action( 'admin_init', $this->translation_render, 'start_output_buffer' );
131
+ $this->loader->add_action( 'wp_enqueue_scripts', $this->translation_render, 'enqueue_dynamic_translation', 1 );
132
+ $this->loader->add_filter( 'wp_redirect', $this->translation_render, 'force_preview_on_url_redirect', 99, 2 );
133
+ $this->loader->add_filter( 'wp_redirect', $this->translation_render, 'force_language_on_form_url_redirect', 99, 2 );
134
+ $this->loader->add_filter( 'trp_before_translate_content', $this->translation_render, 'force_preview_on_url_in_ajax', 10 );
135
+ $this->loader->add_filter( 'trp_before_translate_content', $this->translation_render, 'force_form_language_on_url_in_ajax', 20 );
136
+ /* handle CDATA str replacement from the content as it is messing up the renderer */
137
+ $this->loader->add_filter( "trp_before_translate_content", $this->translation_render, 'handle_cdata', 1000 );
138
+
139
+
140
+ $this->loader->add_action( 'wp_enqueue_scripts', $this->language_switcher, 'enqueue_language_switcher_scripts' );
141
+ $this->loader->add_action( 'wp_footer', $this->language_switcher, 'add_floater_language_switcher' );
142
+ $this->loader->add_filter( 'init', $this->language_switcher, 'register_ls_menu_switcher' );
143
+ $this->loader->add_action( 'wp_get_nav_menu_items', $this->language_switcher, 'ls_menu_permalinks', 10, 3 );
144
+ add_shortcode( 'language-switcher', array( $this->language_switcher, 'language_switcher' ) );
145
+
146
+
147
+ $this->loader->add_action( 'trp_head', $this->translation_manager, 'enqueue_scripts_and_styles' );
148
+ $this->loader->add_filter( 'template_include', $this->translation_manager, 'translation_editor', 9999 );
149
+ $this->loader->add_action( 'wp_enqueue_scripts', $this->translation_manager, 'enqueue_preview_scripts_and_styles' );
150
+ $this->loader->add_action( 'admin_bar_menu', $this->translation_manager, 'add_shortcut_to_translation_editor', 90, 1 );
151
+ $this->loader->add_filter( 'show_admin_bar', $this->translation_manager, 'hide_admin_bar_when_in_editor', 90 );
152
+
153
+
154
+
155
+ $this->loader->add_action( 'template_redirect', $this->url_converter, 'redirect_to_default_language' );
156
+ $this->loader->add_filter( 'home_url', $this->url_converter, 'add_language_to_home_url', 1, 4 );
157
+ $this->loader->add_action( 'wp_head', $this->url_converter, 'add_hreflang_to_head' );
158
+ $this->loader->add_filter( 'language_attributes', $this->url_converter, 'change_lang_attr_in_html_tag', 10, 1 );
159
+
160
+
161
+ $this->loader->add_filter( 'widget_text', null, 'do_shortcode', 11 );
162
+ $this->loader->add_filter( 'widget_text', null, 'shortcode_unautop', 11 );
163
+
164
+ /* handle dynamic texts with gettext */
165
+ $this->loader->add_filter( 'locale', $this->languages, 'change_locale' );
166
+
167
+ $this->loader->add_action( 'init', $this->translation_manager, 'create_gettext_translated_global' );
168
+ $this->loader->add_action( 'admin_init', $this->translation_manager, 'create_gettext_translated_global' );
169
+ $this->loader->add_action( 'init', $this->translation_manager, 'apply_gettext_filter_on_frontend' );
170
+ $this->loader->add_action( 'admin_init', $this->translation_manager, 'apply_gettext_filter' );
171
+ $this->loader->add_action( 'shutdown', $this->translation_manager, 'machine_translate_gettext', 100 );
172
+
173
+ /* we need the esc_ functions for html and attributes not to escape our tags so we put them back */
174
+ $this->loader->add_filter( 'esc_html', $this->translation_manager, 'handle_esc_functions_for_gettext', 10, 2 );
175
+ $this->loader->add_filter( 'attribute_escape', $this->translation_manager, 'handle_esc_functions_for_gettext', 10, 2 );
176
+ /* we need to allow the trp-gettext tag in ksses functions */
177
+ $this->loader->add_filter( 'wp_kses_allowed_html', $this->translation_manager, 'handle_kses_functions_for_gettext', 10 );
178
+ /* we need to treat the date_i18n function differently so we remove the gettext wraps */
179
+ $this->loader->add_filter( 'date_i18n', $this->translation_manager, 'handle_date_i18n_function_for_gettext', 1, 4 );
180
+
181
+ /* define an update hook here */
182
+ $this->loader->add_action( 'plugins_loaded', $this->query, 'check_for_necessary_updates' );
183
+
184
+ $this->loader->add_filter( 'trp_language_name', $this->languages, 'beautify_language_name', 10, 3 );
185
+
186
+ /* set up wp_mail hooks */
187
+ $this->loader->add_filter( 'wp_mail', $this->translation_render, 'wp_mail_filter', 200 );
188
+
189
+ /* hide php ors and notice when we are storing strings in db */
190
+ $this->loader->add_action( 'wp', $this->translation_render, 'trp_debug_mode_off' );
191
+
192
+ /* ?or init ? hook here where you can change the $current_user global */
193
+ $this->loader->add_action( 'init', $this->translation_manager, 'trp_view_as_user' );
194
+
195
+ /**
196
+ * we need to modify the permalinks structure for woocommerce when we switch languages
197
+ * when woo registers post_types and taxonomies in the rewrite parameter of the function they change the slugs of the items (they are localized with _x )
198
+ * we can't flush the permalinks on every page load so we filter the rewrite_rules option
199
+ */
200
+ $this->loader->add_filter( "option_rewrite_rules", $this->url_converter, 'woocommerce_filter_permalinks_on_other_languages' );
201
+
202
+ /* add to the body class the current language */
203
+ $this->loader->add_filter( "body_class", $this->translation_manager, 'add_language_to_body_class' );
204
+ }
205
+
206
+ /**
207
+ * Register hooks to WP.
208
+ */
209
+ public function run() {
210
+ $this->loader->run();
211
+ }
212
+
213
  }
includes/class-url-converter.php CHANGED
@@ -33,6 +33,12 @@ class TRP_Url_Converter {
33
  }
34
  $lang_from_url = $this->get_lang_from_url_string( $this->cur_page_url() );
35
 
 
 
 
 
 
 
36
  if ( $lang_from_url == null ) {
37
  $language_to_redirect = $this->settings['default-language'];
38
  if ( isset( $this->settings['translation-languages'][0] ) ) {
33
  }
34
  $lang_from_url = $this->get_lang_from_url_string( $this->cur_page_url() );
35
 
36
+ // compatibility with Elementor preview. Do not redirect to subdir language when elementor preview is present.
37
+ // TODO: move to compatibility file in the future.
38
+ if( isset( $_GET['elementor-preview'] ) ){
39
+ return;
40
+ }
41
+
42
  if ( $lang_from_url == null ) {
43
  $language_to_redirect = $this->settings['default-language'];
44
  if ( isset( $this->settings['translation-languages'][0] ) ) {
includes/trp-ajax.php CHANGED
@@ -83,7 +83,9 @@ class TRP_Ajax{
83
  'db_name' => 'DB_NAME',
84
  'db_user' => 'DB_USER',
85
  'db_password' => 'DB_PASSWORD',
86
- 'db_host' => 'DB_HOST' );
 
 
87
 
88
  foreach ( $credentials as $credential => $constant_name ) {
89
  if ( preg_match_all( "/define\s*\(\s*['\"]" . $constant_name . "['\"]\s*,\s*['\"](.*?)['\"]\s*\)/", $content, $result ) ) {
@@ -95,6 +97,7 @@ class TRP_Ajax{
95
 
96
 
97
  $this->connection = mysqli_connect( $credentials['db_host'], $credentials['db_user'], $credentials['db_password'], $credentials['db_name'] );
 
98
 
99
  // Check connection
100
  if ( mysqli_connect_errno() ) {
83
  'db_name' => 'DB_NAME',
84
  'db_user' => 'DB_USER',
85
  'db_password' => 'DB_PASSWORD',
86
+ 'db_host' => 'DB_HOST',
87
+ 'db_charset' => 'DB_CHARSET'
88
+ );
89
 
90
  foreach ( $credentials as $credential => $constant_name ) {
91
  if ( preg_match_all( "/define\s*\(\s*['\"]" . $constant_name . "['\"]\s*,\s*['\"](.*?)['\"]\s*\)/", $content, $result ) ) {
97
 
98
 
99
  $this->connection = mysqli_connect( $credentials['db_host'], $credentials['db_user'], $credentials['db_password'], $credentials['db_name'] );
100
+ mysqli_set_charset ( $this->connection , $credentials['db_charset'] );
101
 
102
  // Check connection
103
  if ( mysqli_connect_errno() ) {
index.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
- /*
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.1.6
7
- Author: Cozmoslabs, Razvan Mocanu, Madalin Ungureanu, Cristophor Hurduban
8
- Author URI: https://cozmoslabs.com/
9
- License: GPL2
10
- WC requires at least: 2.5.0
11
- WC tested up to: 3.3
12
-
13
- == Copyright ==
14
- Copyright 2017 Cozmoslabs (www.cozmoslabs.com)
15
-
16
- This program is free software; you can redistribute it and/or modify
17
- it under the terms of the GNU General Public License as published by
18
- the Free Software Foundation; either version 2 of the License, or
19
- (at your option) any later version.
20
- This program is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU General Public License for more details.
24
- You should have received a copy of the GNU General Public License
25
- along with this program; if not, write to the Free Software
26
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
- */
28
-
29
-
30
-
31
- require_once plugin_dir_path(__FILE__) . 'class-translate-press.php';
32
-
33
- function trp_run_translatepress_hooks(){
34
- $trp = TRP_Translate_Press::get_trp_instance();
35
- $trp->run();
36
- }
37
- /* make sure we execute our plugin before other plugins so the changes we make apply across the board */
38
  add_action( 'plugins_loaded', 'trp_run_translatepress_hooks', 1 );
1
+ <?php
2
+ /*
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.1.7
7
+ Author: Cozmoslabs, Razvan Mocanu, Madalin Ungureanu, Cristophor Hurduban
8
+ Author URI: https://cozmoslabs.com/
9
+ License: GPL2
10
+ WC requires at least: 2.5.0
11
+ WC tested up to: 3.3
12
+
13
+ == Copyright ==
14
+ Copyright 2017 Cozmoslabs (www.cozmoslabs.com)
15
+
16
+ This program is free software; you can redistribute it and/or modify
17
+ it under the terms of the GNU General Public License as published by
18
+ the Free Software Foundation; either version 2 of the License, or
19
+ (at your option) any later version.
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+ You should have received a copy of the GNU General Public License
25
+ along with this program; if not, write to the Free Software
26
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
+ */
28
+
29
+
30
+
31
+ require_once plugin_dir_path(__FILE__) . 'class-translate-press.php';
32
+
33
+ function trp_run_translatepress_hooks(){
34
+ $trp = TRP_Translate_Press::get_trp_instance();
35
+ $trp->run();
36
+ }
37
+ /* make sure we execute our plugin before other plugins so the changes we make apply across the board */
38
  add_action( 'plugins_loaded', 'trp_run_translatepress_hooks', 1 );
languages/translatepress-multilingual.catalog.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php __("", "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 __("TranslatePress Settings", "translatepress-multilingual"); ?>
5
+ <?php __("License Key", "translatepress-multilingual"); ?>
6
+ <?php __("Enter your license key.", "translatepress-multilingual"); ?>
7
+ <?php __("Activate License", "translatepress-multilingual"); ?>
8
+ <?php __("Deactivate License", "translatepress-multilingual"); ?>
9
+ <?php __("Translation Languages", "translatepress-multilingual"); ?>
10
+ <?php __("Language", "translatepress-multilingual"); ?>
11
+ <?php __("Slug", "translatepress-multilingual"); ?>
12
+ <?php __("Active", "translatepress-multilingual"); ?>
13
+ <?php __("Are you sure you want to remove this language?", "translatepress-multilingual"); ?>
14
+ <?php __("Remove", "translatepress-multilingual"); ?>
15
+ <?php __("Choose...", "translatepress-multilingual"); ?>
16
+ <?php __("Add", "translatepress-multilingual"); ?>
17
+ <?php __("Select the languages you wish to make your website available in.", "translatepress-multilingual"); ?>
18
+ <?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"); ?>
19
+ <?php __("Dismiss this notice.", "translatepress-multilingual"); ?>
20
+ <?php __("Full Language Names", "translatepress-multilingual"); ?>
21
+ <?php __("Short Language Names", "translatepress-multilingual"); ?>
22
+ <?php __("Flags with Full Language Names", "translatepress-multilingual"); ?>
23
+ <?php __("Flags with Short Language Names", "translatepress-multilingual"); ?>
24
+ <?php __("Only Flags", "translatepress-multilingual"); ?>
25
+ <?php __("Current Language", "translatepress-multilingual"); ?>
26
+ <?php __("General", "translatepress-multilingual"); ?>
27
+ <?php __("Translate Site", "translatepress-multilingual"); ?>
28
+ <?php __("License", "translatepress-multilingual"); ?>
29
+ <?php __("Addons", "translatepress-multilingual"); ?>
30
+ <?php __("Translate Page", "translatepress-multilingual"); ?>
31
+ <?php __("Settings", "translatepress-multilingual"); ?>
32
+ <?php __("Security check", "translatepress-multilingual"); ?>
33
+ <?php __("Meta Information", "translatepress-multilingual"); ?>
34
+ <?php __("String List", "translatepress-multilingual"); ?>
35
+ <?php __("Description", "translatepress-multilingual"); ?>
36
+ <?php __("OG Title", "translatepress-multilingual"); ?>
37
+ <?php __("OG Site Name", "translatepress-multilingual"); ?>
38
+ <?php __("OG Description", "translatepress-multilingual"); ?>
39
+ <?php __("Twitter Title", "translatepress-multilingual"); ?>
40
+ <?php __("Twitter Description", "translatepress-multilingual"); ?>
41
+ <?php __("Post Slug", "translatepress-multilingual"); ?>
42
+ <?php __("Page Title", "translatepress-multilingual"); ?>
43
+ <?php __("Change", "translatepress-multilingual"); ?>
44
+ <?php __("All Languages", "translatepress-multilingual"); ?>
45
+ <?php __("Select the language you wish to make your website available in.", "translatepress-multilingual"); ?>
46
+ <?php __("To add <strong>more then two languages</strong> and support for SEO Title, Description, Slug and more checkout <a href=\"%s\" class=\"button button-primary\" target=\"_blank\" title=\"TranslatePress Pro\">TranslatePress PRO</a>", "translatepress-multilingual"); ?>
47
+ <?php __("Not only you are getting extra features and premium support, you also help fund the future development of TranslatePress.", "translatepress-multilingual"); ?>
48
+ <?php __("Default Language", "translatepress-multilingual"); ?>
49
+ <?php __("Select the original language your website was written in. ", "translatepress-multilingual"); ?>
50
+ <?php __("Native language name", "translatepress-multilingual"); ?>
51
+ <?php __("No", "translatepress-multilingual"); ?>
52
+ <?php __("Yes", "translatepress-multilingual"); ?>
53
+ <?php __("Select Yes if you want languages to display in their native names. Otherwise, they will be displayed in English.", "translatepress-multilingual"); ?>
54
+ <?php __("Use subdirectory for default language", "translatepress-multilingual"); ?>
55
+ <?php __("Select Yes if you want to add the subdirectory in the url for the default language.</br>By selecting Yes, the default language seen by website visitors will become the first one in the \"Translation Languages\" list.", "translatepress-multilingual"); ?>
56
+ <?php __("Force language in custom links", "translatepress-multilingual"); ?>
57
+ <?php __("Select Yes if you want to force custom links without language encoding to keep the currently selected language.", "translatepress-multilingual"); ?>
58
+ <?php __("Google Translate", "translatepress-multilingual"); ?>
59
+ <?php __("Enable or disable the automatic translation of the site with Google Translate. Only untranslated strings will receive a translation.<br>You can later edit these automatic translations.<br>Note: Not all languages support automatic translation. Please consult the <a href=\"https://cloud.google.com/translate/docs/languages\" target=\"_blank\" title=\"Automatic translation supported languages.\">supported languages list</a>. ", "translatepress-multilingual"); ?>
60
+ <?php __("Google Translate API Key", "translatepress-multilingual"); ?>
61
+ <?php __("Test api key.", "translatepress-multilingual"); ?>
62
+ <?php __("Visit this <a href=\"https://support.google.com/cloud/answer/6158862\" target=\"_blank\">link</a> to see how you can set up an API key. ", "translatepress-multilingual"); ?>
63
+ <?php __("Language Switcher", "translatepress-multilingual"); ?>
64
+ <?php __("Shortcode ", "translatepress-multilingual"); ?>
65
+ <?php __("Use shortcode on any page or widget.", "translatepress-multilingual"); ?>
66
+ <?php __("Menu item", "translatepress-multilingual"); ?>
67
+ <?php __("Go to Appearance -> Menus to add Language Switcher Languages in any menu.", "translatepress-multilingual"); ?>
68
+ <?php __("Floating language selection", "translatepress-multilingual"); ?>
69
+ <?php __("Have a floating dropdown following the user on every page.", "translatepress-multilingual"); ?>
70
+ <?php __("Google API Key from settings page:", "translatepress-multilingual"); ?>
71
+ <?php __("Response:", "translatepress-multilingual"); ?>
72
+ <?php __("Response Body:", "translatepress-multilingual"); ?>
73
+ <?php __("Entire Response From wp_remote_get():", "translatepress-multilingual"); ?>
74
+ <?php __("Saved!", "translatepress-multilingual"); ?>
75
+ <?php __("Save translation", "translatepress-multilingual"); ?>
76
+ <?php __("Select string to translate...", "translatepress-multilingual"); ?>
77
+ <?php __("Gettext strings", "translatepress-multilingual"); ?>
78
+ <?php __("Previous", "translatepress-multilingual"); ?>
79
+ <?php __("Next", "translatepress-multilingual"); ?>
80
+ <?php __("View as", "translatepress-multilingual"); ?>
81
+ <?php __("Current User", "translatepress-multilingual"); ?>
82
+ <?php __("Logged Out", "translatepress-multilingual"); ?>
83
+ <?php __("Available in our Pro Versions", "translatepress-multilingual"); ?>
84
+ <?php __("You have unsaved changes!", "translatepress-multilingual"); ?>
85
+ <?php __("Original String", "translatepress-multilingual"); ?>
86
+ <?php __("To %s", "translatepress-multilingual"); ?>
87
+ <?php __("From %s", "translatepress-multilingual"); ?>
88
+ <?php __("Discard changes", "translatepress-multilingual"); ?>
89
+ <?php __("Other languages", "translatepress-multilingual"); ?>
90
+ <?php __("You can add a new language from <a href=\"%s\">Settings->TranslatePress</a>", "translatepress-multilingual"); ?>
91
+ <?php __("However, you can still use TranslatePress to <strong style=\"background: #f5fb9d;\">modify gettext strings</strong> available in your page.", "translatepress-multilingual"); ?>
92
+ <?php __("Strings that are user created can't be modified, only those from themes and plugins.", "translatepress-multilingual"); ?>
93
+ <?php __("Your Website <br/> Multiple Languages", "translatepress-multilingual"); ?>
94
+ <?php __("Support for 221 Languages", "translatepress-multilingual"); ?>
95
+ <?php __("Translate SEO Title, Description, Slug", "translatepress-multilingual"); ?>
96
+ <?php __("Translate Facebook Tags", "translatepress-multilingual"); ?>
97
+ <?php __("Create Translator Accounts", "translatepress-multilingual"); ?>
98
+ <?php __("Publish when the translation is done", "translatepress-multilingual"); ?>
99
+ <?php __("Supported By Real People", "translatepress-multilingual"); ?>
100
+ <?php __("Learn More", "translatepress-multilingual"); ?>
101
+ <?php __(" TranslatePress Settings", "translatepress-multilingual"); ?>
102
+ <?php __("Translator", "translatepress-multilingual"); ?>
103
+ <?php __("Allow this user to translate the website.", "translatepress-multilingual"); ?>
languages/translatepress-multilingual.pot ADDED
@@ -0,0 +1,422 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2018 TranslatePress Multilingual
2
+ # This file is distributed under the same license as the TranslatePress Multilingual package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: TranslatePress Multilingual\n"
6
+ "MIME-Version: 1.0\n"
7
+ "Content-Type: text/plain; charset=UTF-8\n"
8
+ "Content-Transfer-Encoding: 8bit\n"
9
+ "X-Poedit-Basepath: ..\n"
10
+ "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
11
+ "X-Poedit-SearchPath-0: .\n"
12
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
13
+ "X-Poedit-SourceCharset: UTF-8\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+
16
+ #: ../tp-add-on-extra-languages/class-extra-languages.php:57
17
+ msgid "Error! Duplicate Url slug values."
18
+ msgstr ""
19
+
20
+ #: ../tp-add-on-navigation-based-on-language/class-navigation-based-on-language.php:85
21
+ msgid "Limit this menu item to the following languages"
22
+ msgstr ""
23
+
24
+ #: ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:4, ../tp-add-on-extra-languages/partials/license-settings-page.php:4, ../tp-add-on-navigation-based-on-language/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, partials/license-settings-page.php:4
25
+ msgid "TranslatePress Settings"
26
+ msgstr ""
27
+
28
+ #: ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:10, ../tp-add-on-extra-languages/partials/license-settings-page.php:10, ../tp-add-on-navigation-based-on-language/partials/license-settings-page.php:10, ../tp-add-on-seo-pack/partials/license-settings-page.php:10, partials/license-settings-page.php:10
29
+ msgid "License Key"
30
+ msgstr ""
31
+
32
+ #: ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:15, ../tp-add-on-extra-languages/partials/license-settings-page.php:15, ../tp-add-on-navigation-based-on-language/partials/license-settings-page.php:15, ../tp-add-on-seo-pack/partials/license-settings-page.php:15, partials/license-settings-page.php:15
33
+ msgid "Enter your license key."
34
+ msgstr ""
35
+
36
+ #: ../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, ../tp-add-on-navigation-based-on-language/partials/license-settings-page.php:22, ../tp-add-on-navigation-based-on-language/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, partials/license-settings-page.php:22, partials/license-settings-page.php:31
37
+ msgid "Activate License"
38
+ msgstr ""
39
+
40
+ #: ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:28, ../tp-add-on-extra-languages/partials/license-settings-page.php:28, ../tp-add-on-navigation-based-on-language/partials/license-settings-page.php:28, ../tp-add-on-seo-pack/partials/license-settings-page.php:28, partials/license-settings-page.php:28
41
+ msgid "Deactivate License"
42
+ msgstr ""
43
+
44
+ #: ../tp-add-on-extra-languages/partials/language-selector-pro.php:2
45
+ msgid "Translation Languages"
46
+ msgstr ""
47
+
48
+ #: ../tp-add-on-extra-languages/partials/language-selector-pro.php:7, ../translatepress/partials/main-settings-language-selector.php:7
49
+ msgid "Language"
50
+ msgstr ""
51
+
52
+ #: ../tp-add-on-extra-languages/partials/language-selector-pro.php:8, ../translatepress/partials/main-settings-language-selector.php:8
53
+ msgid "Slug"
54
+ msgstr ""
55
+
56
+ #: ../tp-add-on-extra-languages/partials/language-selector-pro.php:9
57
+ msgid "Active"
58
+ msgstr ""
59
+
60
+ #: ../tp-add-on-extra-languages/partials/language-selector-pro.php:38
61
+ msgid "Are you sure you want to remove this language?"
62
+ msgstr ""
63
+
64
+ #: ../tp-add-on-extra-languages/partials/language-selector-pro.php:38
65
+ msgid "Remove"
66
+ msgstr ""
67
+
68
+ #: ../tp-add-on-extra-languages/partials/language-selector-pro.php:46, ../translatepress/partials/main-settings-language-selector.php:38, ../translatepress/partials/main-settings-language-selector.php:60
69
+ msgid "Choose..."
70
+ msgstr ""
71
+
72
+ #: ../tp-add-on-extra-languages/partials/language-selector-pro.php:53, ../translatepress/partials/main-settings-language-selector.php:67
73
+ msgid "Add"
74
+ msgstr ""
75
+
76
+ #: ../tp-add-on-extra-languages/partials/language-selector-pro.php:56
77
+ msgid "Select the languages you wish to make your website available in."
78
+ msgstr ""
79
+
80
+ #: ../translatepress/includes/class-plugin-notices.php:280
81
+ 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."
82
+ msgstr ""
83
+
84
+ #: ../translatepress/includes/class-plugin-notices.php:282
85
+ msgid "Dismiss this notice."
86
+ msgstr ""
87
+
88
+ #: ../translatepress/includes/class-settings.php:25
89
+ msgid "Full Language Names"
90
+ msgstr ""
91
+
92
+ #: ../translatepress/includes/class-settings.php:26
93
+ msgid "Short Language Names"
94
+ msgstr ""
95
+
96
+ #: ../translatepress/includes/class-settings.php:27
97
+ msgid "Flags with Full Language Names"
98
+ msgstr ""
99
+
100
+ #: ../translatepress/includes/class-settings.php:28
101
+ msgid "Flags with Short Language Names"
102
+ msgstr ""
103
+
104
+ #: ../translatepress/includes/class-settings.php:29
105
+ msgid "Only Flags"
106
+ msgstr ""
107
+
108
+ #: ../translatepress/includes/class-settings.php:351
109
+ msgid "Current Language"
110
+ msgstr ""
111
+
112
+ #: ../translatepress/includes/class-settings.php:392
113
+ msgid "General"
114
+ msgstr ""
115
+
116
+ #: ../translatepress/includes/class-settings.php:397, ../translatepress/includes/class-translation-manager.php:409
117
+ msgid "Translate Site"
118
+ msgstr ""
119
+
120
+ #: ../translatepress/includes/class-settings.php:405
121
+ msgid "License"
122
+ msgstr ""
123
+
124
+ #: ../translatepress/includes/class-settings.php:411
125
+ msgid "Addons"
126
+ msgstr ""
127
+
128
+ #: ../translatepress/includes/class-translation-manager.php:421
129
+ msgid "Translate Page"
130
+ msgstr ""
131
+
132
+ #: ../translatepress/includes/class-translation-manager.php:440
133
+ msgid "Settings"
134
+ msgstr ""
135
+
136
+ #: ../translatepress/includes/class-translation-manager.php:880
137
+ msgid "Security check"
138
+ msgstr ""
139
+
140
+ #: ../translatepress/includes/class-translation-render.php:133
141
+ msgid "Meta Information"
142
+ msgstr ""
143
+
144
+ #: ../translatepress/includes/class-translation-render.php:142
145
+ msgid "String List"
146
+ msgstr ""
147
+
148
+ #: ../translatepress/includes/class-translation-render.php:159
149
+ msgid "Description"
150
+ msgstr ""
151
+
152
+ #: ../translatepress/includes/class-translation-render.php:165
153
+ msgid "OG Title"
154
+ msgstr ""
155
+
156
+ #: ../translatepress/includes/class-translation-render.php:171
157
+ msgid "OG Site Name"
158
+ msgstr ""
159
+
160
+ #: ../translatepress/includes/class-translation-render.php:177
161
+ msgid "OG Description"
162
+ msgstr ""
163
+
164
+ #: ../translatepress/includes/class-translation-render.php:183
165
+ msgid "Twitter Title"
166
+ msgstr ""
167
+
168
+ #: ../translatepress/includes/class-translation-render.php:189
169
+ msgid "Twitter Description"
170
+ msgstr ""
171
+
172
+ #: ../translatepress/includes/class-translation-render.php:195
173
+ msgid "Post Slug"
174
+ msgstr ""
175
+
176
+ #: ../translatepress/includes/class-translation-render.php:199
177
+ msgid "Page Title"
178
+ msgstr ""
179
+
180
+ #: ../translatepress/partials/language-switcher-shortcode.php:27
181
+ msgid "Change"
182
+ msgstr ""
183
+
184
+ #: ../translatepress/partials/main-settings-language-selector.php:2
185
+ msgid "All Languages"
186
+ msgstr ""
187
+
188
+ #: ../translatepress/partials/main-settings-language-selector.php:71
189
+ msgid "Select the language you wish to make your website available in."
190
+ msgstr ""
191
+
192
+ #: ../translatepress/partials/main-settings-language-selector.php:77
193
+ msgid "To add <strong>more then two languages</strong> and support for SEO Title, Description, Slug and more checkout <a href=\"%s\" class=\"button button-primary\" target=\"_blank\" title=\"TranslatePress Pro\">TranslatePress PRO</a>"
194
+ msgstr ""
195
+
196
+ #: ../translatepress/partials/main-settings-language-selector.php:78
197
+ msgid "Not only you are getting extra features and premium support, you also help fund the future development of TranslatePress."
198
+ msgstr ""
199
+
200
+ #: ../translatepress/partials/main-settings-page.php:10
201
+ msgid "Default Language"
202
+ msgstr ""
203
+
204
+ #: ../translatepress/partials/main-settings-page.php:21
205
+ msgid "Select the original language your website was written in. "
206
+ msgstr ""
207
+
208
+ #: ../translatepress/partials/main-settings-page.php:29
209
+ msgid "Native language name"
210
+ msgstr ""
211
+
212
+ #: ../translatepress/partials/main-settings-page.php:32, ../translatepress/partials/main-settings-page.php:45, ../translatepress/partials/main-settings-page.php:58, ../translatepress/partials/main-settings-page.php:71
213
+ msgid "No"
214
+ msgstr ""
215
+
216
+ #: ../translatepress/partials/main-settings-page.php:33, ../translatepress/partials/main-settings-page.php:46, ../translatepress/partials/main-settings-page.php:59, ../translatepress/partials/main-settings-page.php:72
217
+ msgid "Yes"
218
+ msgstr ""
219
+
220
+ #: ../translatepress/partials/main-settings-page.php:36
221
+ msgid "Select Yes if you want languages to display in their native names. Otherwise, they will be displayed in English."
222
+ msgstr ""
223
+
224
+ #: ../translatepress/partials/main-settings-page.php:42
225
+ msgid "Use subdirectory for default language"
226
+ msgstr ""
227
+
228
+ #: ../translatepress/partials/main-settings-page.php:49
229
+ msgid "Select Yes if you want to add the subdirectory in the url for the default language.</br>By selecting Yes, the default language seen by website visitors will become the first one in the \"Translation Languages\" list."
230
+ msgstr ""
231
+
232
+ #: ../translatepress/partials/main-settings-page.php:55
233
+ msgid "Force language in custom links"
234
+ msgstr ""
235
+
236
+ #: ../translatepress/partials/main-settings-page.php:62
237
+ msgid "Select Yes if you want to force custom links without language encoding to keep the currently selected language."
238
+ msgstr ""
239
+
240
+ #: ../translatepress/partials/main-settings-page.php:68
241
+ msgid "Google Translate"
242
+ msgstr ""
243
+
244
+ #: ../translatepress/partials/main-settings-page.php:75
245
+ msgid "Enable or disable the automatic translation of the site with Google Translate. Only untranslated strings will receive a translation.<br>You can later edit these automatic translations.<br>Note: Not all languages support automatic translation. Please consult the <a href=\"https://cloud.google.com/translate/docs/languages\" target=\"_blank\" title=\"Automatic translation supported languages.\">supported languages list</a>. "
246
+ msgstr ""
247
+
248
+ #: ../translatepress/partials/main-settings-page.php:81
249
+ msgid "Google Translate API Key"
250
+ msgstr ""
251
+
252
+ #: ../translatepress/partials/main-settings-page.php:84
253
+ msgid "Test api key."
254
+ msgstr ""
255
+
256
+ #: ../translatepress/partials/main-settings-page.php:86
257
+ msgid "Visit this <a href=\"https://support.google.com/cloud/answer/6158862\" target=\"_blank\">link</a> to see how you can set up an API key. "
258
+ msgstr ""
259
+
260
+ #: ../translatepress/partials/main-settings-page.php:93
261
+ msgid "Language Switcher"
262
+ msgstr ""
263
+
264
+ #: ../translatepress/partials/main-settings-page.php:96
265
+ msgid "Shortcode "
266
+ msgstr ""
267
+
268
+ #: ../translatepress/partials/main-settings-page.php:101
269
+ msgid "Use shortcode on any page or widget."
270
+ msgstr ""
271
+
272
+ #: ../translatepress/partials/main-settings-page.php:105
273
+ msgid "Menu item"
274
+ msgstr ""
275
+
276
+ #: ../translatepress/partials/main-settings-page.php:110
277
+ msgid "Go to Appearance -> Menus to add Language Switcher Languages in any menu."
278
+ msgstr ""
279
+
280
+ #: ../translatepress/partials/main-settings-page.php:114
281
+ msgid "Floating language selection"
282
+ msgstr ""
283
+
284
+ #: ../translatepress/partials/main-settings-page.php:119
285
+ msgid "Have a floating dropdown following the user on every page."
286
+ msgstr ""
287
+
288
+ #: ../translatepress/partials/test-google-key-settings-page.php:22
289
+ msgid "Google API Key from settings page:"
290
+ msgstr ""
291
+
292
+ #: ../translatepress/partials/test-google-key-settings-page.php:24
293
+ msgid "Response:"
294
+ msgstr ""
295
+
296
+ #: ../translatepress/partials/test-google-key-settings-page.php:28
297
+ msgid "Response Body:"
298
+ msgstr ""
299
+
300
+ #: ../translatepress/partials/test-google-key-settings-page.php:33
301
+ msgid "Entire Response From wp_remote_get():"
302
+ msgstr ""
303
+
304
+ #: ../translatepress/partials/translation-manager.php:46
305
+ msgid "Saved!"
306
+ msgstr ""
307
+
308
+ #: ../translatepress/partials/translation-manager.php:50
309
+ msgid "Save translation"
310
+ msgstr ""
311
+
312
+ #: ../translatepress/partials/translation-manager.php:64
313
+ msgid "Select string to translate..."
314
+ msgstr ""
315
+
316
+ #: ../translatepress/partials/translation-manager.php:67
317
+ msgid "Gettext strings"
318
+ msgstr ""
319
+
320
+ #: ../translatepress/partials/translation-manager.php:72
321
+ msgid "Previous"
322
+ msgstr ""
323
+
324
+ #: ../translatepress/partials/translation-manager.php:73
325
+ msgid "Next"
326
+ msgstr ""
327
+
328
+ #: ../translatepress/partials/translation-manager.php:77
329
+ msgid "View as"
330
+ msgstr ""
331
+
332
+ #: ../translatepress/partials/translation-manager.php:80
333
+ msgid "Current User"
334
+ msgstr ""
335
+
336
+ #: ../translatepress/partials/translation-manager.php:80
337
+ msgid "Logged Out"
338
+ msgstr ""
339
+
340
+ #: ../translatepress/partials/translation-manager.php:91
341
+ msgid "Available in our Pro Versions"
342
+ msgstr ""
343
+
344
+ #: ../translatepress/partials/translation-manager.php:102
345
+ msgid "You have unsaved changes!"
346
+ msgstr ""
347
+
348
+ #: ../translatepress/partials/translation-manager.php:107
349
+ msgid "Original String"
350
+ msgstr ""
351
+
352
+ #: ../translatepress/partials/translation-manager.php:113, ../translatepress/partials/translation-manager.php:122
353
+ msgid "To %s"
354
+ msgstr ""
355
+
356
+ #: ../translatepress/partials/translation-manager.php:113, ../translatepress/partials/translation-manager.php:114
357
+ msgid "From %s"
358
+ msgstr ""
359
+
360
+ #: ../translatepress/partials/translation-manager.php:117, ../translatepress/partials/translation-manager.php:124
361
+ msgid "Discard changes"
362
+ msgstr ""
363
+
364
+ #: ../translatepress/partials/translation-manager.php:127
365
+ msgid "Other languages"
366
+ msgstr ""
367
+
368
+ #: ../translatepress/partials/translation-manager.php:140
369
+ msgid "You can add a new language from <a href=\"%s\">Settings->TranslatePress</a>"
370
+ msgstr ""
371
+
372
+ #: ../translatepress/partials/translation-manager.php:141
373
+ msgid "However, you can still use TranslatePress to <strong style=\"background: #f5fb9d;\">modify gettext strings</strong> available in your page."
374
+ msgstr ""
375
+
376
+ #: ../translatepress/partials/translation-manager.php:142
377
+ msgid "Strings that are user created can't be modified, only those from themes and plugins."
378
+ msgstr ""
379
+
380
+ #: ../translatepress/partials/translation-manager.php:153
381
+ msgid "Your Website <br/> Multiple Languages"
382
+ msgstr ""
383
+
384
+ #: ../translatepress/partials/translation-manager.php:155
385
+ msgid "Support for 221 Languages"
386
+ msgstr ""
387
+
388
+ #: ../translatepress/partials/translation-manager.php:156
389
+ msgid "Translate SEO Title, Description, Slug"
390
+ msgstr ""
391
+
392
+ #: ../translatepress/partials/translation-manager.php:157
393
+ msgid "Translate Facebook Tags"
394
+ msgstr ""
395
+
396
+ #: ../translatepress/partials/translation-manager.php:158
397
+ msgid "Create Translator Accounts"
398
+ msgstr ""
399
+
400
+ #: ../translatepress/partials/translation-manager.php:159
401
+ msgid "Publish when the translation is done"
402
+ msgstr ""
403
+
404
+ #: ../translatepress/partials/translation-manager.php:161
405
+ msgid "Supported By Real People"
406
+ msgstr ""
407
+
408
+ #: ../translatepress/partials/translation-manager.php:162
409
+ msgid "Learn More"
410
+ msgstr ""
411
+
412
+ #: includes/class-translator-accounts.php:119
413
+ msgid " TranslatePress Settings"
414
+ msgstr ""
415
+
416
+ #: includes/class-translator-accounts.php:123, includes/class-translator-accounts.php:124
417
+ msgid "Translator"
418
+ msgstr ""
419
+
420
+ #: includes/class-translator-accounts.php:128
421
+ msgid "Allow this user to translate the website."
422
+ msgstr ""
partials/addons-settings-page.php CHANGED
@@ -46,7 +46,7 @@
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/view-as-addon.png', __FILE__) ?>" alt="Browse As User Role" style="float: left; margin: 0 1.5rem 1.5rem 0;"></a>
48
  <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"> Browse As User Role</a></h3>
49
- <p>Navigate your website just like a particular user role would. Really useful for dynamic content or hidden content that appears for particular users.</p>
50
  </div>
51
  </div>
52
 
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/view-as-addon.png', __FILE__) ?>" alt="Browse As User Role" style="float: left; margin: 0 1.5rem 1.5rem 0;"></a>
48
  <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"> Browse As User Role</a></h3>
49
+ <p>Navigate your website just like a particular user role would. <br/>Really useful for dynamic content or hidden content that appears for particular users.</p>
50
  </div>
51
  </div>
52
 
readme.txt CHANGED
@@ -1,224 +1,231 @@
1
- === TranslatePress - Translate Multilingual sites ===
2
- Contributors: cozmoslabs, razvan.mo, madalin.ungureanu, cristophor
3
- Donate link: https://www.cozmoslabs.com/
4
- Tags: translate, translation, multilingual, automatic translation, front-end translation, google translate, bilingual
5
- Requires at least: 3.1.0
6
- Tested up to: 4.9.4
7
- Stable tag: 1.1.6
8
- License: GPLv2 or later
9
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
-
11
- Easily translate your entire site directly from the front-end and go multilingual, with full support for WooCommerce, complex themes and site builders. Integrates with Google Translate.
12
-
13
- == Description ==
14
-
15
- **Experience a better way to translate your WordPress site and go multilingual, directly from the front-end using a friendly user interface.**
16
-
17
- The interface allows you to easily translate the entire page at once, including output from shortcodes, forms and page builders. It also works out of the box with WooCommerce.
18
-
19
- Built the WordPress way, TranslatePress - Multilingual is a GPL and self hosted translation plugin, meaning you'll own all your translations, forever.
20
-
21
- = Multilingual & Translation Features =
22
-
23
- * Translate all your website content directly from the front-end, in a friendly user interface (translation displayed in real-time).
24
- * Fully compatible with all themes and plugins
25
- * Live preview of your translated pages, as you edit your translations.
26
- * Support for both manual and automatic translation (via Google Translate)
27
- * Ability to translate dynamic strings (gettext) added by WordPress, plugins and themes.
28
- * Integrates with Google Translate, allowing you to set up Automatic Translation using your own Google API key.
29
- * Translate larger html blocks using the css class **translation-block**. `<p class="translation-block">Translate <em>everything</em> inside</p>`
30
- * Place language switchers anywhere using shortcode **[language-switcher]**, WP menu item or as a floating dropdown.
31
- * Editorial control allowing you to publish your language only when all your translations are done
32
- * Conditional display content shortcode based on language [trp_language language="en_US"] English content only [/trp_language]
33
- * Possibility to edit gettext strings from themes and plugins from english to english, without adding another language. Basically a string-replace functionality.
34
-
35
- Note: this plugin uses the Google Translation API to translate the strings on your site. This feature can be enabled or disabled according to your preferences.
36
-
37
- Users with administrator rights have access to the following translate settings:
38
-
39
- * select default language of the website and one translation language.
40
- * choose whether language switcher should display languages in their native names or English name
41
- * force custom links to open in current language
42
- * enable or disable url subdirectory for the default language
43
- * enable automatic translation via Google Translate
44
-
45
- = Powerful Translation Add-ons =
46
-
47
- TranslatePress - Multilingual has a range of premium [Add-ons](https://translatepress.com/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) that allow you to extend the power of the translation plugin:
48
-
49
- **Pro Add-ons** (available in the [premium versions](https://translatepress.com/pricing/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) only)
50
-
51
- * [Extra Languages](https://translatepress.com/docs/addons/seo-pack/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) - allows you to add an unlimited number of translation languages, with the possibility to publish languages later after you complete the translation
52
- * [SEO Pack](https://translatepress.com/docs/addons/multiple-languages/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) - allows you to translate meta information (like page title, description, url slug, image alt tag, Twitter and Facebook Social Graph tags & more) for boosting your website's SEO and increase traffic
53
- * [Translator Accounts](https://translatepress.com/docs/addons/translator-accounts/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) - create or allow existing users to translate the site without admin rights
54
- * [Browse as User Role](https://translatepress.com/docs/addons/browse-as-role/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) - view and translate content that is visible only to a particular user role
55
- * [Navigation Based on Language](https://translatepress.com/docs/addons/navigate-based-language/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) - configure and display different menu items for different languages
56
-
57
- **Free Add-ons**
58
-
59
- * [Language by GET parameter](https://translatepress.com/docs/addons/language-get-parameter/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) - enables the language in the URL to be encoded as a GET Parameter
60
-
61
- = Website =
62
-
63
- [translatepress.com](https://translatepress.com/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree)
64
-
65
- = Documentation =
66
-
67
- [Visit our documentation page](https://translatepress.com/docs/translatepress/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree)
68
-
69
- = Add-ons =
70
-
71
- [Add-ons](https://translatepress.com/docs/translatepress/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree)
72
-
73
- = Demo Site =
74
-
75
- You can test out TranslatePress - Multilingual by [visiting our demo site](https://demo.translatepress.com/)
76
-
77
- == Installation ==
78
-
79
- 1. Upload the translatepress folder to the '/wp-content/plugins/' directory
80
- 2. Activate the plugin through the 'Plugins' menu in WordPress
81
- 3. Go to Settings -> TranslatePress and choose a translation language.
82
- 4. Open the front-end translation editor from the admin bar to translate your site.
83
-
84
- == Frequently Asked Questions ==
85
-
86
- = Where are my translations stored? =
87
-
88
- All the translation are stored locally in your server's database.
89
-
90
- = What types of content can I translate? =
91
-
92
- TranslatePress - Multilingual works out of the box with WooCommerce, custom post types, complex themes and site builders, so you'll be able to translate any type of content.
93
-
94
- = How is it different from other multilingual & translation plugins? =
95
-
96
- TranslatePress is easier to use and more intuitive altogether. No more switching between the editor, string translation interfaces or badly translated plugins. You can now translate the full page content directly from the front-end.
97
-
98
- = How do I start to translate my site? =
99
-
100
- After installing the plugin, select your secondary language and click "Translate Site" to start translating your entire site exactly as it looks in the front-end.
101
-
102
- = Where can I find out more information? =
103
-
104
- For more information please check out [TranslatePress documentation](https://translatepress.com/docs/translatepress/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree).
105
-
106
-
107
- == Screenshots ==
108
- 1. Front-end translation editor used to translate the entire page content
109
- 2. How to translate a Dynamic String (gettext) using TranslatePress - Multilingual
110
- 3. Translate Woocommerce Shop Page
111
- 4. Settings Page for TranslatePress - Multilingual
112
- 5. Floating Language Switcher added by TranslatePress - Multilingual
113
- 6. Menu Language Switcher
114
-
115
- == Changelog ==
116
- = 1.1.6 =
117
- * Added support for translating Contact Form 7 alert messages
118
- * Fixed issue with some strings containing special characters not being translated (i.e. "¿¡")
119
- * Fixed bug with switching languages in Editor when viewing as Logged out
120
- * Fixed issue with broken homepage links in some themes
121
- * Added support for RTL languages in translation editor
122
-
123
- = 1.1.5 =
124
- * Added support for translation blocks using the css class .translation-block.
125
- * Added possibility to choose a different language as default language seen by website visitors.
126
- * Updated add-ons settings page with the missing add-ons, added Language by GET parameter addon
127
- * Fixed issue with the [language-switcher] in a post or page that broke saving the page when Yoast SEO plugin is active
128
- * Added a plugin notification class and a notification for pretty permalinks
129
- * Added WooCommerce compatibility tag
130
- * Small css improvements
131
-
132
- = 1.1.4 =
133
- * Filter to allow adding new language: 'trp_wp_languages'
134
- * Fixed issue with get_permalink() in ajax calls that was not returning the propper language
135
- * Adapted code to allow language based on a GET parameter
136
- * Fix some issues with language switcher and custom queries as well as take into account if subdirectory for default language is on
137
- * Fixed issue with js translation that was trimming numbers and other characters from strings when it shouldn't
138
-
139
- = 1.1.3 =
140
- * Fix issue where the language switcher didn't work for BuddyPress pages
141
- * Fixed issue with CDATA in post content that was breaking the translation
142
- * Added a filter that can be activated and that tries to fix invalid html: trp_try_fixing_invalid_html
143
-
144
- = 1.1.2 =
145
- * We now make sure that all forms when submitted redirect to the correct language
146
- * Fixed an issue with missing slash from language switcher
147
- * Fixed an issue where we were not redirecting to the correct url slug when switching languages
148
- * Fixed a possible notice inside the get_language_names function
149
- * Fixed html breaking because of unescaped quotes in translated meta content
150
- * Removed a special character from the full_trim function that was causing some strings to not be selectable for translation
151
-
152
- = 1.1.1 =
153
- * Fixed js error with startsWith method not being supported in IE
154
- * Removed unnecessary files from select2 lib
155
- * Improved the way we rewrite urls to remove certain bugs
156
-
157
- = 1.1.0 =
158
- * Implemented View As "Logged out user" functionality so you can translate strings that show only for logged out users
159
- * Allow slug edit for default language
160
- * Fixed an issue with the dropdown of translation strings when there were unsaved changes and the dropdown disconected from the textarea
161
- * Prevent translate editor icon pencil to exit the translation iframe
162
- * Fixed translating via the next/prev buttons that reset the position in the translation string list
163
- * Refactor the way we are generating the language url for the language switcher when we don't have a variable available
164
-
165
- = 1.0.9 =
166
- * We now flush permalinks when saving the settings page to avoid getting 404 and 500 errors
167
- * Added the current language as a class on the body tag. Ex: translatepress-en_US
168
- * Small readme changes
169
-
170
- = 1.0.8 =
171
- * We now allow HTML in normal strings translations.
172
- * Changed the way we get the default language permalinks in Woocommerce rewrites
173
- * Fixed issues with date_i18n function
174
- * Fixed a warning generated when there are no rewrite rules
175
- * Fixed dynamic strings not updating the translation dropdown list.
176
- * Fixed issues with hidden space characters that were breaking some translations
177
- * Make sure we don't loose the trp-edit-translation=preview from url after a WordPress redirect
178
-
179
- = 1.0.7 =
180
- * Fixed a small bug in js regarding the translation editor sidebar with
181
- * Fixed Language Switcher for Woocommerce product categories and product tags going to 404 pages
182
- * Fixed issues with Woocommerce and permalinks when the default language was not english
183
- * Excluded more functions from getting gettext wraps
184
-
185
- = 1.0.6 =
186
- * Added filter on capabilities to allow other roles to edit translations:'trp_translating_capability'
187
- * Don't show php errors and notices when we are storing strings in the database
188
- * Fixed issues with attributes that contain json content, for instance in woocommerce variations
189
- * We no longer wrap gettext inside the wptexturize function
190
- * We no longer wrap gettexts that appear in the bloginfo function
191
-
192
- = 1.0.5 =
193
- * Added possibility to edit gettext strings from themes and plugins from english to english, without adding another language. Basically, string-replace functionality.
194
- * We now can translate text input placeholders
195
- * We have a way of translating emails using the conditional language shortcode [trp_language language="en_US"] English only content [/trp_language]
196
- * Fixed issues with some elements that contained new lines and \u00a0 at the start of the strings
197
-
198
- = 1.0.4 =
199
- * Fixed issues with the pencil select icon in the translation editor not showing up in certain cases on the button element
200
- * Fixed issues with the pencil select icon in the translation editor not showing up in certain cases because of overflow hidden
201
- * Fixed a issue that was sometimes causing javascript errors with certain plugins
202
-
203
- = 1.0.3 =
204
- * Added a conditional language shortcode: [trp_language language="en_US"] English only content [/trp_language]
205
- * Create link to test out Google API key.
206
- * Improvements to Woocommerce compatibility
207
- * Fixed json_encode error that was causing js errors
208
- * Changed 'template_include' hook priority to improve compatibility with some themes
209
-
210
- = 1.0.2 =
211
- * Translation interface improvements
212
- * Fixed issues with strings loaded with ajax
213
- * Added an addon page
214
- * Fixed bug with gettext node accidentally wrapping another string too.
215
-
216
- = 1.0.1 =
217
- * Fixed incorrect blog prefix name for Multisite subsites on admin_bar gettext hook.
218
- * Fixed Translate Page admin bar button sometimes not having the correct url for entering TP Editor Mode
219
- * Skipped dynamic strings that have only numbers and special characters.
220
- * Fixed order of categories in Editor dropdown. (Meta Information, String List..)
221
- * Fixed JS error Uncaught Error: Syntax error, unrecognized expression
222
-
223
- = 1.0.0 =
 
 
 
 
 
 
 
224
  * Initial release.
1
+ === TranslatePress - Translate Multilingual sites ===
2
+ Contributors: cozmoslabs, razvan.mo, madalin.ungureanu, cristophor
3
+ Donate link: https://www.cozmoslabs.com/
4
+ Tags: translate, translation, multilingual, automatic translation, front-end translation, google translate, bilingual
5
+ Requires at least: 3.1.0
6
+ Tested up to: 4.9.4
7
+ Stable tag: 1.1.7
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ Easily translate your entire site directly from the front-end and go multilingual, with full support for WooCommerce, complex themes and site builders. Integrates with Google Translate.
12
+
13
+ == Description ==
14
+
15
+ **Experience a better way to translate your WordPress site and go multilingual, directly from the front-end using a friendly user interface.**
16
+
17
+ The interface allows you to easily translate the entire page at once, including output from shortcodes, forms and page builders. It also works out of the box with WooCommerce.
18
+
19
+ Built the WordPress way, TranslatePress - Multilingual is a GPL and self hosted translation plugin, meaning you'll own all your translations, forever.
20
+
21
+ = Multilingual & Translation Features =
22
+
23
+ * Translate all your website content directly from the front-end, in a friendly user interface (translation displayed in real-time).
24
+ * Fully compatible with all themes and plugins
25
+ * Live preview of your translated pages, as you edit your translations.
26
+ * Support for both manual and automatic translation (via Google Translate)
27
+ * Ability to translate dynamic strings (gettext) added by WordPress, plugins and themes.
28
+ * Integrates with Google Translate, allowing you to set up Automatic Translation using your own Google API key.
29
+ * Translate larger html blocks using the css class **translation-block**. `<p class="translation-block">Translate <em>everything</em> inside</p>`
30
+ * Place language switchers anywhere using shortcode **[language-switcher]**, WP menu item or as a floating dropdown.
31
+ * Editorial control allowing you to publish your language only when all your translations are done
32
+ * Conditional display content shortcode based on language [trp_language language="en_US"] English content only [/trp_language]
33
+ * Possibility to edit gettext strings from themes and plugins from english to english, without adding another language. Basically a string-replace functionality.
34
+
35
+ Note: this plugin uses the Google Translation API to translate the strings on your site. This feature can be enabled or disabled according to your preferences.
36
+
37
+ Users with administrator rights have access to the following translate settings:
38
+
39
+ * select default language of the website and one translation language.
40
+ * choose whether language switcher should display languages in their native names or English name
41
+ * force custom links to open in current language
42
+ * enable or disable url subdirectory for the default language
43
+ * enable automatic translation via Google Translate
44
+
45
+ = Powerful Translation Add-ons =
46
+
47
+ TranslatePress - Multilingual has a range of premium [Add-ons](https://translatepress.com/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) that allow you to extend the power of the translation plugin:
48
+
49
+ **Pro Add-ons** (available in the [premium versions](https://translatepress.com/pricing/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) only)
50
+
51
+ * [Extra Languages](https://translatepress.com/docs/addons/seo-pack/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) - allows you to add an unlimited number of translation languages, with the possibility to publish languages later after you complete the translation
52
+ * [SEO Pack](https://translatepress.com/docs/addons/multiple-languages/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) - allows you to translate meta information (like page title, description, url slug, image alt tag, Twitter and Facebook Social Graph tags & more) for boosting your website's SEO and increase traffic
53
+ * [Translator Accounts](https://translatepress.com/docs/addons/translator-accounts/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) - create or allow existing users to translate the site without admin rights
54
+ * [Browse as User Role](https://translatepress.com/docs/addons/browse-as-role/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) - view and translate content that is visible only to a particular user role
55
+ * [Navigation Based on Language](https://translatepress.com/docs/addons/navigate-based-language/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) - configure and display different menu items for different languages
56
+
57
+ **Free Add-ons**
58
+
59
+ * [Language by GET parameter](https://translatepress.com/docs/addons/language-get-parameter/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree) - enables the language in the URL to be encoded as a GET Parameter
60
+
61
+ = Website =
62
+
63
+ [translatepress.com](https://translatepress.com/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree)
64
+
65
+ = Documentation =
66
+
67
+ [Visit our documentation page](https://translatepress.com/docs/translatepress/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree)
68
+
69
+ = Add-ons =
70
+
71
+ [Add-ons](https://translatepress.com/docs/translatepress/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree)
72
+
73
+ = Demo Site =
74
+
75
+ You can test out TranslatePress - Multilingual by [visiting our demo site](https://demo.translatepress.com/)
76
+
77
+ == Installation ==
78
+
79
+ 1. Upload the translatepress folder to the '/wp-content/plugins/' directory
80
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
81
+ 3. Go to Settings -> TranslatePress and choose a translation language.
82
+ 4. Open the front-end translation editor from the admin bar to translate your site.
83
+
84
+ == Frequently Asked Questions ==
85
+
86
+ = Where are my translations stored? =
87
+
88
+ All the translation are stored locally in your server's database.
89
+
90
+ = What types of content can I translate? =
91
+
92
+ TranslatePress - Multilingual works out of the box with WooCommerce, custom post types, complex themes and site builders, so you'll be able to translate any type of content.
93
+
94
+ = How is it different from other multilingual & translation plugins? =
95
+
96
+ TranslatePress is easier to use and more intuitive altogether. No more switching between the editor, string translation interfaces or badly translated plugins. You can now translate the full page content directly from the front-end.
97
+
98
+ = How do I start to translate my site? =
99
+
100
+ After installing the plugin, select your secondary language and click "Translate Site" to start translating your entire site exactly as it looks in the front-end.
101
+
102
+ = Where can I find out more information? =
103
+
104
+ For more information please check out [TranslatePress documentation](https://translatepress.com/docs/translatepress/?utm_source=wp.org&utm_medium=tp-description-page&utm_campaign=TPFree).
105
+
106
+
107
+ == Screenshots ==
108
+ 1. Front-end translation editor used to translate the entire page content
109
+ 2. How to translate a Dynamic String (gettext) using TranslatePress - Multilingual
110
+ 3. Translate Woocommerce Shop Page
111
+ 4. Settings Page for TranslatePress - Multilingual
112
+ 5. Floating Language Switcher added by TranslatePress - Multilingual
113
+ 6. Menu Language Switcher
114
+
115
+ == Changelog ==
116
+ = 1.1.7 =
117
+ * Compatibility fix with Elementor Page Builder
118
+ * Added translation .pot file
119
+ * Add proper encoding for mysqli connection in our trp-ajax.php file so we fixed some translation
120
+ * Fixed infinite loop related to mutation observer on javascript strings by not re-adding detected strings again if they are similar to existing ones
121
+ * Aligned text from add-ons tab.
122
+
123
+ = 1.1.6 =
124
+ * Added support for translating Contact Form 7 alert messages
125
+ * Fixed issue with some strings containing special characters not being translated (i.e. "¿¡")
126
+ * Fixed bug with switching languages in Editor when viewing as Logged out
127
+ * Fixed issue with broken homepage links in some themes
128
+ * Added support for RTL languages in translation editor
129
+
130
+ = 1.1.5 =
131
+ * Added support for translation blocks using the css class .translation-block.
132
+ * Added possibility to choose a different language as default language seen by website visitors.
133
+ * Updated add-ons settings page with the missing add-ons, added Language by GET parameter addon
134
+ * Fixed issue with the [language-switcher] in a post or page that broke saving the page when Yoast SEO plugin is active
135
+ * Added a plugin notification class and a notification for pretty permalinks
136
+ * Added WooCommerce compatibility tag
137
+ * Small css improvements
138
+
139
+ = 1.1.4 =
140
+ * Filter to allow adding new language: 'trp_wp_languages'
141
+ * Fixed issue with get_permalink() in ajax calls that was not returning the propper language
142
+ * Adapted code to allow language based on a GET parameter
143
+ * Fix some issues with language switcher and custom queries as well as take into account if subdirectory for default language is on
144
+ * Fixed issue with js translation that was trimming numbers and other characters from strings when it shouldn't
145
+
146
+ = 1.1.3 =
147
+ * Fix issue where the language switcher didn't work for BuddyPress pages
148
+ * Fixed issue with CDATA in post content that was breaking the translation
149
+ * Added a filter that can be activated and that tries to fix invalid html: trp_try_fixing_invalid_html
150
+
151
+ = 1.1.2 =
152
+ * We now make sure that all forms when submitted redirect to the correct language
153
+ * Fixed an issue with missing slash from language switcher
154
+ * Fixed an issue where we were not redirecting to the correct url slug when switching languages
155
+ * Fixed a possible notice inside the get_language_names function
156
+ * Fixed html breaking because of unescaped quotes in translated meta content
157
+ * Removed a special character from the full_trim function that was causing some strings to not be selectable for translation
158
+
159
+ = 1.1.1 =
160
+ * Fixed js error with startsWith method not being supported in IE
161
+ * Removed unnecessary files from select2 lib
162
+ * Improved the way we rewrite urls to remove certain bugs
163
+
164
+ = 1.1.0 =
165
+ * Implemented View As "Logged out user" functionality so you can translate strings that show only for logged out users
166
+ * Allow slug edit for default language
167
+ * Fixed an issue with the dropdown of translation strings when there were unsaved changes and the dropdown disconected from the textarea
168
+ * Prevent translate editor icon pencil to exit the translation iframe
169
+ * Fixed translating via the next/prev buttons that reset the position in the translation string list
170
+ * Refactor the way we are generating the language url for the language switcher when we don't have a variable available
171
+
172
+ = 1.0.9 =
173
+ * We now flush permalinks when saving the settings page to avoid getting 404 and 500 errors
174
+ * Added the current language as a class on the body tag. Ex: translatepress-en_US
175
+ * Small readme changes
176
+
177
+ = 1.0.8 =
178
+ * We now allow HTML in normal strings translations.
179
+ * Changed the way we get the default language permalinks in Woocommerce rewrites
180
+ * Fixed issues with date_i18n function
181
+ * Fixed a warning generated when there are no rewrite rules
182
+ * Fixed dynamic strings not updating the translation dropdown list.
183
+ * Fixed issues with hidden space characters that were breaking some translations
184
+ * Make sure we don't loose the trp-edit-translation=preview from url after a WordPress redirect
185
+
186
+ = 1.0.7 =
187
+ * Fixed a small bug in js regarding the translation editor sidebar with
188
+ * Fixed Language Switcher for Woocommerce product categories and product tags going to 404 pages
189
+ * Fixed issues with Woocommerce and permalinks when the default language was not english
190
+ * Excluded more functions from getting gettext wraps
191
+
192
+ = 1.0.6 =
193
+ * Added filter on capabilities to allow other roles to edit translations:'trp_translating_capability'
194
+ * Don't show php errors and notices when we are storing strings in the database
195
+ * Fixed issues with attributes that contain json content, for instance in woocommerce variations
196
+ * We no longer wrap gettext inside the wptexturize function
197
+ * We no longer wrap gettexts that appear in the bloginfo function
198
+
199
+ = 1.0.5 =
200
+ * Added possibility to edit gettext strings from themes and plugins from english to english, without adding another language. Basically, string-replace functionality.
201
+ * We now can translate text input placeholders
202
+ * We have a way of translating emails using the conditional language shortcode [trp_language language="en_US"] English only content [/trp_language]
203
+ * Fixed issues with some elements that contained new lines and \u00a0 at the start of the strings
204
+
205
+ = 1.0.4 =
206
+ * Fixed issues with the pencil select icon in the translation editor not showing up in certain cases on the button element
207
+ * Fixed issues with the pencil select icon in the translation editor not showing up in certain cases because of overflow hidden
208
+ * Fixed a issue that was sometimes causing javascript errors with certain plugins
209
+
210
+ = 1.0.3 =
211
+ * Added a conditional language shortcode: [trp_language language="en_US"] English only content [/trp_language]
212
+ * Create link to test out Google API key.
213
+ * Improvements to Woocommerce compatibility
214
+ * Fixed json_encode error that was causing js errors
215
+ * Changed 'template_include' hook priority to improve compatibility with some themes
216
+
217
+ = 1.0.2 =
218
+ * Translation interface improvements
219
+ * Fixed issues with strings loaded with ajax
220
+ * Added an addon page
221
+ * Fixed bug with gettext node accidentally wrapping another string too.
222
+
223
+ = 1.0.1 =
224
+ * Fixed incorrect blog prefix name for Multisite subsites on admin_bar gettext hook.
225
+ * Fixed Translate Page admin bar button sometimes not having the correct url for entering TP Editor Mode
226
+ * Skipped dynamic strings that have only numbers and special characters.
227
+ * Fixed order of categories in Editor dropdown. (Meta Information, String List..)
228
+ * Fixed JS error Uncaught Error: Syntax error, unrecognized expression
229
+
230
+ = 1.0.0 =
231
  * Initial release.