4

I inserted fb messenger plugin code in my website. Whenever I am clicking this plugin, the language changes. I am not using VPN. I also checked my IP address and it is located in my country. Even on mobile device, the language changes.

screenshot of facebook messenger plugin on live site

1
  • I'm having this issue with my timeline-plugin as well. The root for this issue must be at Facebook/Meta
    – MZ97
    Jul 14, 2022 at 9:55

4 Answers 4

3

This helped me. I changed URL in SDK code the js.src parameter from:

js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js';

To:

js.src = 'https://connect.facebook.net/en/sdk/xfbml.customerchat.js';

Notice that in the first URL there is /en_US/ and in the second there is only /en/. Now I have Facebook chat in english. Still better than random foreign language. I'm following this thread for better solution.

My code:

  <!-- Load Facebook SDK for JavaScript -->
  <div id="fb-root"></div>
  <script>
    window.fbAsyncInit = function() {
      FB.init({
        xfbml            : true,
        version          : 'v4.0'
      });
    };

    (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 = 'https://connect.facebook.net/en/sdk/xfbml.customerchat.js';
    //js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js';
    fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));</script>


  <!-- Your customer chat code -->

  <div class="fb-customerchat"
    attribution=setup_tool
    page_id="{Your page id}"
    theme_color="{Your theme color}"
    logged_in_greeting="Hi! How can we help you?"
    logged_out_greeting="Hi! How can we help you?">
  </div>
3
  • I don't but it is still not working. I might combined methods suggested above and from other forums. I will try to test methods one by one.
    – jmozzart
    Jul 14, 2022 at 18:19
  • i'll add the code i 'm using
    – TongaLife
    Jul 15, 2022 at 5:16
  • It is working so far. Yesterday's might be the cache. But I'm still observing it for weeks.
    – jmozzart
    Jul 15, 2022 at 16:34
2

Here is my solution

  • Set up a new Chat plugin again, and choose English UK instead of default English us. It worked for me. check this image Click to View
0
2

Their latest Chat Plugin v14 is unstable, switch to an older version. I'm on v6 and there's no language issue.

<!-- Messenger Chat Plugin Code -->
<div id="fb-root"></div>

<!-- Your Chat Plugin code -->
<div id="fb-customer-chat" class="fb-customerchat">
</div>

<script>
    var chatbox = document.getElementById('fb-customer-chat');
    chatbox.setAttribute("page_id", "000000001");
    chatbox.setAttribute("attribution", "biz_inbox");
</script>

<!-- Your SDK code -->
<script>
    window.fbAsyncInit = function() {
    FB.init({
        xfbml            : true,
        version          : 'v6.0' // <----- Change version here
    });
    };

    (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 = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js';
    fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>
1
  • not working anymore.
    – jmozzart
    Jul 12, 2022 at 18:09
0

If the problem is still occurs, you can override the src like this, add ?locale=en_US or any language you like at the end of url

https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js?locale=en_US

Not the answer you're looking for? Browse other questions tagged or ask your own question.