Translate : Change [x-item(s)]

Hi

I try to translate the things « 0 items » in french but its too complicated to make it by the css (maybe because the word change when it pass to pluriel and take a « s »)

I have tried everything i found and it still not working ?

Can you help me ?

I want to change it for the mobile version and desk version of course.

I took a picture of it :

thanks.

Hi there,

Please add this code to the functions.php file of the child theme:

function alternate_text( $translated_text, $text, $domain ) {
  switch ( $translated_text ) {
    case 'Item' :
      $translated_text = __( 'THE_TRANSLATION_HERE', '__x__' );
      break;
    case 'Items' :
      $translated_text = __( 'THE_TRANSLATION_HERE', '__x__' );
      break;
  }
  return $translated_text;
}
add_filter( 'gettext', 'alternate_text', 20, 3 );

https://theme.co/apex/child-themes

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.