Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#40656 closed defect (bug) (invalid)

WordPress Facebook integration does not obey locale

Reported by: chrisbashton's profile ChrisBAshton Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8
Component: Embeds Keywords:
Focuses: Cc:


It appears that the Facebook integration uses the location of the server WordPress is running on to determine which locale to request from Facebook, rather than obeying the locale configured in the WordPress settings.


A client site of mine is hosted in Europe, though its language is set to "en_US", verified by calling:

<?php echo get_locale(); ?>

Despite this, when pulling in a Facebook post, the generated embed code uses the "da_DK" locale.


Change History (2)

#1 follow-up: @johnbillion
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

This is probably something you should report to Facebook (good luck), as WordPress is correctly outputting the lang attribute on the html element. Facebook likely uses heuristics to determine if the actual page language is indeed English or not when en_US is used, similar to what Google Chrome does.

This is the unfortunate situation that the web finds itself in when services cannot trust web standards due to incorrect implementations (ie. sites not in US English but still using en_US as the lang).

In your situation you may be able to make use of the og:locale OpenGraph tag to persuade Facebook that your content really is in US English.

#2 in reply to: ↑ 1 @ChrisBAshton
7 years ago

Thanks johnbillion - that makes sense.

Note: See TracTickets for help on using tickets.