Plugin Directory

Changeset 3159297


Ignore:
Timestamp:
09/28/2024 04:48:33 PM (6 months ago)
Author:
mvpis
Message:

Updated to better support wpForo. Thank you Jean and Rick for finding it

Location:
fluentc-translation
Files:
366 added
17 edited

Legend:

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

    r3148988 r3159297  
    3636            <ol>
    3737                <li><?php _e( 'Click the link above to link your site to FluentC', 'fluentc-translation' ); ?></li>
    38                 <li><?php _e( 'Subscribe to Languages', 'fluentc-translation' ); ?></li>
     38                <li><?php _e( 'Configure Languages', 'fluentc-translation' ); ?></li>
    3939                <li><?php _e( 'Add the html tag if you choose to display the languages as dropdown or list', 'fluentc-translation' ); ?></li>
    4040            </ol>
     41<h2>Save your FluentC API Key</h2>
     42            <form method="post" action='<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>'>
     43            <?php wp_nonce_field( 'fluentc_save_settings_action', 'fluentc_settings_nonce_field' ); ?>
     44            <input type="hidden" name="action" value="fluentc_save_settings_action">
     45            <table class="form-table">
     46                <tbody>
     47                    <tr>
     48                        <th scope="row"><label for="fluentc_api_key"><?php _e( 'FluentC API Key', 'fluentc-translation' ); ?></label></th>
     49                        <td><input name="fluentc_api_key" type="text" id="fluentc_api_key"
     50                                value="<?php echo esc_attr( $this->fluentc_get_settings() ); ?>" class="regular-text">
     51                        </td>
     52                    </tr>
     53                </tbody>
     54            </table>
     55            <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary"
     56                    value="<?php _e( 'Save Changes', 'fluentc-translation' ); ?>"></p>
     57        </form>
    4158        <?php } ?>
    4259    </div>
     
    5471
    5572    <div id="tab-3" class="tab-content">
    56         <form method="post" action='<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>'>
     73     
     74    <h2>Save your FluentC API Key</h2>
     75            <form method="post" action='<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>'>
    5776            <?php wp_nonce_field( 'fluentc_save_settings_action', 'fluentc_settings_nonce_field' ); ?>
    5877            <input type="hidden" name="action" value="fluentc_save_settings_action">
     
    7089                    value="<?php _e( 'Save Changes', 'fluentc-translation' ); ?>"></p>
    7190        </form>
    72 
    7391        <?php do_action( 'fluentc_admin_tab_three_page' ); ?>
    7492        <?php do_action( 'fluentc_activation_setup' ); ?>
  • fluentc-translation/trunk/fluentc_wordpress_plugin.php

    r3156028 r3159297  
    77 * Plugin URI: https://github.com/fluentc/wordpress-plugin
    88 * Description: A plugin that enables website owners to easily install the FluentC Translation on their WordPress site.
    9  * Version: 1.9
     9 * Version: 1.9.1
    1010 * Author: FluentC
    1111 * Author URI: https://www.fluentc.ai
     
    1717define( 'FLUENTC_DIR', __DIR__ );
    1818define( 'FLUENTC_SLUG', 'fluentc_translation' );
    19 define( 'FLUENTC_TRANSLATION_VERSION', "1.9" );
     19define( 'FLUENTC_TRANSLATION_VERSION', "1.9.1" );
    2020define( 'FLUENTC_TRANSLATION_PLUGIN_DIR', plugin_dir_path(__FILE__) );
    2121define( 'FLUENTC_TRANSLATION_PLUGIN_URL', plugin_dir_url(__FILE__) );
  • fluentc-translation/trunk/languages/fluentc-translation.pot

    r3126655 r3159297  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: FluentC Translation 1.5\n"
     5"Project-Id-Version: FluentC Translation 1.9.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wordpress-plugin\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-07-14T15:16:24+00:00\n"
     12"POT-Creation-Date: 2024-09-26T18:49:13+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.10.0\n"
     
    4040msgstr ""
    4141
    42 #: fluentc_settings.php:244
     42#: fluentc_settings.php:9
     43msgid "FluentC Translation Settings"
     44msgstr ""
     45
     46#: fluentc_settings.php:12
    4347msgid "Manage Account"
    4448msgstr ""
    4549
    46 #: fluentc_settings.php:248
     50#: fluentc_settings.php:14
    4751msgid "Connect to FluentC"
    4852msgstr ""
    4953
    50 #: fluentc_settings.php:260
     54#: fluentc_settings.php:20
     55msgid "Manage your FluentC translation settings, connect your account, and configure language options."
     56msgstr ""
     57
     58#: fluentc_settings.php:24
    5159msgid "Connect"
    5260msgstr ""
    5361
    54 #: fluentc_settings.php:261
     62#: fluentc_settings.php:25
    5563msgid "Languages"
    5664msgstr ""
    5765
    58 #: fluentc_settings.php:262
     66#: fluentc_settings.php:26
    5967msgid "Advanced"
    6068msgstr ""
    6169
    62 #: fluentc_settings.php:265
    63 msgid "To use the FluentC, you need an active subscription."
    64 msgstr ""
    65 
    66 #: fluentc_settings.php:276
    67 msgid "Manage FluentC Account and Languages"
    68 msgstr ""
    69 
    70 #: fluentc_settings.php:280
     70#: fluentc_settings.php:30
     71msgid "To use FluentC, you need an active subscription."
     72msgstr ""
     73
     74#: fluentc_settings.php:32
     75msgid "Manage FluentC Account and Add Languages"
     76msgstr ""
     77
     78#: fluentc_settings.php:34
    7179msgid "Sign Up and Connect to FluentC"
    7280msgstr ""
    7381
    74 #: fluentc_settings.php:294
    75 msgid "Three steps have translation on your site"
    76 msgstr ""
    77 
    78 #: fluentc_settings.php:296
     82#: fluentc_settings.php:35
     83msgid "Three steps to have translation on your site"
     84msgstr ""
     85
     86#: fluentc_settings.php:37
    7987msgid "Click the link above to link your site to FluentC"
    8088msgstr ""
    8189
    82 #: fluentc_settings.php:297
     90#: fluentc_settings.php:38
    8391msgid "Subscribe to Languages"
    8492msgstr ""
    8593
    86 #: fluentc_settings.php:298
     94#: fluentc_settings.php:39
    8795msgid "Add the html tag if you choose to display the languages as dropdown or list"
    8896msgstr ""
    8997
    90 #: fluentc_settings.php:315
     98#: fluentc_settings.php:48
     99#: fluentc_settings.php:50
     100msgid "Add Languages in FluentC Dashboard"
     101msgstr ""
     102
     103#: fluentc_settings.php:62
    91104msgid "FluentC API Key"
    92105msgstr ""
    93106
    94 #: fluentc_settings.php:323
     107#: fluentc_settings.php:70
    95108msgid "Save Changes"
    96109msgstr ""
    97110
    98 #: fluentc_settings.php:345
     111#: fluentc_settings.php:77
    99112msgid "For any assistance please contact FluentC"
    100113msgstr ""
    101114
    102 #: fluentc_settings.php:345
     115#: fluentc_settings.php:77
    103116msgid "Help and Support"
    104117msgstr ""
    105118
    106 #: src/actions/class-admin.php:347
     119#: src/actions/class-admin.php:325
    107120msgid "<p><strong>FluentC API Key is missing.</strong> Please add your API key in settings to use the FluentC features.</p>"
    108121msgstr ""
     122
     123#: src/actions/class-translationstatus.php:87
     124#: src/actions/class-translationstatus.php:88
     125msgid "Translation Status"
     126msgstr ""
     127
     128#: src/actions/class-translationstatus.php:140
     129#: src/actions/class-translationstatus.php:159
     130#: src/actions/class-translationstatus.php:184
     131#: src/actions/class-translationstatus.php:221
     132#: src/actions/class-translationstatus.php:272
     133#: src/actions/class-translationstatus.php:350
     134#: src/actions/class-translationstatus.php:390
     135#: src/actions/class-translationstatus.php:453
     136msgid "You do not have permission to perform this action."
     137msgstr ""
     138
     139#: src/actions/class-translationstatus.php:146
     140msgid "Site scan completed successfully."
     141msgstr ""
     142
     143#: src/actions/class-translationstatus.php:148
     144msgid "An error occurred during the site scan."
     145msgstr ""
     146
     147#: src/actions/class-translationstatus.php:171
     148msgid "URL status updated successfully."
     149msgstr ""
     150
     151#: src/actions/class-translationstatus.php:173
     152msgid "An error occurred while updating the URL status."
     153msgstr ""
     154
     155#: src/actions/class-translationstatus.php:198
     156msgid "Last scan: %s ago"
     157msgstr ""
     158
     159#: src/actions/class-translationstatus.php:202
     160msgid "Last Scan older than 7 days, scan again"
     161msgstr ""
     162
     163#: src/actions/class-translationstatus.php:205
     164msgid "No scan has been performed yet"
     165msgstr ""
     166
     167#: src/actions/class-translationstatus.php:259
     168msgid "Translation process started."
     169msgstr ""
     170
     171#: src/actions/class-translationstatus.php:278
     172msgid "Translation cancelled"
     173msgstr ""
     174
     175#: src/actions/class-translationstatus.php:280
     176msgid "An error occurred while cancelling the translation."
     177msgstr ""
     178
     179#: src/actions/class-translationstatus.php:294
     180msgid "Original URL"
     181msgstr ""
     182
     183#: src/actions/class-translationstatus.php:295
     184msgid "Translations"
     185msgstr ""
     186
     187#: src/actions/class-translationstatus.php:306
     188msgid "Translated URL"
     189msgstr ""
     190
     191#: src/actions/class-translationstatus.php:307
     192msgid "Language"
     193msgstr ""
     194
     195#: src/actions/class-translationstatus.php:308
     196msgid "Status"
     197msgstr ""
     198
     199#: src/actions/class-translationstatus.php:325
     200msgid "Translated"
     201msgstr ""
     202
     203#: src/actions/class-translationstatus.php:325
     204msgid "Pending"
     205msgstr ""
     206
     207#: src/actions/class-translationstatus.php:333
     208msgid "No translations available"
     209msgstr ""
     210
     211#: src/actions/class-translationstatus.php:398
     212msgid "Translation Cancelled"
     213msgstr ""
     214
     215#: src/actions/class-translationstatus.php:425
     216msgid "Translation In Progress"
     217msgstr ""
     218
     219#: src/actions/class-translationstatus.php:429
     220msgid "Translation Completed"
     221msgstr ""
     222
     223#: src/actions/class-translationstatus.php:432
     224msgid "Translation Not Started"
     225msgstr ""
     226
     227#: src/actions/class-translationstatus.php:435
     228msgid "Last Translation Canceled"
     229msgstr ""
     230
     231#: src/templates/translation-status.php:4
     232msgid "FluentC Translation Status"
     233msgstr ""
     234
     235#: src/templates/translation-status.php:8
     236msgid "Monitor and manage the translation status of your site pages. Use the buttons below to scan your site for translatable content and initiate translations."
     237msgstr ""
     238
     239#: src/templates/translation-status.php:12
     240msgid "Scan your site to see all available pages for translation."
     241msgstr ""
     242
     243#: src/templates/translation-status.php:13
     244msgid "Identify Pages for Translation"
     245msgstr ""
     246
     247#: src/templates/translation-status.php:15
     248msgid "Translate all pages in selected languages, including updates to existing translations."
     249msgstr ""
     250
     251#: src/templates/translation-status.php:16
     252msgid "Translate & Update Site"
     253msgstr ""
     254
     255#: src/templates/translation-status.php:19
     256msgid "Cancel Translation"
     257msgstr ""
  • fluentc-translation/trunk/readme.txt

    r3156028 r3159297  
    1 === FluentC - AI-Powered Multilingual Website Translaton ===
     1=== FluentC - AI-Powered Translation for WP ===
    22Contributors: mvpis
    33Donate link: https://www.fluentc.ai
    4 Tags: translation, multilingual, SEO, WooCommerce, localization
     4Tags: translation, multilingual, translate, language switcher, automatic translation
    55Requires at least: 4.6
    66Tested up to: 6.6.2
    7 Stable tag: 1.9
     7Stable tag: 1.9.1
    88Requires PHP: 7.3
    99License: GPLv2 or later
     
    1212
    1313== Description ==
    14 Limited Time Offer: One Free Language for all sites!
    15 FluentC revolutionizes WordPress translation with its AI-powered, user-friendly approach. Designed for simplicity and efficiency, FluentC offers automatic translations that are both quick and accurate, making your WordPress site multilingual without the technical hassle.
    16 Key Features:
     14**Limited Time Offer: One Free Language for All Sites!**
    1715
    18 AI-powered translations for over 130 languages
    19 Flat-fee pricing: $25/month per language with unlimited translations
    20 SEO-optimized translations to boost your multilingual search rankings
    21 No performance impact on your WordPress site
    22 Easy setup and minimal configuration required
     16FluentC transforms your WordPress site into a **multilingual powerhouse** with **AI-powered translations** in over 130 languages. It’s designed to be fast, reliable, and easy to use, without the need for technical expertise. Enjoy **SEO-optimized translations** to increase international traffic and sales, all while maintaining top performance on your WordPress site.
    2317
    24 FluentC for WooCommerce
    25 Seamlessly translate your WooCommerce store:
     18**Key Features:**
     19- **AI-Powered Automatic Translation**: Translate your WordPress site in over 130 languages with AI precision, ensuring high-quality, human-like translations.
     20- **One Free Language with Unlimited Translations**: For a limited time, you can translate your site into one language at no cost.
     21- **Flat-Rate Pricing**: $25/month per additional language with unlimited translations. No hidden fees or word limits.
     22- **SEO-Optimized**: Automatically generates SEO-friendly translations, including **meta tags**, **URL slugs**, and **schema.org data**.
     23- **No Performance Impact**: Translations occur without slowing down your website, ensuring optimal speed even with multiple languages.
     24- **Manual Translation Edits**: Easily fine-tune and manually adjust translations to get them just right for your audience.
     25- **Compatible with Popular Plugins**: Seamless integration with WooCommerce, Yoast SEO, WPForms, Contact Form 7, Elementor, and ACF, ensuring all your site’s elements are translated.
    2626
    27 Automatic translation of WooCommerce pages, product categories, and attributes
    28 Product metadata synchronization
    29 Compatible with popular WooCommerce extensions
     27**FluentC for WooCommerce:**
     28Boost your WooCommerce store’s global reach with automated translations for:
     29- **Product Pages**: Translate product descriptions, categories, attributes, and more.
     30- **SEO Optimization**: FluentC translates WooCommerce schema.org data for improved multilingual SEO.
     31- **Full Metadata Translation**: Ensure your products are accurately translated, including meta keywords and descriptions for improved search engine visibility.
    3032
    31 FluentC for Blocks
    32 Direct support for WordPress block editor:
     33**Advanced Features**:
     34- **Hreflang Tags**: Automatically generated hreflang tags help search engines index your multilingual pages properly.
     35- **Manual Translation Control**: Take control by manually editing translations without losing context.
    3336
    34 Translate core blocks including template parts, headings, buttons, and more
    35 Enhanced compatibility with block-enabled themes
     37== Frequently Asked Questions ==
     38
     39= What does the 'Free Language' offer include? =
     40FluentC offers one free language with unlimited translations for all WordPress sites. This makes FluentC the most affordable option for multilingual WordPress websites. You only pay for additional languages.
     41
     42= Will FluentC slow down my site? =
     43No, FluentC is designed to deliver translations without impacting your website’s speed or performance.
     44
     45= Is FluentC compatible with WooCommerce? =
     46Yes, FluentC fully supports WooCommerce, including automatic translations for product pages, categories, schema.org data, and product metadata.
     47
     48= How does FluentC help with SEO for multilingual sites? =
     49FluentC automatically generates SEO-optimized translations, including translated **meta tags**, **URLs**, and **schema.org microdata**, which helps your site rank higher in search engines across multiple languages.
     50
     51= Can I manually adjust translations? =
     52Yes, FluentC allows you to manually edit and adjust translations for precision, giving you complete control over how your content appears in different languages.
     53
    3654
    3755== Installation ==
     
    4361Choose your target languages and configure display settings
    4462Add the FluentC widget to your site using <div id="fluentc-widget"></div>
    45 
    46 == Frequently Asked Questions ==
    47 = How does FluentC compare to other translation plugins? =
    48 FluentC offers:
    49 
    50 Unlimited translations at a flat monthly fee
    51 No impact on site performance
    52 AI-powered translations for accuracy
    53 Easy setup and management
    54 SEO optimization for multilingual sites
    55 
    56 = Is FluentC compatible with my theme and plugins? =
    57 FluentC is designed to work with most WordPress themes and plugins, including WooCommerce and popular page builders.
    58 = How does FluentC handle content updates? =
    59 FluentC automatically detects and translates new or updated content, keeping all language versions in sync.
    60 = Is there a limit to how much content I can translate? =
    61 No, FluentC offers unlimited translations within your subscription.
    62 For more FAQs and support, visit FluentC Support.
    6363
    6464== Screenshots ==
     
    9090= 1.7 =
    9191Upgrade now to unlock advanced translation editing, seamless navigation integration, flexible FluentC block placement, and our game-changing proactive translation technology. Experience a new level of multilingual website management!
    92 
    93 == External Service Integration ==
    94 FluentC uses an external JavaScript file (https://widget.fluentc.io/fluentcWidgetWordpress.min.js) to provide advanced features and ensure optimal performance. This approach allows for seamless updates and enhanced functionality without impacting your WordPress hosting environment.
  • fluentc-translation/trunk/src/actions/class-wordpress.php

    r3155849 r3159297  
    141141    public function filter_block($block_content, $block)
    142142{
    143     do_action('qm/info', 'Starting filter_block');
    144     do_action('qm/info', 'Original content: ' . substr($block_content, 0, 100) . '...');
    145 
     143 
    146144    if (!$this->should_process_content($block_content)) {
    147         do_action('qm/info', 'Content not processed: language code missing or content empty');
     145       do_action('qm/info', 'Content not processed: language code missing or content empty');
    148146        return $block_content;
    149147    }
    150148
    151149    $dom = $this->load_dom($block_content);
    152     do_action('qm/info', 'DOM loaded. Root children count: ' . count($dom->root->getChildren()));
    153 
     150   
    154151    $texts_to_translate = $entry_map = $entry_skip_map = [];
    155152
    156153    $this->process_dom_elements($dom, $texts_to_translate, $entry_map, $entry_skip_map);
    157     do_action('qm/info', 'DOM processed. Texts to translate: ' . count($texts_to_translate) . ', Entry map: ' . count($entry_map) . ', Skip map: ' . count($entry_skip_map));
    158 
     154 
    159155    if (!empty($texts_to_translate)) {
    160156        $this->process_translations($texts_to_translate, $entry_map, $entry_skip_map);
     
    163159        do_action('qm/info', 'No texts to translate');
    164160    }
    165     do_action('qm/info', 'Pre Processed HTML: ' . substr($dom->root->outerHtml(), 0, 600) . '...');
     161   
    166162    $html = $this->get_processed_html($dom);
    167     do_action('qm/info', 'Processed HTML: ' . substr($html, 0, 600) . '...');
    168163   
    169     do_action('qm/info', 'Finished filter_block');
    170164    return $html ?: $block_content;
    171165}
  • fluentc-translation/trunk/src/fluentc_pll_api.php

    r3126655 r3159297  
    107107    $args = wp_parse_args( $args, array( 'fields' => 'slug' ) );
    108108   
    109     return $fluentc_connect->get_fluentc_languages_list( $args );
     109    $result = $fluentc_connect->get_fluentc_languages_list( $args );
     110    return is_array($result) ? $result : array();
    110111}
    111112
  • fluentc-translation/trunk/vendor/composer/installed.json

    r3155849 r3159297  
    117117            "time": "2024-09-21T22:25:23+00:00",
    118118            "type": "library",
    119             "installation-source": "source",
     119            "installation-source": "dist",
    120120            "autoload": {
    121121                "psr-4": {
     
    592592        {
    593593            "name": "php-http/httplug",
    594             "version": "2.4.0",
    595             "version_normalized": "2.4.0.0",
     594            "version": "2.4.1",
     595            "version_normalized": "2.4.1.0",
    596596            "source": {
    597597                "type": "git",
    598598                "url": "https://github.com/php-http/httplug.git",
    599                 "reference": "625ad742c360c8ac580fcc647a1541d29e257f67"
    600             },
    601             "dist": {
    602                 "type": "zip",
    603                 "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67",
    604                 "reference": "625ad742c360c8ac580fcc647a1541d29e257f67",
     599                "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4"
     600            },
     601            "dist": {
     602                "type": "zip",
     603                "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4",
     604                "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4",
    605605                "shasum": ""
    606606            },
     
    615615                "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0"
    616616            },
    617             "time": "2023-04-14T15:10:03+00:00",
     617            "time": "2024-09-23T11:39:58+00:00",
    618618            "type": "library",
    619619            "installation-source": "dist",
     
    646646            "support": {
    647647                "issues": "https://github.com/php-http/httplug/issues",
    648                 "source": "https://github.com/php-http/httplug/tree/2.4.0"
     648                "source": "https://github.com/php-http/httplug/tree/2.4.1"
    649649            },
    650650            "install-path": "../php-http/httplug"
  • fluentc-translation/trunk/vendor/composer/installed.php

    r3155849 r3159297  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => 'cf45b01c58ff2892b642f122caecf86f2d8b0873',
     6        'reference' => 'ff08d645781809501a5b0e469117ce9029569b3c',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => 'cf45b01c58ff2892b642f122caecf86f2d8b0873',
     16            'reference' => 'ff08d645781809501a5b0e469117ce9029569b3c',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
     
    8484        ),
    8585        'php-http/httplug' => array(
    86             'pretty_version' => '2.4.0',
    87             'version' => '2.4.0.0',
    88             'reference' => '625ad742c360c8ac580fcc647a1541d29e257f67',
     86            'pretty_version' => '2.4.1',
     87            'version' => '2.4.1.0',
     88            'reference' => '5cad731844891a4c282f3f3e1b582c46839d22f4',
    8989            'type' => 'library',
    9090            'install_path' => __DIR__ . '/../php-http/httplug',
  • fluentc-translation/trunk/vendor/fluentc/php-html-parser/src/PHPHtmlParser/Dom/Parser.php

    r3156028 r3159297  
    277277     */
    278278    private function setUpAttributes(Content $content, int $size, HtmlNode $node, Options $options, $tag): void
    279 {
    280     while (
    281         $content->char() != '>' &&
    282         $content->char() != '/'
    283     ) {
    284         $space = $content->skipByToken(StringToken::BLANK(), true);
    285         if (empty($space)) {
    286             try {
    287                 $content->fastForward(1);
    288             } catch (ContentLengthException $exception) {
    289                 // reached the end of the content
     279    {
     280        while (
     281            $content->char() != '>' &&
     282            $content->char() != '/'
     283        ) {
     284            $space = $content->skipByToken(StringToken::BLANK(), true);
     285            if (empty($space)) {
     286                try {
     287                    $content->fastForward(1);
     288                } catch (ContentLengthException $exception) {
     289                    // reached the end of the content
     290                    break;
     291                }
     292                continue;
     293            }
     294
     295            $name = $content->copyByToken(StringToken::EQUAL(), true);
     296            if ($name == '/') {
    290297                break;
    291298            }
    292             continue;
    293         }
    294 
    295         $name = $content->copyByToken(StringToken::EQUAL(), true);
    296         if ($name == '/') {
    297             break;
    298         }
    299 
    300         if (empty($name)) {
     299
     300            if (empty($name)) {
     301                $content->skipByToken(StringToken::BLANK());
     302                continue;
     303            }
     304
    301305            $content->skipByToken(StringToken::BLANK());
    302             continue;
    303         }
    304 
    305         $content->skipByToken(StringToken::BLANK());
    306         if ($content->char() == '=') {
    307             $content->fastForward(1)
    308                 ->skipByToken(StringToken::BLANK());
    309             switch ($content->char()) {
    310                 case '"':
    311                     $content->fastForward(1);
    312                     $string = $this->parseComplexAttribute($content, '"', $size);
    313                     $content->fastForward(1);
    314                     $node->getTag()->setAttribute($name, $string);
    315                     break;
    316                 case "'":
    317                     $content->fastForward(1);
    318                     $string = $this->parseComplexAttribute($content, "'", $size);
    319                     $content->fastForward(1);
    320                     $node->getTag()->setAttribute($name, $string, false);
    321                     break;
    322                 default:
    323                     $node->getTag()->setAttribute($name, $content->copyByToken(StringToken::ATTR(), true));
    324                     break;
    325             }
    326         } else {
    327             // no value attribute
    328             if ($options->isStrict()) {
    329                 // can't have this in strict html
    330                 $character = $content->getPosition();
    331                 throw new StrictException("Tag '$tag' has an attribute '$name' without a value! (character #$character)");
    332             }
    333             $node->getTag()->setAttribute($name, null);
    334             if ($content->char() != '>') {
    335                 $content->rewind(1);
     306            if ($content->char() == '=') {
     307                $content->fastForward(1)
     308                    ->skipByToken(StringToken::BLANK());
     309                switch ($content->char()) {
     310                    case '"':
     311                        $content->fastForward(1);
     312                        $string = $content->copyUntil('"', true);
     313                        do {
     314                            $moreString = $content->copyUntilUnless('"', '=>');
     315                            $string .= $moreString;
     316                        } while (\strlen($moreString) > 0 && $content->getPosition() < $size);
     317                        $content->fastForward(1);
     318                        $node->getTag()->setAttribute($name, $string);
     319                        break;
     320                    case "'":
     321                        $content->fastForward(1);
     322                        $string = $content->copyUntil("'", true);
     323                        do {
     324                            $moreString = $content->copyUntilUnless("'", '=>');
     325                            $string .= $moreString;
     326                        } while (\strlen($moreString) > 0 && $content->getPosition() < $size);
     327                        $content->fastForward(1);
     328                        $node->getTag()->setAttribute($name, $string, false);
     329                        break;
     330                    default:
     331                        $node->getTag()->setAttribute($name, $content->copyByToken(StringToken::ATTR(), true));
     332                        break;
     333                }
     334            } else {
     335                // no value attribute
     336                if ($options->isStrict()) {
     337                    // can't have this in strict html
     338                    $character = $content->getPosition();
     339                    throw new StrictException("Tag '$tag' has an attribute '$name' with out a value! (character #$character)");
     340                }
     341                $node->getTag()->setAttribute($name, null);
     342                if ($content->char() != '>') {
     343                    $content->rewind(1);
     344                }
    336345            }
    337346        }
    338347    }
    339348}
    340 
    341 private function parseComplexAttribute(Content $content, string $quote, int $size): string
    342 {
    343     $string = '';
    344     $nestLevel = 0;
    345     while ($content->getPosition() < $size) {
    346         $char = $content->char();
    347         if ($char === $quote && $nestLevel === 0) {
    348             break;
    349         }
    350         $string .= $char;
    351         if ($char === '{') {
    352             $nestLevel++;
    353         } elseif ($char === '}') {
    354             $nestLevel--;
    355         }
    356         $content->fastForward(1);
    357     }
    358     return $string;
    359 }
    360 }
  • fluentc-translation/trunk/vendor/fluentc/php-html-parser/src/PHPHtmlParser/Dom/Tag.php

    r3156028 r3159297  
    174174     */
    175175    public function setAttribute(string $key, $value): void
    176 {
    177     // Handle data-* attributes
    178     if (strpos($key, 'data-') === 0) {
    179         $this->attr[$key] = AttributeDTO::makeFromPrimitives($value);
    180     } else {
    181         $this->attr[strtolower($key)] = AttributeDTO::makeFromPrimitives($value);
    182     }
    183 }
     176    {
     177        // Handle data-* attributes
     178        if (strpos($key, 'data-') === 0) {
     179            $this->attr[$key] = AttributeDTO::makeFromPrimitives($value);
     180        } else {
     181            $this->attr[strtolower($key)] = AttributeDTO::makeFromPrimitives($value);
     182        }
     183    }
    184184
    185185    /**
     
    373373     */
    374374   
    375      public function makeOpeningTag(): string
    376      {
    377          $return = '<' . $this->name;
    378      
    379          foreach ($this->attr as $key => $attributeDTO) {
    380              $return .= ' ' . $key;
    381              
    382              $value = $attributeDTO->getValue();
    383              if ($value === true || $value === '') {
    384                  continue;
    385              }
    386              
    387              if ($value !== null) {
    388                  $quote = $this->determineQuote($value);
    389                  $return .= '=' . $quote . $this->escapeAttributeValue($value, $quote) . $quote;
    390              }
    391          }
    392      
    393          if ($this->isSelfClosing()) {
    394              $return .= ' /';
    395          }
    396      
    397          $return .= '>';
    398      
    399          return $return;
    400      }
    401 
    402      private function determineQuote($value): string
    403 {
    404     return (strpos($value, '"') !== false && strpos($value, "'") === false) ? "'" : '"';
    405 }
    406 
    407 private function escapeAttributeValue($value, $quote): string
    408 {
    409     if ($quote === '"') {
    410         return str_replace('"', '&quot;', $value);
    411     }
    412     return str_replace("'", '&#39;', $value);
    413 }
     375    public function makeOpeningTag(): string
     376    {
     377        if ($this->isComment()) {
     378            return $this->opening . substr($this->name, 3);
     379        }
     380
     381        $return = '<'.$this->name;
     382
     383        // handle attributes
     384        foreach ($this->attr as $key => $attributeDTO) {
     385            $return .= ' '.$key;
     386           
     387            // Handle boolean attributes
     388            if ($attributeDTO->getValue() === true) {
     389                continue;
     390            }
     391           
     392            if ($attributeDTO->getValue() !== null && $attributeDTO->getValue() !== '') {
     393                $return .= '='.$attributeDTO->getOpeningQuote().$attributeDTO->getValue().$attributeDTO->getClosingQuote();
     394            }
     395        }
     396
     397        // handle void elements
     398        if ($this->isSelfClosing()) {
     399            $return .= ' /';
     400        }
     401
     402        $return .= '>';
     403
     404        return $return;
     405    }
     406
    414407    /**
    415408     * Generates the closing tag for this object.
  • fluentc-translation/trunk/vendor/php-http/httplug/CHANGELOG.md

    r3129167 r3159297  
    77and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
    88
     9## [2.4.1] - 2024-09-23
     10
     11- Updated code to not raise warnings for nullable parameters in PHP 8.4.
    912
    1013## [2.4.0] - 2023-04-14
  • fluentc-translation/trunk/vendor/php-http/httplug/src/Exception/HttpException.php

    r3129167 r3159297  
    2727        RequestInterface $request,
    2828        ResponseInterface $response,
    29         \Exception $previous = null
     29        ?\Exception $previous = null
    3030    ) {
    3131        parent::__construct($message, $request, $previous);
     
    5151        RequestInterface $request,
    5252        ResponseInterface $response,
    53         \Exception $previous = null
     53        ?\Exception $previous = null
    5454    ) {
    5555        $message = sprintf(
  • fluentc-translation/trunk/vendor/php-http/httplug/src/Exception/NetworkException.php

    r3129167 r3159297  
    2020     * @param string $message
    2121     */
    22     public function __construct($message, RequestInterface $request, \Exception $previous = null)
     22    public function __construct($message, RequestInterface $request, ?\Exception $previous = null)
    2323    {
    2424        $this->setRequest($request);
  • fluentc-translation/trunk/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php

    r3129167 r3159297  
    1717    }
    1818
    19     /**
    20      * {@inheritdoc}
    21      */
    2219    public function getRequest(): RequestInterface
    2320    {
  • fluentc-translation/trunk/vendor/php-http/httplug/src/Exception/RequestException.php

    r3129167 r3159297  
    2121     * @param string $message
    2222     */
    23     public function __construct($message, RequestInterface $request, \Exception $previous = null)
     23    public function __construct($message, RequestInterface $request, ?\Exception $previous = null)
    2424    {
    2525        $this->setRequest($request);
  • fluentc-translation/trunk/vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php

    r3129167 r3159297  
    1919    }
    2020
    21     /**
    22      * {@inheritdoc}
    23      */
    24     public function then(callable $onFulfilled = null, callable $onRejected = null)
     21    public function then(?callable $onFulfilled = null, ?callable $onRejected = null)
    2522    {
    2623        if (null === $onFulfilled) {
     
    3532    }
    3633
    37     /**
    38      * {@inheritdoc}
    39      */
    4034    public function getState()
    4135    {
     
    4337    }
    4438
    45     /**
    46      * {@inheritdoc}
    47      */
    4839    public function wait($unwrap = true)
    4940    {
  • fluentc-translation/trunk/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php

    r3129167 r3159297  
    1818    }
    1919
    20     /**
    21      * {@inheritdoc}
    22      */
    23     public function then(callable $onFulfilled = null, callable $onRejected = null)
     20    public function then(?callable $onFulfilled = null, ?callable $onRejected = null)
    2421    {
    2522        if (null === $onRejected) {
     
    3936    }
    4037
    41     /**
    42      * {@inheritdoc}
    43      */
    4438    public function getState()
    4539    {
     
    4741    }
    4842
    49     /**
    50      * {@inheritdoc}
    51      */
    5243    public function wait($unwrap = true)
    5344    {
Note: See TracChangeset for help on using the changeset viewer.