Making WordPress.org

Changeset 10739


Ignore:
Timestamp:
03/03/2021 03:58:57 AM (3 years ago)
Author:
dd32
Message:

Translate: Allow Korean and chinese locales to skip emphasis/italic HTML tags in translations.

Follow up to [10731].
See #5643

File:
1 edited

Legend:

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

    r10733 r10739  
    121121     *  - The value of translatable/url attributes is excluded from the error message if it's not related to the issue at hand.
    122122     *  - Tags are sorted, <em>One</em> <strong>Two</strong> can be translated as <strong>foo</strong> <em>bar</em> without generating warning.
    123      *  - Japanese can remove `<em>` tags.
     123     *  - East asian languages can remove emphasis/italic tags.
    124124     *  - TODO: Tags are not validated to be nested correctly. GlotPress handles this by validating the ordering of the tags remained the same.
    125      *  - TODO: Extend/abstract the locales which can remove certain tags.
    126125     *
    127126     * @param string    $original    The source string.
     
    143142        }
    144143
    145         // Allow Japanese to exclude <em>. TODO: Abstract this / extend it to all languages affected / extend to full list of tags.
     144        // Allow certain laguages to exclude certain tags.
    146145        if ( count( $original_parts ) > count( $translation_parts ) ) {
    147146
    148147            $languages_without_italics = [
    149                 'ja',
    150                 // 'ko', 'zh', 'zh-hk', 'zh-cn', 'zh-sg', 'zh-tw' ??
     148                'ja', 'ko', 'zh', 'zh-hk', 'zh-cn', 'zh-sg', 'zh-tw'
    151149            ];
    152150
Note: See TracChangeset for help on using the changeset viewer.