Changeset 1871
- Timestamp:
- 09/11/2015 04:55:13 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/translate.wordpress.org/includes/gp-plugins/wporg-log-warnings-to-slack.php
r1870 r1871 39 39 40 40 /** 41 * Logs translation warnings into Slack 41 * Logs translation warnings into Slack for any newly created translations. 42 42 * 43 43 * @param GP_Translation $translatiom The just-created translation. 44 44 */ 45 45 function translation_created( $translation ) { 46 if ( $translation->warnings ) {47 $this->process_translation_warning( $translation );46 if ( ! $translation->warnings ) { 47 return; 48 48 } 49 50 // We only want to trigger for strings which are live, or are for consideration. 51 if ( ! in_array( $translation->status, array( 'current', 'waiting' ) ) ) { 52 return; 53 } 54 55 $this->process_translation_warning( $translation ); 49 56 } 50 57 58 /** 59 * Logs translation warnings into Slack for any existing translations that are updated. 60 * 61 * @param GP_Translation $translatiom The just-created translation. 62 */ 51 63 function translation_saved( $translation ) { 52 if ( $translation->warnings ) {53 $this->process_translation_warning( $translation );64 if ( ! $translation->warnings ) { 65 return; 54 66 } 67 68 // We only want to trigger for strings which are live, or are for consideration. 69 if ( ! in_array( $translation->status, array( 'current', 'waiting' ) ) ) { 70 return; 71 } 72 73 $this->process_translation_warning( $translation ); 55 74 } 56 75
Note: See TracChangeset
for help on using the changeset viewer.