Changeset 3751852
- Timestamp:
- 10/17/2026 11:22:13 AM (4 weeks ago)
- Location:
- cocos-translate/trunk
- Files:
-
- 3 edited
-
cocos-translate.php (modified) (2 diffs)
-
includes/class-cc-transla-db.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cocos-translate/trunk/cocos-translate.php
r3737360 r3751852 4 4 * Plugin URI: https://translate.cocos.codes/ 5 5 * 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. 56 * Version: 1.0.6 7 7 * Requires at least: 5.6 8 8 * Requires PHP: 7.4 … … 20 20 } 21 21 22 define( 'CC_TRANSLA_WP_VERSION', '1.0. 5' );22 define( 'CC_TRANSLA_WP_VERSION', '1.0.6' ); 23 23 define( 'CC_TRANSLA_WP_FILE', __FILE__ ); 24 24 define( 'CC_TRANSLA_WP_DIR', plugin_dir_path( __FILE__ ) ); -
cocos-translate/trunk/includes/class-cc-transla-db.php
r3737360 r3751852 183 183 if ( '' === $original || '' === $language ) { 184 184 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 ); 185 190 } 186 191 … … 235 240 236 241 /** 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 /** 237 265 * Register strings that have no row yet (translated stays NULL). 238 266 * -
cocos-translate/trunk/readme.txt
r3737360 r3751852 7 7 Tested up to: 7.1 8 8 Requires PHP: 7.4 9 Stable tag: 1.0. 59 Stable tag: 1.0.6 10 10 License: GPLv2 or later 11 11 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 53 53 * Very large string tables load into memory per request; let the built-in page cache do its job. 54 54 55 == Screenshots == 56 57 1. **Language Settings** - Configure the default website language, translation language, SEO-friendly URL slugs, and automatic browser language redirection. 58 2. **Visual Translation Editor** - Translate website content directly on the frontend using an intuitive visual editor with highlighted translatable elements. 59 3. **Automatic Translation Settings** - Configure Google Cloud Translation API, automatic translation, background processing, and translation scheduling. 60 4. **Language Switcher Configuration** - Enable and customize the floating language switcher with a live preview and multiple display options. 61 5. **Language Switcher Appearance** - Customize background colors, text colors, borders, corner radius, flag appearance, and animations. 62 6. **Language Switcher Position and Behavior** - Choose the switcher position, width, spacing, flag placement, language names, and additional display settings. 63 7. **Automatic Translation and WP-Cron** - Schedule background translations using WP-Cron or a server cron job, and configure automatic translation limits. 64 8. **Translation Limits and Progress** - Set daily character limits, configure low-budget email notifications, and monitor automatic translation progress. 65 9. **Translation Management** - Browse, search, filter, manually edit, and manage collected translations from one centralized interface. 66 10. **Translation Glossary** - Define custom translations for important words, brand names, product names, and technical terminology to maintain consistency. 67 11. **Advanced Translation Settings** - Configure theme and plugin string translation, URL slug translation, caching, content exclusions, and string discovery. 68 12. **SEO and Maintenance Settings** - Manage hreflang tags, translation exclusions, cache clearing, stored translations, and plugin reset options. 69 55 70 == 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. 56 75 57 76 = 1.0.5 =
Note:
See TracChangeset
for help on using the changeset viewer.