← All changes
|
inc/compatibility/multilingual/string-collector.php
+12
-6
2.12.4
→
2.12.8
View file →
| @@ -280,23 +280,29 @@ | ||
| 280 | 280 | |
| 281 | 281 | // reply_to is an email address (or a smart tag resolving to one), not |
| 282 | 282 | // human-readable copy, so it is intentionally excluded from the |
| 283 | 283 | // translatable set. from_name can legitimately be a localized display name. |
| 284 | + // [ meta key, label, editor type ]. The string name stays keyed on | |
| 285 | + // 'body' for continuity, but the value has to be read from | |
| 286 | + // `email_body` - that is what _srfm_email_notification's sanitize | |
| 287 | + // callback stores, so reading 'body' always found nothing and the | |
| 288 | + // message body was never registered for translation at all. | |
| 284 | 289 | $fields = [ |
| 285 | - 'subject' => [ __( 'Subject', 'sureforms' ), 'LINE' ], | |
| 286 | - 'body' => [ __( 'Message body', 'sureforms' ), 'AREA' ], | |
| 287 | - 'from_name' => [ __( '"From" name', 'sureforms' ), 'LINE' ], | |
| 290 | + 'subject' => [ 'subject', __( 'Subject', 'sureforms' ), 'LINE' ], | |
| 291 | + 'body' => [ 'email_body', __( 'Message body', 'sureforms' ), 'AREA' ], | |
| 292 | + 'from_name' => [ 'from_name', __( '"From" name', 'sureforms' ), 'LINE' ], | |
| 288 | 293 | ]; |
| 289 | 294 | /* translators: %d is the notification number. */ |
| 290 | 295 | $notification_group = __( 'Notifications', 'sureforms' ) . '/' . sprintf( __( 'Notification #%d', 'sureforms' ), (int) $index + 1 ); |
| 291 | 296 | foreach ( $fields as $field => $meta ) { |
| 292 | - $value = isset( $notification[ $field ] ) ? Helper::get_string_value( $notification[ $field ] ) : ''; | |
| 297 | + $meta_key = $meta[0]; | |
| 298 | + $value = isset( $notification[ $meta_key ] ) ? Helper::get_string_value( $notification[ $meta_key ] ) : ''; | |
| 293 | 299 | $this->register_form_string( |
| 294 | 300 | $form_id, |
| 295 | 301 | String_Translator::notification_name( (int) $index, $field ), |
| 296 | 302 | $value, |
| 297 | - $notification_group . ': ' . $meta[0], | |
| 298 | - $meta[1] | |
| 303 | + $notification_group . ': ' . $meta[1], | |
| 304 | + $meta[2] | |
| 299 | 305 | ); |
| 300 | 306 | } |
| 301 | 307 | } |
| 302 | 308 | |