Plugin Directory

Changeset 3323857


Ignore:
Timestamp:
07/07/2025 06:48:41 PM (9 months ago)
Author:
mvpis
Message:

Updating with improvements

Location:
fluentc-translation
Files:
124 added
6 edited

Legend:

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

    r3323050 r3323857  
    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.2
     9 * Version: 2.7.3
    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.2" );
     19define( 'FLUENTC_TRANSLATION_VERSION', "2.7.3" );
    2020define( 'POLYLANG_VERSION', "2.5.2" );
    2121define( 'FLUENTC_TRANSLATION_PLUGIN_DIR', plugin_dir_path(__FILE__) );
  • fluentc-translation/trunk/readme.txt

    r3323050 r3323857  
    55Requires at least: 4.6
    66Tested up to: 6.8.1
    7 Stable tag: 2.7.2
     7Stable tag: 2.7.3
    88Requires PHP: 7.3
    99License: GPLv2 or later
  • fluentc-translation/trunk/src/class-fluentc-manager.php

    r3267615 r3323857  
    3636     */
    3737    public function set_locale( $locale ) {
    38         if ( $this->is_fluentc_active() ) {
    39             return $this->get_fluentc_locale();
    40         }
     38        // Always return the original locale unchanged
     39        // FluentC should never modify WordPress locale
    4140        return $locale;
    4241    }
  • fluentc-translation/trunk/src/class-polylang.php

    r3323050 r3323857  
    417417     */
    418418    public function set_locale( $locale ) {
    419         if ( $this->is_fluentc_active() ) {
    420             return $this->get_fluentc_locale();
    421         }
     419        // Always return the original locale unchanged
     420        // FluentC should never modify WordPress locale
    422421        return $locale;
    423422    }
  • fluentc-translation/trunk/src/class-sitepress.php

    r3267615 r3323857  
    6767     */
    6868    public function set_locale( $locale ) {
    69         if ( $this->is_fluentc_active() ) {
    70             return $this->get_fluentc_locale();
    71         }
     69        // Always return the original locale unchanged
     70        // FluentC should never modify WordPress locale
    7271        return $locale;
    7372    }
  • fluentc-translation/trunk/src/fluentc_pll_api.php

    r3267615 r3323857  
    121121    }, $result);
    122122}
     123/**
     124 * Gets post translations (FluentC stub function)
     125 *
     126 * @param int $post_id Post ID
     127 * @return array
     128 */
    123129function pll_get_post_translations($post_id) {
    124         return [$post_id]; // fallback to self-reference
    125     }
     130    // Return empty array to prevent errors - FluentC doesn't handle translations
     131    return array();
     132}
     133
     134/**
     135 * Gets term translations (FluentC stub function)
     136 *
     137 * @param int $term_id Term ID
     138 * @return array 
     139 */
     140function pll_get_term_translations($term_id) {
     141    // Return empty array to prevent errors
     142    return array();
     143}
     144
     145/**
     146 * Save post translations (FluentC stub function)
     147 *
     148 * @param array $translations Array of translations
     149 * @return bool
     150 */
     151function pll_save_post_translations($translations) {
     152    // Stub function - does nothing but prevents errors
     153    return true;
     154}
     155
     156/**
     157 * Save term translations (FluentC stub function)
     158 *
     159 * @param array $translations Array of translations 
     160 * @return bool
     161 */
     162function pll_save_term_translations($translations) {
     163    // Stub function - does nothing but prevents errors
     164    return true;
     165}
     166
     167/**
     168 * Count posts in a language (FluentC stub function)
     169 *
     170 * @param string $lang Language code
     171 * @param array $args Additional arguments
     172 * @return int
     173 */
     174function pll_count_posts($lang, $args = array()) {
     175    // Return 0 to prevent errors
     176    return 0;
     177}
     178
     179/**
     180 * Gets the home URL for a language (FluentC stub function)
     181 *
     182 * @param string $lang Language code
     183 * @return string
     184 */
     185function pll_home_url($lang = '') {
     186    // Return regular home URL
     187    return home_url();
     188}
    126189/**
    127190 * Returns the post language. Used by FluentC to get the Language from the URL
     
    203266    return $GLOBALS['polylang'];
    204267}
     268
     269/**
     270 * Registers a string for translation (FluentC stub function)
     271 *
     272 * This is a compatibility function for plugins like JetEngine that expect
     273 * pll_register_string() to exist. FluentC doesn't implement string translations,
     274 * so this function does nothing but prevents fatal errors.
     275 *
     276 * @api
     277 * @since 1.0
     278 *
     279 * @param string $name       Name provided for sorting convenience (ex: 'myplugin')
     280 * @param string $string     The string to translate
     281 * @param string $group      Optional. The group in which the string is registered, defaults to 'polylang'
     282 * @param bool   $multiline  Optional. If set to true, the translation text field will be multiline, defaults to false
     283 * @return void
     284 */
     285function pll_register_string( $name, $string, $group = 'polylang', $multiline = false ) {
     286    // FluentC stub function - does nothing but prevents fatal errors
     287    // FluentC doesn't implement string translations functionality
     288    return;
     289}
     290
     291/**
     292 * Translates a string previously registered with pll_register_string (FluentC stub function)
     293 *
     294 * @api
     295 * @since 1.0
     296 *
     297 * @param string $string The string to translate
     298 * @return string The original string (untranslated in FluentC)
     299 */
     300function pll__( $string ) {
     301    // FluentC stub function - returns original string untranslated
     302    return $string;
     303}
     304
     305/**
     306 * Echoes a translated string previously registered with pll_register_string (FluentC stub function)
     307 *
     308 * @api
     309 * @since 1.0
     310 *
     311 * @param string $string The string to translate and echo
     312 * @return void
     313 */
     314function pll_e( $string ) {
     315    // FluentC stub function - echoes original string untranslated
     316    echo $string;
     317}
     318
     319/**
     320 * Translates a string previously registered with pll_register_string in a given language (FluentC stub function)
     321 *
     322 * @api
     323 * @since 1.0
     324 *
     325 * @param string $string The string to translate
     326 * @param string $lang   The language code of the desired translation
     327 * @return string The original string (untranslated in FluentC)
     328 */
     329function pll_translate_string( $string, $lang ) {
     330    // FluentC stub function - returns original string untranslated
     331    return $string;
     332}
     333
     334/**
     335 * Sets the language of a post (FluentC stub function)
     336 *
     337 * @param int $post_id Post ID
     338 * @param string $lang Language code
     339 * @return bool
     340 */
     341function pll_set_post_language($post_id, $lang) {
     342    // Stub function - does nothing but prevents errors
     343    return true;
     344}
     345
     346/**
     347 * Sets the language of a term (FluentC stub function)
     348 *
     349 * @param int $term_id Term ID
     350 * @param string $lang Language code
     351 * @return bool
     352 */
     353function pll_set_term_language($term_id, $lang) {
     354    // Stub function - does nothing but prevents errors
     355    return true;
     356}
     357
     358/**
     359 * Checks if a post type is translated (FluentC stub function)
     360 *
     361 * @param string $post_type Post type name
     362 * @return bool
     363 */
     364function pll_is_translated_post_type($post_type) {
     365    // Return false - FluentC doesn't handle post type translations
     366    return false;
     367}
     368
     369/**
     370 * Checks if a taxonomy is translated (FluentC stub function)
     371 *
     372 * @param string $taxonomy Taxonomy name
     373 * @return bool
     374 */
     375function pll_is_translated_taxonomy($taxonomy) {
     376    // Return false - FluentC doesn't handle taxonomy translations
     377    return false;
     378}
Note: See TracChangeset for help on using the changeset viewer.