Plugin Directory

Changeset 3447171


Ignore:
Timestamp:
01/26/2026 02:48:11 PM (2 months ago)
Author:
sbouey
Message:

Update to version 1.4.0

Location:
falang
Files:
4 added
34 edited
1 copied

Legend:

Unmodified
Added
Removed
  • falang/tags/1.4.0/README.txt

    r3409340 r3447171  
    44Tags: multilingual, translation, translate, bilingual, localization
    55Requires at least: 4.7
    6 Tested up to: 6.8
     6Tested up to: 6.9
    77Requires PHP: 5.6
    8 Stable tag: 1.3.67
     8Stable tag: 1.4.0
    99License: GPLv3 or later
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1515
    1616Falang 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 
     17You can use translation services such as Google, Azure, DeepL (Pro), or ChatGPT (Pro) to assist you.
    1818= Free vs Pro =
    1919
    2020Pro version:
    2121- Enabled popup translation for (menu/post,product...)
     22- ChatGPT translation service
    2223- DeepL translation service
    2324- Translate/configure WooCommerce email
     
    2728- WC Product addons
    2829- CookieYes
     30- and more....
    2931
    3032= Concept =
     
    111113== Changelog ==
    112114
     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
    113121* 1.3.68 (2025/12/03)
    114122* fix meta translation with serialised object
  • falang/tags/1.4.0/admin/class-falang-admin.php

    r3409340 r3447171  
    10081008     * @update 1.3.50 fix scss vulnerability's need to sanitize text field (sevice keys and downloadid)
    10091009     * @update 1.3.54 add deepl
     1010     * @update 1.4.0 add chatgpt key and model
    10101011     */
    10111012    public function save_settings()
     
    10731074                $options['deepl_key'] = (isset($_POST['deepl_key']) && $_POST['deepl_key']) ? sanitize_text_field($_POST['deepl_key']) : '';
    10741075                $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';
    10751078
    10761079                $options['debug_admin'] = (isset($_POST['debug_admin']) && $_POST['debug_admin']) ? $_POST['debug_admin'] : '';
     
    30863089    /*
    30873090     * @from 1.3.49
     3091     * @update 1.4 : check the post parameter
    30883092     *
    30893093     * $result sucess true/false
     
    30933097    public function ajax_service_translate() {
    30943098
    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']) :'' ;
    30973101
    30983102        $service = TranslatorFactory::getTranslator($targetLanguageLocale);
    3099         $result = $service->translate($testToTranslate[0],$targetLanguageLocale);
     3103        $result = $service->translate($testToTranslate,$targetLanguageLocale);
    31003104
    31013105        Falang()->return_json($result);
  • falang/tags/1.4.0/admin/css/falang-admin.css

    r3272201 r3447171  
    578578}
    579579
     580#tiptip_content a {
     581    color: #fff;
     582}
     583
    580584/* pages post*/
    581585.falang_post_status{width: 30px;display: inline-block;font-size: 11px;position: relative}
  • falang/tags/1.4.0/admin/js/translatorDeepl.js

    r3232494 r3447171  
    88        sourceLanguageCode: translator.from,
    99        targetLanguageLocale: translator.to,
    10         text: [sourceText]
     10        text: sourceText
    1111    };
    1212
     
    3030        },
    3131        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);
    3335        },
    3436        complete: function() {
  • falang/tags/1.4.0/admin/js/translatorYandex.js

    r3059173 r3447171  
    66        targetLanguageCode: translator.to,
    77        format: 'HTML',
    8         texts: [sourceText]
     8        texts: sourceText
    99    };
    1010
  • falang/tags/1.4.0/admin/views/edit_menu_page.php

    r3232494 r3447171  
    179179                        <!-- add yandex/azure button -->
    180180                        <?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 } ?>
    181184                            <?php if ($falang_model->get_option('service_name') == 'deepl') { ?>
    182185                                <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  
    161161                            <!-- add yandex/azure button -->
    162162                            <?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 } ?>
    163166                                <?php if ($falang_model->get_option('service_name') == 'deepl') { ?>
    164167                                    <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>
     
    250253                        <!-- add yandex/azure button -->
    251254                        <?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 } ?>
    252258                            <?php if ($falang_model->get_option('service_name') == 'deepl') { ?>
    253259                                <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  
    5757            <!-- add yandex/azure button -->
    5858            <?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 } ?>
    5962                <?php if ($falang_model->get_option('service_name') == 'deepl') { ?>
    6063                    <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  
    365365                <?php if ( !$multiple) { ?>
    366366                <?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 } ?>
    367370                    <?php if ($this->model->get_option('service_name') == 'deepl') { ?>
    368371                        <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  
    162162                <!-- add yandex/azure button -->
    163163                <?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 } ?>
    164167                    <?php if ($falang_model->get_option('service_name') == 'deepl') { ?>
    165168                        <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  
    168168                        <!-- add yandex/azure button -->
    169169                        <?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 } ?>
    170173                            <?php if ($this->model->get_option('service_name') == 'deepl') { ?>
    171174                                <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>
     
    216219            <!-- add yandex/azure button -->
    217220            <?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 } ?>
    218224                <?php if ($this->model->get_option('service_name') == 'deepl') { ?>
    219225                    <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  
    4646            'maxWidth' : '250px',
    4747            'fadeIn' : 50,
    48             'fadeOut' : 50,
     48            'fadeOut' : 3000,
    4949            'delay' : 200
    5050        });
  • falang/tags/1.4.0/admin/views/settings_tab_general_settings.php

    r3146389 r3447171  
    5454            <select id="service_name" name="service_name" title="Service" class=" required-entry select">
    5555                <?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>
    5657                    <option value="deepl" <?php if ( $falang_model->get_option('service_name') == 'deepl' ): ?>selected="selected"<?php endif; ?>><?php echo __('DeepL','falang'); ?></option>
    5758                <?php } else { ?>
     59                    <option value="" disabled ><?php echo __('ChatGPT (Pro only)','falang'); ?></option>
    5860                    <option value="" disabled ><?php echo __('DeepL (Pro only)','falang'); ?></option>
    5961                <?php } ?>
     
    8789            </td>
    8890        </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>
    89113    <!-- Google -->
    90114    <tr>
  • falang/tags/1.4.0/buid.xml

    r3362585 r3447171  
    55    <property name="licence" value="lite"/>
    66    <!-- set in falang.php manually -->
    7     <property name="version" value="1.3.67a"/>
    8     <property name="date" value="2025/09/16"/>
     7    <property name="version" value="1.4.0"/>
     8    <property name="date" value="2026/01/26"/>
    99
    1010    <import file="common.xml"/>
  • falang/tags/1.4.0/falang.php

    r3409340 r3447171  
    99 * Plugin URI:        www.faboba.com/falangw/
    1010 * Description:       Adds multilingual capability to WordPress (Lite version)
    11  * Version:           1.3.68
     11 * Version:           1.4.0
    1212 * Author:            Faboba
    1313 * Author URI:        www.faboba.com
     
    5050 * Currently plugin version.
    5151 */
    52 define( 'FALANG_VERSION', '1.3.68' );
     52define( 'FALANG_VERSION', '1.4.0' );
    5353define( 'FALANG_MIN_WP_VERSION', '4.7' );
    5454define( 'FALANG_FILE', __FILE__ ); // this file
  • falang/tags/1.4.0/includes/class-falang-activator.php

    r3222941 r3447171  
    8989     * @update 1.3.54 add deepl
    9090     * @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
    9192     *
    9293     * return array
     
    108109            'enable_service' => false,
    109110            'service_name' => '',
     111            'chatgpt_key' => '',
     112            'chatgpt_model' => 'gpt-4.1-mini',
    110113            'deepl_key' => '',
    111114            'deepl_free' => true,
  • falang/tags/1.4.0/src/Falang/Translator/TranslatorDefault.php

    r3251222 r3447171  
    3838        }
    3939    }
     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    }
    4057
    4158    public function getDefaultLanguage(){
  • falang/trunk/README.txt

    r3409340 r3447171  
    44Tags: multilingual, translation, translate, bilingual, localization
    55Requires at least: 4.7
    6 Tested up to: 6.8
     6Tested up to: 6.9
    77Requires PHP: 5.6
    8 Stable tag: 1.3.67
     8Stable tag: 1.4.0
    99License: GPLv3 or later
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1515
    1616Falang 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 
     17You can use translation services such as Google, Azure, DeepL (Pro), or ChatGPT (Pro) to assist you.
    1818= Free vs Pro =
    1919
    2020Pro version:
    2121- Enabled popup translation for (menu/post,product...)
     22- ChatGPT translation service
    2223- DeepL translation service
    2324- Translate/configure WooCommerce email
     
    2728- WC Product addons
    2829- CookieYes
     30- and more....
    2931
    3032= Concept =
     
    111113== Changelog ==
    112114
     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
    113121* 1.3.68 (2025/12/03)
    114122* fix meta translation with serialised object
  • falang/trunk/admin/class-falang-admin.php

    r3409340 r3447171  
    10081008     * @update 1.3.50 fix scss vulnerability's need to sanitize text field (sevice keys and downloadid)
    10091009     * @update 1.3.54 add deepl
     1010     * @update 1.4.0 add chatgpt key and model
    10101011     */
    10111012    public function save_settings()
     
    10731074                $options['deepl_key'] = (isset($_POST['deepl_key']) && $_POST['deepl_key']) ? sanitize_text_field($_POST['deepl_key']) : '';
    10741075                $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';
    10751078
    10761079                $options['debug_admin'] = (isset($_POST['debug_admin']) && $_POST['debug_admin']) ? $_POST['debug_admin'] : '';
     
    30863089    /*
    30873090     * @from 1.3.49
     3091     * @update 1.4 : check the post parameter
    30883092     *
    30893093     * $result sucess true/false
     
    30933097    public function ajax_service_translate() {
    30943098
    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']) :'' ;
    30973101
    30983102        $service = TranslatorFactory::getTranslator($targetLanguageLocale);
    3099         $result = $service->translate($testToTranslate[0],$targetLanguageLocale);
     3103        $result = $service->translate($testToTranslate,$targetLanguageLocale);
    31003104
    31013105        Falang()->return_json($result);
  • falang/trunk/admin/css/falang-admin.css

    r3272201 r3447171  
    578578}
    579579
     580#tiptip_content a {
     581    color: #fff;
     582}
     583
    580584/* pages post*/
    581585.falang_post_status{width: 30px;display: inline-block;font-size: 11px;position: relative}
  • falang/trunk/admin/js/translatorDeepl.js

    r3232494 r3447171  
    88        sourceLanguageCode: translator.from,
    99        targetLanguageLocale: translator.to,
    10         text: [sourceText]
     10        text: sourceText
    1111    };
    1212
     
    3030        },
    3131        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);
    3335        },
    3436        complete: function() {
  • falang/trunk/admin/js/translatorYandex.js

    r3059173 r3447171  
    66        targetLanguageCode: translator.to,
    77        format: 'HTML',
    8         texts: [sourceText]
     8        texts: sourceText
    99    };
    1010
  • falang/trunk/admin/views/edit_menu_page.php

    r3232494 r3447171  
    179179                        <!-- add yandex/azure button -->
    180180                        <?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 } ?>
    181184                            <?php if ($falang_model->get_option('service_name') == 'deepl') { ?>
    182185                                <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  
    161161                            <!-- add yandex/azure button -->
    162162                            <?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 } ?>
    163166                                <?php if ($falang_model->get_option('service_name') == 'deepl') { ?>
    164167                                    <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>
     
    250253                        <!-- add yandex/azure button -->
    251254                        <?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 } ?>
    252258                            <?php if ($falang_model->get_option('service_name') == 'deepl') { ?>
    253259                                <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  
    5757            <!-- add yandex/azure button -->
    5858            <?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 } ?>
    5962                <?php if ($falang_model->get_option('service_name') == 'deepl') { ?>
    6063                    <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  
    365365                <?php if ( !$multiple) { ?>
    366366                <?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 } ?>
    367370                    <?php if ($this->model->get_option('service_name') == 'deepl') { ?>
    368371                        <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  
    162162                <!-- add yandex/azure button -->
    163163                <?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 } ?>
    164167                    <?php if ($falang_model->get_option('service_name') == 'deepl') { ?>
    165168                        <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  
    168168                        <!-- add yandex/azure button -->
    169169                        <?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 } ?>
    170173                            <?php if ($this->model->get_option('service_name') == 'deepl') { ?>
    171174                                <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>
     
    216219            <!-- add yandex/azure button -->
    217220            <?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 } ?>
    218224                <?php if ($this->model->get_option('service_name') == 'deepl') { ?>
    219225                    <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  
    4646            'maxWidth' : '250px',
    4747            'fadeIn' : 50,
    48             'fadeOut' : 50,
     48            'fadeOut' : 3000,
    4949            'delay' : 200
    5050        });
  • falang/trunk/admin/views/settings_tab_general_settings.php

    r3146389 r3447171  
    5454            <select id="service_name" name="service_name" title="Service" class=" required-entry select">
    5555                <?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>
    5657                    <option value="deepl" <?php if ( $falang_model->get_option('service_name') == 'deepl' ): ?>selected="selected"<?php endif; ?>><?php echo __('DeepL','falang'); ?></option>
    5758                <?php } else { ?>
     59                    <option value="" disabled ><?php echo __('ChatGPT (Pro only)','falang'); ?></option>
    5860                    <option value="" disabled ><?php echo __('DeepL (Pro only)','falang'); ?></option>
    5961                <?php } ?>
     
    8789            </td>
    8890        </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>
    89113    <!-- Google -->
    90114    <tr>
  • falang/trunk/buid.xml

    r3362585 r3447171  
    55    <property name="licence" value="lite"/>
    66    <!-- set in falang.php manually -->
    7     <property name="version" value="1.3.67a"/>
    8     <property name="date" value="2025/09/16"/>
     7    <property name="version" value="1.4.0"/>
     8    <property name="date" value="2026/01/26"/>
    99
    1010    <import file="common.xml"/>
  • falang/trunk/falang.php

    r3409340 r3447171  
    99 * Plugin URI:        www.faboba.com/falangw/
    1010 * Description:       Adds multilingual capability to WordPress (Lite version)
    11  * Version:           1.3.68
     11 * Version:           1.4.0
    1212 * Author:            Faboba
    1313 * Author URI:        www.faboba.com
     
    5050 * Currently plugin version.
    5151 */
    52 define( 'FALANG_VERSION', '1.3.68' );
     52define( 'FALANG_VERSION', '1.4.0' );
    5353define( 'FALANG_MIN_WP_VERSION', '4.7' );
    5454define( 'FALANG_FILE', __FILE__ ); // this file
  • falang/trunk/includes/class-falang-activator.php

    r3222941 r3447171  
    8989     * @update 1.3.54 add deepl
    9090     * @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
    9192     *
    9293     * return array
     
    108109            'enable_service' => false,
    109110            'service_name' => '',
     111            'chatgpt_key' => '',
     112            'chatgpt_model' => 'gpt-4.1-mini',
    110113            'deepl_key' => '',
    111114            'deepl_free' => true,
  • falang/trunk/src/Falang/Translator/TranslatorDefault.php

    r3251222 r3447171  
    3838        }
    3939    }
     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    }
    4057
    4158    public function getDefaultLanguage(){
Note: See TracChangeset for help on using the changeset viewer.