Plugin Directory

Changeset 3338682


Ignore:
Timestamp:
08/04/2025 04:10:28 AM (8 months ago)
Author:
mvpis
Message:

Updates and Performance Improvements

Location:
fluentc-translation
Files:
124 added
3 edited

Legend:

Unmodified
Added
Removed
  • fluentc-translation/trunk/fluentc_wordpress_plugin.php

    r3338675 r3338682  
    77 * Plugin URI: https://www.fluentc.ai
    88 * Description: A plugin that enables website owners to easily install the FluentC Translation on their WordPress site.
    9  * Version: 2.7.5
     9 * Version: 2.7.6
    1010 * Author: FluentC
    1111 * Author URI: https://www.fluentc.ai
     
    1717define( 'FLUENTC_DIR', __DIR__ );
    1818define( 'FLUENTC_SLUG', 'fluentc_translation' );
    19 define( 'FLUENTC_TRANSLATION_VERSION', "2.7.5" );
     19define( 'FLUENTC_TRANSLATION_VERSION', "2.7.6" );
    2020define( 'POLYLANG_VERSION', "2.5.2" );
    2121define( 'FLUENTC_TRANSLATION_PLUGIN_DIR', plugin_dir_path(__FILE__) );
  • fluentc-translation/trunk/readme.txt

    r3338675 r3338682  
    55Requires at least: 4.6
    66Tested up to: 6.8.1
    7 Stable tag: 2.7.5
     7Stable tag: 2.7.6
    88Requires PHP: 7.3
    99License: GPLv2 or later
  • fluentc-translation/trunk/src/class-polylang.php

    r3323857 r3338682  
    2121    public $options;
    2222    public $model;
     23    public $curlang; // Current language object for Polylang compatibility
    2324
    2425    protected $fluentc_language;
     
    3233        $this->fluentc_language = new Language();
    3334        $this->options = $this->links_model->options;
     35       
     36        // Initialize curlang property for Polylang compatibility
     37        $this->curlang = $this->fluentc_language->get_fluentc_language();
     38       
    3439        add_action( 'init', array( $this, 'init_hooks' ), 1 );
    3540    }
     
    423428
    424429    /**
     430     * Update the current language property
     431     * This should be called when the language changes
     432     */
     433    public function update_curlang() {
     434        $this->curlang = $this->fluentc_language->get_fluentc_language();
     435        return $this->curlang;
     436    }
     437
     438    /**
     439     * Get the current language (Polylang compatibility)
     440     */
     441    public function get_current_language() {
     442        return $this->curlang;
     443    }
     444
     445    /**
     446     * Magic getter to ensure curlang is always up-to-date
     447     */
     448    public function __get($name) {
     449        if ($name === 'curlang') {
     450            // Update curlang before returning it
     451            $this->update_curlang();
     452            return $this->curlang;
     453        }
     454       
     455        // For other properties, return null to prevent undefined property errors
     456        return null;
     457    }
     458
     459    /**
    425460     * Check if FluentC is active
    426461     */
Note: See TracChangeset for help on using the changeset viewer.