Setup translation- Below you'll see everything

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!

Hey @TCDT53,

Thanks for writing int. Please try removing Voici ce que nous avons trouve- from your .po file. If that doesn’t help, please give us WordPress Admin and FTP access in a Secure Note so we could check your translation setup.

Thanks.

Hi @TCDT53

I tried to access your website dashboard via /wp-admin/ and /wp-login.php but I couldn’t, I believe you have a custom login URL, could you please share it in a secure note?

Thanks.

Hi Alaa,
See Secure note

Hi @TCDT53

This issue should be fixed by now, the problem was that you are using the language Français de Belgique so the file should be renamed to fr-be.mo.

Thanks.

1 Like

It works!

I changed the language from “French from Belgium” to “French” in the general settings, and I created a file via Poedit : fr_ FR.mo

Thank you for following up my request
Have a good day

Glad you were able to resolve it :slight_smile:

1 Like

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