tl_PH foreign language in my Facebook comments section

Posted in: Newspaper
Post count: 436

So, I have setup Facebook comments plugin to comment using Facebook. But it’s default language is displaying t1_PH, when checked on Facebook. This is Tagalog – PHILIPPINES (PH) language. In my consciousness, I have never setup this language. I also checked the Language setting on Facebook, and it’s set to English.

Here is the related javascript that loads under my header:

<script id="facebook-jssdk" src="//connect.facebook.net/tl_PH/sdk.js#xfbml=1&version=v2.3"></script>

I have checked and tried disabling all other plugins but couldn’t find the origin of this JS. Does Newspaper theme load Facebook API JS on our site? If yes, how can I check if somehow the language has been changed there?

What might be causing this issue otherwise? Kindly try to help me with this.

Link to check : https:/// tomatoheart . com/webjockey/dhinchak-pooja-dilon-ka-shooter/
Thank you.

Post count: 22421

Hi,

Sorry but the language change does not come from the theme. How did you implement the facebook comments? I posted a tutorial on how to do it a while back:
https://forum.tagdiv.com/topic/facebook-comments-2/ which should still work in the current version of the theme.

Thanks.

Post count: 436

Hi Bogdan,

I use ‘Easy Social Sharing plugin’ to display FB comments currently and have used the method you have described above too in the past, but the issue remained same.

Actually, I again checked by simply deactivating all the plugins and running default Newspaper theme only, it still loads the <script id=”facebook-jssdk” src=”//connect.facebook.net/tl_PH/sdk.js#xfbml=1&version=v2.3″></script> when checked under Google Chrome inspect elements.

So, it’s sure that it’s coming from theme but it’s also quite clear since you guys hasn’t included anything like this, it might externally have been embedded somewhere which I am not sure how.

It appears on pages where there is some Facebook post embed etc. is there. You know that now we only need to insert links to embed Facebook posts, images etc. We no more need to write an embed code here. So, it might be possible that the default wordpress code has been changed. How this facebook embed works? Does the Facebook API part of WordPress core files or the newspaper theme.

If you can help me understand the location of the default Facebook API, it might give me a direction to search for it.

What I see is this JS currently under the head section. If you need login access to inspect around, kindly let me know.

Thank you.

Post count: 436

Hi Bogdan again,

I continued researching about this. In fact, it has been experienced by various other WordPress users as well and it has nothing to do with any WordPress themes or plugins.

There is some issue with WordPress core files which has codes for Facebook integrations. Few such problems reported are:

https://stackoverflow.com/questions/41550989/wordpress-loading-wrong-language-for-facebook-sdk

https://wordpress.org/support/topic/wrong-language-appearing-in-facebook-embeds/

The current solution which worked for me as well is to add following code at the end of functions.php


add_filter( 'the_content', 'facebook_sdk_replace' );
function facebook_sdk_replace( $content ) {
    if ( is_single() ) {
        $content = str_replace("/tl_PH/", "/en_US/", $content);
    }
    return $content;
}

Anyways, thanks for looking at this.

Regards,

  • This reply was modified 9 years by Nano.
Post count: 22421

Hello,
The script in question is NOT coming from the theme. Please check our demo: view-source:https://demo.tagdiv.com/newspaper/ and you will see no such script coming from the header. It is a custom implementation on your end that causes the language issue most likely.
Here are the places Facebook is used in our theme:
The Facebook featured video: https://www.screencast.com/t/sfY71O3of
and the post sharing: https://www.screencast.com/t/BCljTAO0
js: https://www.screencast.com/t/vzmwCRhQ
And the social counter plugin files as well.
But neither of these generate the mentioned string or header code.

Thanks.

Post count: 436

Hi Bogdan,
It appears that you missed my above-written comments.

Anyways, thanks for clearing out everything 🙂

Regards.

  • This reply was modified 9 years by Nano.
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.