Pro translation doesn't work at all

Hi!

I’ve read tons of topics related to Pro Translation but I couldn’t find a solution to translate 2 phrases:

I’m using Loco Translate. Right now, __x__-pt_BR.po and __x__-pt_BR.mo are located at /wp-content/languages/themes/ but I had already tried the other two options given by Loco Translate.

(I’m not interessed in using WPML.)

Please, could you help me?

Hi @fredericobt,

Thanks for reaching out.

I checked the pot file wp-content\themes\pro\framework\lang\pro.pot and those two words are available there. Could you retranslate it using that template file?

Else, please provide your site’s admin and FTP login credentials in a secure note, I’ll check if those words.

Thanks!

Hi @Rad,

I’ve created a new template for pro.pot in Loco Translate:
Project name: Pro
Text domain: __pro__
File prefix: __pro__
Model File: framework/lang/pro.pot
Domain path: framework/lang

Then I’ve translated the two phrases. __pro__-pt_BR.po and __pro__-pt_BR.mo are located at /wp-content/languages/themes/

It still doesn’t work. I’ve just sent you a secure note.

Regards.

Hi @fredericobt,

The text domain should still __x__ and not __pro__. Please rename __pro__-pt_BR.po and __pro__-pt_BR.mo to

__x__-pt_BR.po __x__-pt_BR.mo

I’ll let you do that first since you have existing language files with the same file names.

Thanks!

Hi again @Rad,

It didn’t work either.

Could you give some more tips?

Thanks!

Hi @fredericobt,

That’s weird, would you mind providing your FTP login credentials? I may need to check it there and test it.

For the meantime, you can also add this code to your child theme’s functions.php with your translation.


add_filter( 'gettext', 'change_language_string', 20, 3 );

function change_language_string( $translated_text, $text, $domain ) {

        switch ( $translated_text ) {

            case 'Your Items' :

                $translated_text = 'Your translation here';

                break;

            case 'Apply Coupon' :

                $translated_text = 'Your translation here';
                
                break;
        }


    return $translated_text;
}

Thanks!

Very wierd, @Rad!

This is the first time I cannot translate a website.

Even your function didn’t work!

FTP credentials inside secure note.

Hi @fredericobt,

Yes, no matter what I did to language files, it’s not taking effect. Perhaps it’s a cache issue. But the code that I add partially works. Then I change the cart text through header builder.

Should be translated now.

Thanks!

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