Plugin Directory

Changeset 3751852


Ignore:
Timestamp:
10/17/2026 11:22:13 AM (4 weeks ago)
Author:
mstron
Message:

Update to version 1.0.6

Location:
cocos-translate/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cocos-translate/trunk/cocos-translate.php

    r3737360 r3751852  
    44 * Plugin URI:        https://translate.cocos.codes/
    55 * Description:        Multilingual WordPress. Translate your entire site from the front end with a visual editor, machine-translate with Google Translate (your own API key), SEO-friendly per-language URLs, hreflang tags and a language switcher.
    6  * Version:           1.0.5
     6 * Version:           1.0.6
    77 * Requires at least: 5.6
    88 * Requires PHP:      7.4
    … …  
    2020}
    2121
    22 define( 'CC_TRANSLA_WP_VERSION', '1.0.5' );
     22define( 'CC_TRANSLA_WP_VERSION', '1.0.6' );
    2323define( 'CC_TRANSLA_WP_FILE', __FILE__ );
    2424define( 'CC_TRANSLA_WP_DIR', plugin_dir_path( __FILE__ ) );
  • cocos-translate/trunk/includes/class-cc-transla-db.php

    r3737360 r3751852  
    183183                if ( '' === $original || '' === $language ) {
    184184                        return false;
     185                }
     186
     187                // URL slugs must stay plain ASCII ("categoría" -> "categoria"), whoever produced the translation.
     188                if ( 'slug' === $context && is_string( $translated ) && '' !== trim( $translated ) ) {
     189                        $translated = self::normalize_slug( $translated, $language );
    185190                }
    186191
    … …  
    235240
    236241        /**
     242         * Turn a translated URL slug into a clean ASCII slug: language-aware accent removal
     243         * (es "categoría" -> "categoria", de "Über" -> "ueber"), transliteration of other
     244         * scripts when the intl extension is available (uk "категорія" -> "kategoria"),
     245         * then WordPress' own lowercase-with-dashes rules.
     246         *
     247         * @param string $slug     Translated slug.
     248         * @param string $language Target locale (e.g. es_ES), used by remove_accents().
     249         * @return string
     250         */
     251        public static function normalize_slug( $slug, $language = '' ) {
     252                $slug = remove_accents( wp_strip_all_tags( (string) $slug ), (string) $language );
     253
     254                if ( preg_match( '/[^\x00-\x7F]/', $slug ) && function_exists( 'transliterator_transliterate' ) ) {
     255                        $ascii = transliterator_transliterate( 'Any-Latin; Latin-ASCII', $slug );
     256                        if ( is_string( $ascii ) && '' !== $ascii ) {
     257                                $slug = $ascii;
     258                        }
     259                }
     260
     261                return sanitize_title_with_dashes( $slug, '', 'save' );
     262        }
     263
     264        /**
    237265         * Register strings that have no row yet (translated stays NULL).
    238266         *
  • cocos-translate/trunk/readme.txt

    r3737360 r3751852  
    77Tested up to: 7.1
    88Requires PHP: 7.4
    9 Stable tag: 1.0.5
     9Stable tag: 1.0.6
    1010License: GPLv2 or later
    1111License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    5353* Very large string tables load into memory per request; let the built-in page cache do its job.
    5454
     55== Screenshots ==
     56
     571. **Language Settings** - Configure the default website language, translation language, SEO-friendly URL slugs, and automatic browser language redirection.
     582. **Visual Translation Editor** - Translate website content directly on the frontend using an intuitive visual editor with highlighted translatable elements.
     593. **Automatic Translation Settings** - Configure Google Cloud Translation API, automatic translation, background processing, and translation scheduling.
     604. **Language Switcher Configuration** - Enable and customize the floating language switcher with a live preview and multiple display options.
     615. **Language Switcher Appearance** - Customize background colors, text colors, borders, corner radius, flag appearance, and animations.
     626. **Language Switcher Position and Behavior** - Choose the switcher position, width, spacing, flag placement, language names, and additional display settings.
     637. **Automatic Translation and WP-Cron** - Schedule background translations using WP-Cron or a server cron job, and configure automatic translation limits.
     648. **Translation Limits and Progress** - Set daily character limits, configure low-budget email notifications, and monitor automatic translation progress.
     659. **Translation Management** - Browse, search, filter, manually edit, and manage collected translations from one centralized interface.
     6610. **Translation Glossary** - Define custom translations for important words, brand names, product names, and technical terminology to maintain consistency.
     6711. **Advanced Translation Settings** - Configure theme and plugin string translation, URL slug translation, caching, content exclusions, and string discovery.
     6812. **SEO and Maintenance Settings** - Manage hreflang tags, translation exclusions, cache clearing, stored translations, and plugin reset options.
     69
    5570== Changelog ==
     71
     72= 1.0.6 =
     73* Fix: translated URL slugs are now saved as clean ASCII slugs, whether they come from machine translation, the visual editor or a manual edit (for example "categoría" becomes "categoria", "Über uns" becomes "ueber-uns"). Accents are removed according to the target language and other scripts are transliterated.
     74* Readme: added screenshot descriptions.
    5675
    5776= 1.0.5 =
Note: See TracChangeset for help on using the changeset viewer.