Making WordPress.org

Changeset 10684


Ignore:
Timestamp:
02/17/2021 03:46:05 AM (5 years ago)
Author:
dd32
Message:

Translate: Auto-correct curly quotes when HTML tags mismatch, catches cases where attributes are incorrectly curled.

See #5154.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-fixer/wporg-gp-translation-fixer.php

    r10683 r10684  
    7777
    7878                                                break;
     79                                        case 'tags':
     80                                                // Try replacing curly quotes.
     81                                                $translation = str_replace(
     82                                                        [
     83                                                                '“', // “ - Left double quotation mark
     84                                                                '”', // ” - Right double quotation mark
     85                                                                '″', // ″ - Double Prime
     86                                                        ],
     87                                                        '"',
     88                                                        $translation
     89                                                );
     90                                                $translation = str_replace(
     91                                                        [
     92                                                                '‘', // ‘ - Opening curly single quote
     93                                                                '’', // ’ - Closing curly single quote
     94                                                                '′', // ′ - Prime
     95                                                        ],
     96                                                        "'",
     97                                                        $translation
     98                                                );
     99
     100                                                break;
    79101                                }
    80102                        }
Note: See TracChangeset for help on using the changeset viewer.