• Resolved 3Lancer

    (@3lancer)


    Hi,

    I have placed the Facebook widget on a high traffic website, while it’s working fine, it sometimes at random changes it’s language from English to another, it will then stay on that new language for a while and over time change back.

    As far as I’m aware the default is English US. I would prefer it to be locked on this if possible and no other options.

    I use WordPress qTranslate plugin and it’s a multiple language site (default: English) – other languages are however listed with the lang code in the URL (for example: domain.com/page > turns to > domain.com/es/page).

    I also use W3 Total Cache for page caching, if that might be affecting it?

    Since the language pages are separate from each other however I don’t see how this can affect it?

    https://wordpress.org/plugins/facebook/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Niall Kennedy

    (@niallkennedy)

    Like Buttons and other widgets are rendered on the page using the Facebook SDK for JavaScript, which loads different text depending on the specified locale. The Facebook plugin for WordPress tries to match the defined WordPress locale returned by get_locale() with the closest match to a Facebook locale.

    Once the Facebook plugin for WordPress has matched a site locale to a Facebook locale it stores the result in the facebook_locale transient. You may override the Facebook locale mapping through the fb_locale filter.

    See Facebook_Loader::set_locale for the relevant code.

    Thread Starter 3Lancer

    (@3lancer)

    Hi Niall, thanks for your quick response. That pretty much makes sense.

    So Facebook is the one caching it for 24 hours, not my end?

    Is there a way to overwrite that Facebook locale from my theme’s functions.php file (adding a filter there to force a selected language or something) rather than editing the plugin files itself which might get updated/replaced?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Why does the FB Widget keep changing languages?’ is closed to new replies.