Skip to:
Content

bbPress.org

Ticket #3294: trac-3294-phpcs-fix-untranslatable-text.patch

File trac-3294-phpcs-fix-untranslatable-text.patch, 2.3 KB (added by jrf, 20 months ago)

Fixes most violations against the WordPress.WP.I18n.NonSingularStringLiteralText error code

  • src/includes/forums/functions.php

     
    590590
    591591        } else {
    592592                $append_error = ( is_wp_error( $forum_id ) && $forum_id->get_error_message() ) ? $forum_id->get_error_message() . ' ' : '';
    593                 bbp_add_error( 'bbp_forum_error', __( '<strong>ERROR</strong>: The following problem(s) have been found with your forum:' . $append_error . 'Please try again.', 'bbpress' ) );
     593                bbp_add_error( 'bbp_forum_error', sprintf( __( '<strong>ERROR</strong>: The following problem(s) have been found with your forum: %s Please try again.', 'bbpress' ), trim( $append_error ) ) );
    594594        }
    595595}
    596596
  • src/includes/replies/functions.php

     
    766766
    767767        } else {
    768768                $append_error = ( is_wp_error( $reply_id ) && $reply_id->get_error_message() ) ? $reply_id->get_error_message() . ' ' : '';
    769                 bbp_add_error( 'bbp_reply_error', __( '<strong>ERROR</strong>: The following problem(s) have been found with your reply:' . $append_error . 'Please try again.', 'bbpress' ) );
     769                bbp_add_error( 'bbp_reply_error', sprintf( __( '<strong>ERROR</strong>: The following problem(s) have been found with your reply: %s Please try again.', 'bbpress' ), trim( $append_error ) );
    770770        }
    771771}
    772772
  • src/includes/topics/functions.php

     
    713713
    714714        } else {
    715715                $append_error = ( is_wp_error( $topic_id ) && $topic_id->get_error_message() ) ? $topic_id->get_error_message() . ' ' : '';
    716                 bbp_add_error( 'bbp_topic_error', __( '<strong>ERROR</strong>: The following problem(s) have been found with your topic:' . $append_error . 'Please try again.', 'bbpress' ) );
     716                bbp_add_error( 'bbp_topic_error', sprintf( __( '<strong>ERROR</strong>: The following problem(s) have been found with your topic: %s Please try again.', 'bbpress' ), trim( $append_error ) ) );
    717717        }
    718718}
    719719