Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Locale setting not 100% compatible with facebook. #32

Closed
idflood opened this issue Feb 18, 2013 · 1 comment
Closed

Locale setting not 100% compatible with facebook. #32

idflood opened this issue Feb 18, 2013 · 1 comment

Comments

@idflood
Copy link
Contributor

idflood commented Feb 18, 2013

I had an issue with the facebook button not appearing on a french page.

The problem is that the html lang attribute follow the "BCP47" format, and facebook want something like "ISO language and country codes respectively, concatenated by an underscore".

The BCP format concatenate the language and country with a "-" if i'm right. At least, on a french wordpress the language attribute is "fr-FR".

Eventually simply replacing the "-" with an underscore is not really enough. In switzerland for instance there is a french part and the country code is CH. But I tried with "fr_CH" and facebook was still not showing up, changing it to "fr_FR" worked.

So one option would be to add a "data-locale" attribute to the social count container. This is not ideal but would be the most flexible solution.

Another option would be to have a function to convert BCP47 format to facebook format, but it may not be enough for some combination of language and country.

Sources:
https://developer.mozilla.org/en/docs/HTML/Global_attributes#attr-lang
https://developers.facebook.com/docs/internationalization/

edit: I'm not sure "fr-CH" is a valid BCP47 format and fr-FR is most common, so maybe just replacing the "-" with a "_" is a good solution"

@idflood
Copy link
Contributor Author

idflood commented Feb 18, 2013

closing since it's a duplicate of #29

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant