You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the validation part, I'm not sure why you added the $message parameter to the second position. This seems like an unnecessary back-compat break.
Building the message like this is also still cumbersome and not easy to translate since the sentence is split into multiple parts.
I think it would be much easier if the full message, one for positive and one for negative can be provided and only the type and field names are (optionally) injected.
Here is what I suggest for the validation notices (only added the actual message for the first example empty):
// Validation messages.
$messages = array(
'empty' => array(
'positive' => sprintf(
/* translators: 1: Type of a validation field. 2: Name of a validation field. */
__( 'The %1$s %2$s is invalid and should be empty!', 'glotpress' ),
$type_field,
'<strong>' . $name_field . '</strong>'
),
'negative' => sprintf(
/* translators: 1: Type of a validation field. 2: Name of a validation field. */
__( 'The %1$s %2$s is invalid and should not be empty!', 'glotpress' ),
$type_field,
'<strong>' . $name_field . '</strong>'
),
),
'empty_string' => array(
'positive' => 'the positive message',
'negative' => 'the negative message',
),
'positive_int' => array(
'positive' => 'the positive message',
'negative' => 'the negative message',
),
'int' => array(
'positive' => 'the positive message',
'negative' => 'the negative message',
),
'null' => array(
'positive' => 'the positive message',
'negative' => 'the negative message',
),
'between' => array(
'positive' => 'the positive message',
'negative' => 'the negative message',
),
'between_exclusive' => array(
'positive' => 'the positive message',
'negative' => 'the negative message',
),
'one_of' => array(
'positive' => 'the positive message',
'negative' => 'the negative message',
),
'consisting_only_of_ASCII_characters' => array(
'positive' => 'the positive message',
'negative' => 'the negative message',
),
'starting_and_ending_with_a_word_character' => array(
'positive' => 'the positive message',
'negative' => 'the negative message',
),
);
The text was updated successfully, but these errors were encountered: