Extension - Facebook Comments translation?

Hi there,
how i can translate the extension?
I’ve try’d with Loco Translate but i only get the backend text to translate, think it must be an code"fix" to communicate with the right language to get the right or?

Is there another Plugin are you recommend for using wordpress comment and Facebook side by side without replacing other comment options like the Facebook Comment extension does?
I only found the disqus plugin but their rating is terrible

Regards,

Hi there,

Thanks for posting in.

You should try Disqus comment, plus, the language is based on facebook so you can’t translate it through a plugin.

I checked the Facebook comment plugin and it should change to the correct language since it pulls the locale of your site.

global $locale; $tco_fb_locale = esc_html( $locale ); .. .. .. js.src = "//connect.facebook.net/'.$tco_fb_locale.'/sdk.js";

Maybe your site’s locale is not being set correctly?

Thanks!

Hi @Rad,
i found it out by myself with the auto locale of my site but it seems it don’t work.
My site allready set to german and german time zone…

I also take a plugin-conflict test and deactivate all of my XXXX Plugins but it allready is in english, can you take a closer look please?

Hi there,

I checked and the locale that is pulled is en_US, this issue could be related to your translation plugin and maybe it’s picking up the locale that is set in admin. Unfortunately, I can’t troubleshoot or provide support for the translation plugin. But you may try this temporary fix.

Please edit this file \wp-content\plugins\tco-facebook-comments\functions\output.php through FTP or hosting’s file manager and replace this line

js.src = "//connect.facebook.net/'.$tco_fb_locale.'/sdk.js";

with this

js.src = "//connect.facebook.net/de_DE/sdk.js";

Hope this helps.

So i need to contact the plugin developer?
Where i can find what locale is pulled on?

If the plugin is diabled i must be work in german or?
If i disabled Loco Translate it will not translate with the changed or code or without, dosn’t matter :confused:

mhmhm

Hi there,

It’s built-in to Wordpress, but any plugin could change it. It can’t be deleted since it’s part of WP standard. Unfortunately, I can’t provide any further information as I’m not familiar with the plugin.

Thanks!

Hi @Rad,
I have contact the Developer, can you help me with this to let him take a closer look?

Hi there,

Maybe they said is true, and it will not control your site’s locale, so even if it’s a German page, it will not switch the locale to German and it will remain in English. So instead, let’s add that missing functionality. Please add this code to your child theme’s functions.php

function set_my_locale($locale) {
    return is_admin() ? $locale : 'de_DE';
}
add_filter('locale','set_my_locale',10);  

Thanks!

Hi,
it won’t change anything, sorry :frowning:

Hi there,

In that case, please use the temporary fix by editing the \wp-content\plugins\tco-facebook-comments\functions\output.php. I’ll continue the investigation but I can’t promise any fix since this is 3rd party plugin related.

How did you setup your admin as English while the front is in German? Maybe you could check that too and set your admin back to German.

Thanks!

Dear @Rad,
the temporary fix don’t work and i’ve never changed the backend language, X was/is every time in english on my server in the backend area, doesn’t matter with or without Loco Translate as Plugin or another plugin.

I have thought its every time in english, isn’t it?

I have a alternate WP installation for testing purposes only, w/o any plugin and totally clean and there it is also in english every time i reinstall e.g. :frowning:
My second license from X on my other domain, same server also in english, with and w/o loco translate, every time. Thats why i thougt its normal…because its only X Theme, normal and pro version

Hi there,

It works, but upon checking, you have two facebook embed code, the first one is the one being honored instead of the code from the fb comment plugin.

<meta name="theme-color" content="#40d9f1">
     <script>
          window.fbAsyncInit = function() {
            FB.init({
              appId      : '1588494921235046',
              xfbml      : true,
              version    : 'v2.7'
            });
          };

          (function(d, s, id){
             var js, fjs = d.getElementsByTagName(s)[0];
             if (d.getElementById(id)) {return;}
             js = d.createElement(s); js.id = id;
             js.src = "//connect.facebook.net/en_US/sdk.js";
             fjs.parentNode.insertBefore(js, fjs);
           }(document, 'script', 'facebook-jssdk'));
        </script>

    <meta property="fb:app_id" content="2039111483020619">
    <div id="fb-root"></div>

    <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId   : '2039111483020619',
          xfbml   : true,
          version : 'v2.1'
        });
      };

      (function(d, s, id){
         var js, fjs = d.getElementsByTagName(s)[0];
         if (d.getElementById(id)) {return;}
         js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/de_DE/sdk.js";
         fjs.parentNode.insertBefore(js, fjs);
       }(document, 'script', 'facebook-jssdk'));
    </script>

You need to find where the first is coming from and remove it.

Thanks!

1 Like

Dear @Rad,
again a heartfelt thank you for your help.
Now and with his ii find another conflict with the Envira Gallery Plugin and the X-Theme.

The Social Addon for their Envira Gallery does it:
in: \wp-content\plugins\envira-social\includes\global\shortcode.php at line 265 the bad boy is :smiley:
js.src = "//connect.facebook.net/en_US/sdk.js";

I have changed it to the needed german one
js.src = "//connect.facebook.net/de_DE/sdk.js";

and finally i don’t need to change your plugin and everything is fine and in german language :slight_smile:

How i said, thank you so much for your awesome help.
I will send it also to the Envira Team with my other problems.

Kind Regards :slight_smile:

You’re welcome!

I will forward this to our web development team for review.

Cheers :slight_smile:

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