Skip to content

Commit

Permalink
Fix GP_Validation_Rules::__call() error message (#1289)
Browse files Browse the repository at this point in the history
* Fix variables in sprintf()

* Improve comment

* Add missing gettext

* Keep Method name concatenation out of the translation string

* Fix translator comment

Co-authored-by: Dominik Schilling <dominikschilling+git@gmail.com>
  • Loading branch information
pedro-mendonca and ocean90 committed Dec 16, 2021
1 parent d513e8c commit e23a80b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gp-includes/validation.php
Expand Up @@ -108,10 +108,13 @@ public function __call( $name, $args ) {
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
trigger_error(
sprintf(
/* translators: 1: Class name, 2: method name. */
'Call to undefined method: %1$::%2$().',
esc_html( get_class( $this ) ),
esc_html( $name )
/* translators: %s: Method name. */
esc_html__( 'Call to undefined method: %s.', 'glotpress' ),
sprintf(
'%1$s::%2$s()',
esc_html( get_class( $this ) ),
esc_html( $name )
)
),
E_USER_ERROR
);
Expand Down

0 comments on commit e23a80b

Please sign in to comment.