Skip Navigation

[Resuelto] Error message doesn't make sense

This support ticket is created hace 5 años. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por duongN-3 hace 5 años.

Asistido por: Waqar.

Autor
Mensajes
#1395081
Screen Shot 2019-11-28 at 9.53.00 PM.png

I am trying to:
Update an error message in front-end forms when adding a relationship "person" post type to a "movie" post type.

Link to a page where the issue can be seen:
enlace oculto

I expected to see:
This doesn't make sense in English. It should read something like "This person doesn't exist. Please add" or something along those lines.

Instead, I got:
When you search for a person in the dropdown and that person doesn't exist, the dropdown says, "No person can be associated to Hana Yori Dango Final (movie type)"

#1396051

Hi,

Thank you for waiting.

During troubleshooting, I noticed that the no-match found message is added in a localization/translation friendly way.

This means that it can be customized using the "gettext" filter:
https://developer.wordpress.org/reference/hooks/gettext/

Example:


add_filter( 'gettext', 'customize_no_match_found_label', 20, 3 );
function customize_no_match_found_label( $translated_text, $text, $domain ) {
	if($translated_text == 'No %POST_TYPE_LABEL% can be associated to %OTHER_POST_TITLE%') {
		// assign a different message
		$translated_text = 'No %POST_TYPE_LABEL% found with this title, which can be associated to %OTHER_POST_TITLE%';
	}
	return $translated_text;
}

The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through active theme's "functions.php" file.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1397015

My issue is resolved now. Thank you!