Hi, I need your help, please
Integrity /x-child : Setup-Translation https://theme.co/apex/forum/t/setup-translation/61- Below you’ll see everything we could locate for your search of > “Voici tout ce que nous avons trouvé” Although I think I have followed all the indications, yet very clear to follow, it does not work. An error must have been made, I can not find it.
The files “Voici ce que nous avons trouve-fr_FR.mo” and “Voici ce que nous avons trouve-fr_FR.po” are in / wp-content / themes / x-child / languages
By the way, I found another way on this forum to translate the other items; in functions.php :
// Additional Functions
// =============================================================================
add_action( ‘after_setup_theme’, ‘load_child_language’ );
function load_child_language() {
load_child_theme_textdomain( ‘x’, get_stylesheet_directory() . ‘/languages’ );
}
add_filter( ‘gettext’, ‘replace_search_string’, 20, 3 );
function replace_search_string( $search_text, $text, $domain ) {
if ( $text == ‘Type and Press “enter” to Search’ ) return __( ‘Pour effectuer votre recherche, tapez votre texte et appuyer sur Entrée’, $domain );
else return $search_text;
}
add_filter( ‘gettext’, ‘change_texts’, 20, 3 );
function change_texts( $translated_text, $text, $domain ) {
if ( is_search() ) {
switch ( $translated_text ) {
case 'Nothing to Show Right Now' :
$translated_text = __( 'Désolé, pas de résultats...', '__x__' );
break;
case "It appears whatever you were looking for is no longer here or perhaps wasn't here to begin with. You might want to try starting over from the homepage to see if you can find what you're after from there.":
$translated_text = __( "Une nouvelle recherche ?", '__x__' );
break;
case 'Search Results' :
$translated_text = __( 'Résultats de la recherche...', '__x__' );
break;
}
}
return $translated_text;
Thanks in advance!
