WordPress.org

Make WordPress Core

Ticket #10679: translations.php.diff

File translations.php.diff, 614 bytes (added by sirzooro, 9 years ago)

New filter in wp-includes/pomo/translations.php

  • translations.php

    old new  
    6161        function translate($singular, $context=null) {
    6262                $entry = new Translation_Entry(array('singular' => $singular, 'context' => $context));
    6363                $translated = $this->translate_entry($entry);
    64                 return ($translated && !empty($translated->translations))? $translated->translations[0] : $singular;
     64                if ( $translated && !empty( $translated->translations ) ) {
     65                        return $translated->translations[0];
     66                } else {
     67                        return apply_filters( 'translate', $singular );
     68                }
    6569        }
    6670
    6771        /**