Changeset 9814 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php
- Timestamp:
- 05/02/2020 10:50:07 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php
r9555 r9814 46 46 add_filter( 'gp_translation_row_template_more_links', array( $this, 'add_consistency_tool_link' ), 10, 5 ); 47 47 add_filter( 'gp_translation_prepare_for_save', array( $this, 'apply_capital_P_dangit' ), 10, 2 ); 48 add_filter( 'gp_original_extracted_comments', array( $this, 'format_translator_commments' ), 5 ); 48 49 49 50 // Cron. … … 66 67 $this->register_cli_commands(); 67 68 } 69 } 70 71 /** 72 * Splits multiple translator comments for an original into separate lines. 73 */ 74 public function format_translator_commments( $comments ) { 75 $comment_parts = preg_split( '#(^|\n)translators: #i', $comments, 0, PREG_SPLIT_NO_EMPTY ); 76 if ( ! $comment_parts ) { 77 return $comments; 78 } 79 80 return implode( '<br/>', $comment_parts ); 68 81 } 69 82
Note: See TracChangeset
for help on using the changeset viewer.