Changeset 3447171
- Timestamp:
- 01/26/2026 02:48:11 PM (2 months ago)
- Location:
- falang
- Files:
-
- 4 added
- 34 edited
- 1 copied
-
tags/1.4.0 (copied) (copied from falang/trunk)
-
tags/1.4.0/README.txt (modified) (4 diffs)
-
tags/1.4.0/admin/class-falang-admin.php (modified) (4 diffs)
-
tags/1.4.0/admin/css/falang-admin.css (modified) (1 diff)
-
tags/1.4.0/admin/js/translatorChatGPT.js (added)
-
tags/1.4.0/admin/js/translatorDeepl.js (modified) (2 diffs)
-
tags/1.4.0/admin/js/translatorYandex.js (modified) (1 diff)
-
tags/1.4.0/admin/views/edit_menu_page.php (modified) (1 diff)
-
tags/1.4.0/admin/views/edit_post_page.php (modified) (2 diffs)
-
tags/1.4.0/admin/views/edit_post_page_acf.php (modified) (1 diff)
-
tags/1.4.0/admin/views/falang_option_translation_page.php (modified) (1 diff)
-
tags/1.4.0/admin/views/falang_string_translation_page.php (modified) (1 diff)
-
tags/1.4.0/admin/views/falang_term_translation_page.php (modified) (2 diffs)
-
tags/1.4.0/admin/views/settings_page.php (modified) (1 diff)
-
tags/1.4.0/admin/views/settings_tab_general_settings.php (modified) (2 diffs)
-
tags/1.4.0/buid.xml (modified) (1 diff)
-
tags/1.4.0/falang.php (modified) (2 diffs)
-
tags/1.4.0/includes/class-falang-activator.php (modified) (2 diffs)
-
tags/1.4.0/src/Falang/Translator/TranslatorChatGPT.php (added)
-
tags/1.4.0/src/Falang/Translator/TranslatorDefault.php (modified) (1 diff)
-
trunk/README.txt (modified) (4 diffs)
-
trunk/admin/class-falang-admin.php (modified) (4 diffs)
-
trunk/admin/css/falang-admin.css (modified) (1 diff)
-
trunk/admin/js/translatorChatGPT.js (added)
-
trunk/admin/js/translatorDeepl.js (modified) (2 diffs)
-
trunk/admin/js/translatorYandex.js (modified) (1 diff)
-
trunk/admin/views/edit_menu_page.php (modified) (1 diff)
-
trunk/admin/views/edit_post_page.php (modified) (2 diffs)
-
trunk/admin/views/edit_post_page_acf.php (modified) (1 diff)
-
trunk/admin/views/falang_option_translation_page.php (modified) (1 diff)
-
trunk/admin/views/falang_string_translation_page.php (modified) (1 diff)
-
trunk/admin/views/falang_term_translation_page.php (modified) (2 diffs)
-
trunk/admin/views/settings_page.php (modified) (1 diff)
-
trunk/admin/views/settings_tab_general_settings.php (modified) (2 diffs)
-
trunk/buid.xml (modified) (1 diff)
-
trunk/falang.php (modified) (2 diffs)
-
trunk/includes/class-falang-activator.php (modified) (2 diffs)
-
trunk/src/Falang/Translator/TranslatorChatGPT.php (added)
-
trunk/src/Falang/Translator/TranslatorDefault.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
falang/tags/1.4.0/README.txt
r3409340 r3447171 4 4 Tags: multilingual, translation, translate, bilingual, localization 5 5 Requires at least: 4.7 6 Tested up to: 6. 86 Tested up to: 6.9 7 7 Requires PHP: 5.6 8 Stable tag: 1. 3.678 Stable tag: 1.4.0 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 15 15 16 16 Falang is a multilanguage plugin for WordPress. It allows you to translate an existing WordPress site to other languages. Falang natively supports WooCommerce (product, variation, category, tag, attribute, etc.) 17 17 You can use translation services such as Google, Azure, DeepL (Pro), or ChatGPT (Pro) to assist you. 18 18 = Free vs Pro = 19 19 20 20 Pro version: 21 21 - Enabled popup translation for (menu/post,product...) 22 - ChatGPT translation service 22 23 - DeepL translation service 23 24 - Translate/configure WooCommerce email … … 27 28 - WC Product addons 28 29 - CookieYes 30 - and more.... 29 31 30 32 = Concept = … … 111 113 == Changelog == 112 114 115 * 1.4.0 (2026/01/26) 116 * add ChatGPT translation service (Pro) 117 * improve DeepL translation service (Pro) 118 * change tips display link color and fadOut 119 * WordPress 6.9 compatible 120 113 121 * 1.3.68 (2025/12/03) 114 122 * fix meta translation with serialised object -
falang/tags/1.4.0/admin/class-falang-admin.php
r3409340 r3447171 1008 1008 * @update 1.3.50 fix scss vulnerability's need to sanitize text field (sevice keys and downloadid) 1009 1009 * @update 1.3.54 add deepl 1010 * @update 1.4.0 add chatgpt key and model 1010 1011 */ 1011 1012 public function save_settings() … … 1073 1074 $options['deepl_key'] = (isset($_POST['deepl_key']) && $_POST['deepl_key']) ? sanitize_text_field($_POST['deepl_key']) : ''; 1074 1075 $options['deepl_free'] = (isset($_POST['deepl_free']) && $_POST['deepl_free']) ? true : false; 1076 $options['chatgpt_key'] = (isset($_POST['chatgpt_key']) && $_POST['chatgpt_key']) ? sanitize_text_field($_POST['chatgpt_key']) : ''; 1077 $options['chatgpt_model'] = (isset($_POST['chatgpt_model']) && $_POST['chatgpt_model']) ? sanitize_text_field($_POST['chatgpt_model']) : 'gpt-4o'; 1075 1078 1076 1079 $options['debug_admin'] = (isset($_POST['debug_admin']) && $_POST['debug_admin']) ? $_POST['debug_admin'] : ''; … … 3086 3089 /* 3087 3090 * @from 1.3.49 3091 * @update 1.4 : check the post parameter 3088 3092 * 3089 3093 * $result sucess true/false … … 3093 3097 public function ajax_service_translate() { 3094 3098 3095 $targetLanguageLocale = !empty( $_POST['targetLanguageLocale'] ) ? $_POST['targetLanguageLocale']:'' ;3096 $testToTranslate = !empty( $_POST['text'] ) ? $_POST['text']:'' ;3099 $targetLanguageLocale = !empty( $_POST['targetLanguageLocale'] ) ? sanitize_text_field($_POST['targetLanguageLocale']) :'' ; 3100 $testToTranslate = !empty( $_POST['text'] ) ? wp_kses_post($_POST['text']) :'' ; 3097 3101 3098 3102 $service = TranslatorFactory::getTranslator($targetLanguageLocale); 3099 $result = $service->translate($testToTranslate [0],$targetLanguageLocale);3103 $result = $service->translate($testToTranslate,$targetLanguageLocale); 3100 3104 3101 3105 Falang()->return_json($result); -
falang/tags/1.4.0/admin/css/falang-admin.css
r3272201 r3447171 578 578 } 579 579 580 #tiptip_content a { 581 color: #fff; 582 } 583 580 584 /* pages post*/ 581 585 .falang_post_status{width: 30px;display: inline-block;font-size: 11px;position: relative} -
falang/tags/1.4.0/admin/js/translatorDeepl.js
r3232494 r3447171 8 8 sourceLanguageCode: translator.from, 9 9 targetLanguageLocale: translator.to, 10 text: [sourceText]10 text: sourceText 11 11 }; 12 12 … … 30 30 }, 31 31 error: function (xhr, textStatus, errorThrown) { 32 translatedText = "ERROR "+xhr.responseJSON["code"]+": "+xhr.responseJSON["message"]; 32 const translatedText = "ERROR : " + textStatus; 33 setTranslation(fieldName, translatedText); 34 console.log(errorThrown); 33 35 }, 34 36 complete: function() { -
falang/tags/1.4.0/admin/js/translatorYandex.js
r3059173 r3447171 6 6 targetLanguageCode: translator.to, 7 7 format: 'HTML', 8 texts: [sourceText]8 texts: sourceText 9 9 }; 10 10 -
falang/tags/1.4.0/admin/views/edit_menu_page.php
r3232494 r3447171 179 179 <!-- add yandex/azure button --> 180 180 <?php if ($falang_model->get_option('enable_service') == '1') { ?> 181 <?php if ($falang_model->get_option('service_name') == 'chatgpt') { ?> 182 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 183 <?php } ?> 181 184 <?php if ($falang_model->get_option('service_name') == 'deepl') { ?> 182 185 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> -
falang/tags/1.4.0/admin/views/edit_post_page.php
r3291681 r3447171 161 161 <!-- add yandex/azure button --> 162 162 <?php if ($falang_model->get_option('enable_service') == '1') { ?> 163 <?php if ($falang_model->get_option('service_name') == 'chatgpt') { ?> 164 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 165 <?php } ?> 163 166 <?php if ($falang_model->get_option('service_name') == 'deepl') { ?> 164 167 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> … … 250 253 <!-- add yandex/azure button --> 251 254 <?php if ($falang_model->get_option('enable_service') == '1') { ?> 255 <?php if ($falang_model->get_option('service_name') == 'chatgpt') { ?> 256 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 257 <?php } ?> 252 258 <?php if ($falang_model->get_option('service_name') == 'deepl') { ?> 253 259 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> -
falang/tags/1.4.0/admin/views/edit_post_page_acf.php
r3251222 r3447171 57 57 <!-- add yandex/azure button --> 58 58 <?php if ($falang_model->get_option('enable_service') == '1') { ?> 59 <?php if ($falang_model->get_option('service_name') == 'chatgpt') { ?> 60 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 61 <?php } ?> 59 62 <?php if ($falang_model->get_option('service_name') == 'deepl') { ?> 60 63 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> -
falang/tags/1.4.0/admin/views/falang_option_translation_page.php
r3251222 r3447171 365 365 <?php if ( !$multiple) { ?> 366 366 <?php if ($this->model->get_option('enable_service') == '1') { ?> 367 <?php if ($this->model->get_option('service_name') == 'chatgpt') { ?> 368 <button class="button-secondary button-copy" onclick="copyToTranslation('translation','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 369 <?php } ?> 367 370 <?php if ($this->model->get_option('service_name') == 'deepl') { ?> 368 371 <button class="button-secondary button-copy" onclick="copyToTranslation('translation','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> -
falang/tags/1.4.0/admin/views/falang_string_translation_page.php
r3251222 r3447171 162 162 <!-- add yandex/azure button --> 163 163 <?php if ($falang_model->get_option('enable_service') == '1') { ?> 164 <?php if ($falang_model->get_option('service_name') == 'chatgpt') { ?> 165 <button class="button-secondary button-copy" onclick="copyToTranslation('translation','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 166 <?php } ?> 164 167 <?php if ($falang_model->get_option('service_name') == 'deepl') { ?> 165 168 <button class="button-secondary button-copy" onclick="copyToTranslation('translation','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> -
falang/tags/1.4.0/admin/views/falang_term_translation_page.php
r3251222 r3447171 168 168 <!-- add yandex/azure button --> 169 169 <?php if ($this->model->get_option('enable_service') == '1') { ?> 170 <?php if ($this->model->get_option('service_name') == 'chatgpt') { ?> 171 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $field;?>','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 172 <?php } ?> 170 173 <?php if ($this->model->get_option('service_name') == 'deepl') { ?> 171 174 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $field;?>','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> … … 216 219 <!-- add yandex/azure button --> 217 220 <?php if ($this->model->get_option('enable_service') == '1') { ?> 221 <?php if ($this->model->get_option('service_name') == 'chatgpt') { ?> 222 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $metafield;?>','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 223 <?php } ?> 218 224 <?php if ($this->model->get_option('service_name') == 'deepl') { ?> 219 225 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $metafield;?>','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> -
falang/tags/1.4.0/admin/views/settings_page.php
r2748567 r3447171 46 46 'maxWidth' : '250px', 47 47 'fadeIn' : 50, 48 'fadeOut' : 50,48 'fadeOut' : 3000, 49 49 'delay' : 200 50 50 }); -
falang/tags/1.4.0/admin/views/settings_tab_general_settings.php
r3146389 r3447171 54 54 <select id="service_name" name="service_name" title="Service" class=" required-entry select"> 55 55 <?php if (Falang()->is_pro()) { ?> 56 <option value="chatgpt" <?php if ( $falang_model->get_option('service_name') == 'chatgpt' ): ?>selected="selected"<?php endif; ?>><?php echo __('ChatGPT','falang'); ?></option> 56 57 <option value="deepl" <?php if ( $falang_model->get_option('service_name') == 'deepl' ): ?>selected="selected"<?php endif; ?>><?php echo __('DeepL','falang'); ?></option> 57 58 <?php } else { ?> 59 <option value="" disabled ><?php echo __('ChatGPT (Pro only)','falang'); ?></option> 58 60 <option value="" disabled ><?php echo __('DeepL (Pro only)','falang'); ?></option> 59 61 <?php } ?> … … 87 89 </td> 88 90 </tr> 91 <!-- ChatGPT (hide on free--> 92 <tr <?php if (Falang()->is_free()){ echo 'style="display:none"';}?>> 93 <th><?php _e('ChatGPT API Key', 'falang'); ?></th> 94 <td> 95 <label> 96 <input type="text" size="40" name="chatgpt_key" value="<?php esc_attr_e($falang_model->get_option('chatgpt_key','')); ?>" /> 97 <?php \Falang\Core\Falang_Core::falang_tooltip('Sign-up at ChatGPT access key to the Translator API service at <a href=\'https://www.chatgpt.com\' target="_blank">ChatGPT.com</a>'); ?> 98 </label> 99 </td> 100 </tr> 101 <tr> 102 <th><?php _e('ChatGPT Model', 'falang'); ?></th> 103 <td> 104 <select id="chatgpt_model" name="chatgpt_model" title="ChatGPT Model" class=" required-entry select"> 105 <option value="gpt-5.2" <?php if ( $falang_model->get_option('chatgpt_model') == 'gpt-5.2' ): ?>selected="selected"<?php endif; ?>><?php echo __('GPT-5','falang'); ?></option> 106 <option value="gpt-5-mini" <?php if ( $falang_model->get_option('chatgpt_model') == 'gpt-5-mini' ): ?>selected="selected"<?php endif; ?>><?php echo __('GPT-5 Mini','falang'); ?></option> 107 <option value="gpt-4o" <?php if ( $falang_model->get_option('chatgpt_model') == 'gpt-4o' ): ?>selected="selected"<?php endif; ?>><?php echo __('GPT-4o','falang'); ?></option> 108 <option value="gpt-4.1" <?php if ( $falang_model->get_option('chatgpt_model') == 'gpt-4.1' ): ?>selected="selected"<?php endif; ?>><?php echo __('GPT-4.1','falang'); ?></option> 109 <option value="gpt-4.1-mini" <?php if ( $falang_model->get_option('chatgpt_model') == 'gpt-4.1-mini' ): ?>selected="selected"<?php endif; ?>><?php echo __('GPT-4.1 Mini','falang'); ?></option> 110 </select> 111 </td> 112 </tr> 89 113 <!-- Google --> 90 114 <tr> -
falang/tags/1.4.0/buid.xml
r3362585 r3447171 5 5 <property name="licence" value="lite"/> 6 6 <!-- set in falang.php manually --> 7 <property name="version" value="1. 3.67a"/>8 <property name="date" value="202 5/09/16"/>7 <property name="version" value="1.4.0"/> 8 <property name="date" value="2026/01/26"/> 9 9 10 10 <import file="common.xml"/> -
falang/tags/1.4.0/falang.php
r3409340 r3447171 9 9 * Plugin URI: www.faboba.com/falangw/ 10 10 * Description: Adds multilingual capability to WordPress (Lite version) 11 * Version: 1. 3.6811 * Version: 1.4.0 12 12 * Author: Faboba 13 13 * Author URI: www.faboba.com … … 50 50 * Currently plugin version. 51 51 */ 52 define( 'FALANG_VERSION', '1. 3.68' );52 define( 'FALANG_VERSION', '1.4.0' ); 53 53 define( 'FALANG_MIN_WP_VERSION', '4.7' ); 54 54 define( 'FALANG_FILE', __FILE__ ); // this file -
falang/tags/1.4.0/includes/class-falang-activator.php
r3222941 r3447171 89 89 * @update 1.3.54 add deepl 90 90 * @update 1.3.58 add nav_men_item meta_keys _menu_item_url checked by default 91 * @update 1.4.0 add chatgpt key default gpt-4.1-mini 91 92 * 92 93 * return array … … 108 109 'enable_service' => false, 109 110 'service_name' => '', 111 'chatgpt_key' => '', 112 'chatgpt_model' => 'gpt-4.1-mini', 110 113 'deepl_key' => '', 111 114 'deepl_free' => true, -
falang/tags/1.4.0/src/Falang/Translator/TranslatorDefault.php
r3251222 r3447171 38 38 } 39 39 } 40 41 /* 42 * get the name of the language by locale 43 * local in wordpress case 44 * use for chatGPT 45 * 46 * @since 1.4.0 47 * 48 * */ 49 public function languageCodeToName($locale){ 50 $language = Falang()->model->get_language_by_locale($locale); 51 if (isset($language)){ 52 return $language->name; 53 } else { 54 return 'English'; 55 } 56 } 40 57 41 58 public function getDefaultLanguage(){ -
falang/trunk/README.txt
r3409340 r3447171 4 4 Tags: multilingual, translation, translate, bilingual, localization 5 5 Requires at least: 4.7 6 Tested up to: 6. 86 Tested up to: 6.9 7 7 Requires PHP: 5.6 8 Stable tag: 1. 3.678 Stable tag: 1.4.0 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 15 15 16 16 Falang is a multilanguage plugin for WordPress. It allows you to translate an existing WordPress site to other languages. Falang natively supports WooCommerce (product, variation, category, tag, attribute, etc.) 17 17 You can use translation services such as Google, Azure, DeepL (Pro), or ChatGPT (Pro) to assist you. 18 18 = Free vs Pro = 19 19 20 20 Pro version: 21 21 - Enabled popup translation for (menu/post,product...) 22 - ChatGPT translation service 22 23 - DeepL translation service 23 24 - Translate/configure WooCommerce email … … 27 28 - WC Product addons 28 29 - CookieYes 30 - and more.... 29 31 30 32 = Concept = … … 111 113 == Changelog == 112 114 115 * 1.4.0 (2026/01/26) 116 * add ChatGPT translation service (Pro) 117 * improve DeepL translation service (Pro) 118 * change tips display link color and fadOut 119 * WordPress 6.9 compatible 120 113 121 * 1.3.68 (2025/12/03) 114 122 * fix meta translation with serialised object -
falang/trunk/admin/class-falang-admin.php
r3409340 r3447171 1008 1008 * @update 1.3.50 fix scss vulnerability's need to sanitize text field (sevice keys and downloadid) 1009 1009 * @update 1.3.54 add deepl 1010 * @update 1.4.0 add chatgpt key and model 1010 1011 */ 1011 1012 public function save_settings() … … 1073 1074 $options['deepl_key'] = (isset($_POST['deepl_key']) && $_POST['deepl_key']) ? sanitize_text_field($_POST['deepl_key']) : ''; 1074 1075 $options['deepl_free'] = (isset($_POST['deepl_free']) && $_POST['deepl_free']) ? true : false; 1076 $options['chatgpt_key'] = (isset($_POST['chatgpt_key']) && $_POST['chatgpt_key']) ? sanitize_text_field($_POST['chatgpt_key']) : ''; 1077 $options['chatgpt_model'] = (isset($_POST['chatgpt_model']) && $_POST['chatgpt_model']) ? sanitize_text_field($_POST['chatgpt_model']) : 'gpt-4o'; 1075 1078 1076 1079 $options['debug_admin'] = (isset($_POST['debug_admin']) && $_POST['debug_admin']) ? $_POST['debug_admin'] : ''; … … 3086 3089 /* 3087 3090 * @from 1.3.49 3091 * @update 1.4 : check the post parameter 3088 3092 * 3089 3093 * $result sucess true/false … … 3093 3097 public function ajax_service_translate() { 3094 3098 3095 $targetLanguageLocale = !empty( $_POST['targetLanguageLocale'] ) ? $_POST['targetLanguageLocale']:'' ;3096 $testToTranslate = !empty( $_POST['text'] ) ? $_POST['text']:'' ;3099 $targetLanguageLocale = !empty( $_POST['targetLanguageLocale'] ) ? sanitize_text_field($_POST['targetLanguageLocale']) :'' ; 3100 $testToTranslate = !empty( $_POST['text'] ) ? wp_kses_post($_POST['text']) :'' ; 3097 3101 3098 3102 $service = TranslatorFactory::getTranslator($targetLanguageLocale); 3099 $result = $service->translate($testToTranslate [0],$targetLanguageLocale);3103 $result = $service->translate($testToTranslate,$targetLanguageLocale); 3100 3104 3101 3105 Falang()->return_json($result); -
falang/trunk/admin/css/falang-admin.css
r3272201 r3447171 578 578 } 579 579 580 #tiptip_content a { 581 color: #fff; 582 } 583 580 584 /* pages post*/ 581 585 .falang_post_status{width: 30px;display: inline-block;font-size: 11px;position: relative} -
falang/trunk/admin/js/translatorDeepl.js
r3232494 r3447171 8 8 sourceLanguageCode: translator.from, 9 9 targetLanguageLocale: translator.to, 10 text: [sourceText]10 text: sourceText 11 11 }; 12 12 … … 30 30 }, 31 31 error: function (xhr, textStatus, errorThrown) { 32 translatedText = "ERROR "+xhr.responseJSON["code"]+": "+xhr.responseJSON["message"]; 32 const translatedText = "ERROR : " + textStatus; 33 setTranslation(fieldName, translatedText); 34 console.log(errorThrown); 33 35 }, 34 36 complete: function() { -
falang/trunk/admin/js/translatorYandex.js
r3059173 r3447171 6 6 targetLanguageCode: translator.to, 7 7 format: 'HTML', 8 texts: [sourceText]8 texts: sourceText 9 9 }; 10 10 -
falang/trunk/admin/views/edit_menu_page.php
r3232494 r3447171 179 179 <!-- add yandex/azure button --> 180 180 <?php if ($falang_model->get_option('enable_service') == '1') { ?> 181 <?php if ($falang_model->get_option('service_name') == 'chatgpt') { ?> 182 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 183 <?php } ?> 181 184 <?php if ($falang_model->get_option('service_name') == 'deepl') { ?> 182 185 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> -
falang/trunk/admin/views/edit_post_page.php
r3291681 r3447171 161 161 <!-- add yandex/azure button --> 162 162 <?php if ($falang_model->get_option('enable_service') == '1') { ?> 163 <?php if ($falang_model->get_option('service_name') == 'chatgpt') { ?> 164 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 165 <?php } ?> 163 166 <?php if ($falang_model->get_option('service_name') == 'deepl') { ?> 164 167 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> … … 250 253 <!-- add yandex/azure button --> 251 254 <?php if ($falang_model->get_option('enable_service') == '1') { ?> 255 <?php if ($falang_model->get_option('service_name') == 'chatgpt') { ?> 256 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 257 <?php } ?> 252 258 <?php if ($falang_model->get_option('service_name') == 'deepl') { ?> 253 259 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> -
falang/trunk/admin/views/edit_post_page_acf.php
r3251222 r3447171 57 57 <!-- add yandex/azure button --> 58 58 <?php if ($falang_model->get_option('enable_service') == '1') { ?> 59 <?php if ($falang_model->get_option('service_name') == 'chatgpt') { ?> 60 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 61 <?php } ?> 59 62 <?php if ($falang_model->get_option('service_name') == 'deepl') { ?> 60 63 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $key;?>','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> -
falang/trunk/admin/views/falang_option_translation_page.php
r3251222 r3447171 365 365 <?php if ( !$multiple) { ?> 366 366 <?php if ($this->model->get_option('enable_service') == '1') { ?> 367 <?php if ($this->model->get_option('service_name') == 'chatgpt') { ?> 368 <button class="button-secondary button-copy" onclick="copyToTranslation('translation','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 369 <?php } ?> 367 370 <?php if ($this->model->get_option('service_name') == 'deepl') { ?> 368 371 <button class="button-secondary button-copy" onclick="copyToTranslation('translation','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> -
falang/trunk/admin/views/falang_string_translation_page.php
r3251222 r3447171 162 162 <!-- add yandex/azure button --> 163 163 <?php if ($falang_model->get_option('enable_service') == '1') { ?> 164 <?php if ($falang_model->get_option('service_name') == 'chatgpt') { ?> 165 <button class="button-secondary button-copy" onclick="copyToTranslation('translation','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 166 <?php } ?> 164 167 <?php if ($falang_model->get_option('service_name') == 'deepl') { ?> 165 168 <button class="button-secondary button-copy" onclick="copyToTranslation('translation','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> -
falang/trunk/admin/views/falang_term_translation_page.php
r3251222 r3447171 168 168 <!-- add yandex/azure button --> 169 169 <?php if ($this->model->get_option('enable_service') == '1') { ?> 170 <?php if ($this->model->get_option('service_name') == 'chatgpt') { ?> 171 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $field;?>','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 172 <?php } ?> 170 173 <?php if ($this->model->get_option('service_name') == 'deepl') { ?> 171 174 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $field;?>','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> … … 216 219 <!-- add yandex/azure button --> 217 220 <?php if ($this->model->get_option('enable_service') == '1') { ?> 221 <?php if ($this->model->get_option('service_name') == 'chatgpt') { ?> 222 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $metafield;?>','translate');return false;" title="<?php echo __( 'Translate with ChatGPT', 'falang' ) ?>"><i class="icon-globe"></i></button> 223 <?php } ?> 218 224 <?php if ($this->model->get_option('service_name') == 'deepl') { ?> 219 225 <button class="button-secondary button-copy" onclick="copyToTranslation('<?php echo $metafield;?>','translate');return false;" title="<?php echo __( 'Translate with DeepL', 'falang' ) ?>"><i class="icon-globe"></i></button> -
falang/trunk/admin/views/settings_page.php
r2748567 r3447171 46 46 'maxWidth' : '250px', 47 47 'fadeIn' : 50, 48 'fadeOut' : 50,48 'fadeOut' : 3000, 49 49 'delay' : 200 50 50 }); -
falang/trunk/admin/views/settings_tab_general_settings.php
r3146389 r3447171 54 54 <select id="service_name" name="service_name" title="Service" class=" required-entry select"> 55 55 <?php if (Falang()->is_pro()) { ?> 56 <option value="chatgpt" <?php if ( $falang_model->get_option('service_name') == 'chatgpt' ): ?>selected="selected"<?php endif; ?>><?php echo __('ChatGPT','falang'); ?></option> 56 57 <option value="deepl" <?php if ( $falang_model->get_option('service_name') == 'deepl' ): ?>selected="selected"<?php endif; ?>><?php echo __('DeepL','falang'); ?></option> 57 58 <?php } else { ?> 59 <option value="" disabled ><?php echo __('ChatGPT (Pro only)','falang'); ?></option> 58 60 <option value="" disabled ><?php echo __('DeepL (Pro only)','falang'); ?></option> 59 61 <?php } ?> … … 87 89 </td> 88 90 </tr> 91 <!-- ChatGPT (hide on free--> 92 <tr <?php if (Falang()->is_free()){ echo 'style="display:none"';}?>> 93 <th><?php _e('ChatGPT API Key', 'falang'); ?></th> 94 <td> 95 <label> 96 <input type="text" size="40" name="chatgpt_key" value="<?php esc_attr_e($falang_model->get_option('chatgpt_key','')); ?>" /> 97 <?php \Falang\Core\Falang_Core::falang_tooltip('Sign-up at ChatGPT access key to the Translator API service at <a href=\'https://www.chatgpt.com\' target="_blank">ChatGPT.com</a>'); ?> 98 </label> 99 </td> 100 </tr> 101 <tr> 102 <th><?php _e('ChatGPT Model', 'falang'); ?></th> 103 <td> 104 <select id="chatgpt_model" name="chatgpt_model" title="ChatGPT Model" class=" required-entry select"> 105 <option value="gpt-5.2" <?php if ( $falang_model->get_option('chatgpt_model') == 'gpt-5.2' ): ?>selected="selected"<?php endif; ?>><?php echo __('GPT-5','falang'); ?></option> 106 <option value="gpt-5-mini" <?php if ( $falang_model->get_option('chatgpt_model') == 'gpt-5-mini' ): ?>selected="selected"<?php endif; ?>><?php echo __('GPT-5 Mini','falang'); ?></option> 107 <option value="gpt-4o" <?php if ( $falang_model->get_option('chatgpt_model') == 'gpt-4o' ): ?>selected="selected"<?php endif; ?>><?php echo __('GPT-4o','falang'); ?></option> 108 <option value="gpt-4.1" <?php if ( $falang_model->get_option('chatgpt_model') == 'gpt-4.1' ): ?>selected="selected"<?php endif; ?>><?php echo __('GPT-4.1','falang'); ?></option> 109 <option value="gpt-4.1-mini" <?php if ( $falang_model->get_option('chatgpt_model') == 'gpt-4.1-mini' ): ?>selected="selected"<?php endif; ?>><?php echo __('GPT-4.1 Mini','falang'); ?></option> 110 </select> 111 </td> 112 </tr> 89 113 <!-- Google --> 90 114 <tr> -
falang/trunk/buid.xml
r3362585 r3447171 5 5 <property name="licence" value="lite"/> 6 6 <!-- set in falang.php manually --> 7 <property name="version" value="1. 3.67a"/>8 <property name="date" value="202 5/09/16"/>7 <property name="version" value="1.4.0"/> 8 <property name="date" value="2026/01/26"/> 9 9 10 10 <import file="common.xml"/> -
falang/trunk/falang.php
r3409340 r3447171 9 9 * Plugin URI: www.faboba.com/falangw/ 10 10 * Description: Adds multilingual capability to WordPress (Lite version) 11 * Version: 1. 3.6811 * Version: 1.4.0 12 12 * Author: Faboba 13 13 * Author URI: www.faboba.com … … 50 50 * Currently plugin version. 51 51 */ 52 define( 'FALANG_VERSION', '1. 3.68' );52 define( 'FALANG_VERSION', '1.4.0' ); 53 53 define( 'FALANG_MIN_WP_VERSION', '4.7' ); 54 54 define( 'FALANG_FILE', __FILE__ ); // this file -
falang/trunk/includes/class-falang-activator.php
r3222941 r3447171 89 89 * @update 1.3.54 add deepl 90 90 * @update 1.3.58 add nav_men_item meta_keys _menu_item_url checked by default 91 * @update 1.4.0 add chatgpt key default gpt-4.1-mini 91 92 * 92 93 * return array … … 108 109 'enable_service' => false, 109 110 'service_name' => '', 111 'chatgpt_key' => '', 112 'chatgpt_model' => 'gpt-4.1-mini', 110 113 'deepl_key' => '', 111 114 'deepl_free' => true, -
falang/trunk/src/Falang/Translator/TranslatorDefault.php
r3251222 r3447171 38 38 } 39 39 } 40 41 /* 42 * get the name of the language by locale 43 * local in wordpress case 44 * use for chatGPT 45 * 46 * @since 1.4.0 47 * 48 * */ 49 public function languageCodeToName($locale){ 50 $language = Falang()->model->get_language_by_locale($locale); 51 if (isset($language)){ 52 return $language->name; 53 } else { 54 return 'English'; 55 } 56 } 40 57 41 58 public function getDefaultLanguage(){
Note: See TracChangeset
for help on using the changeset viewer.