Open Graph Localization - facebook

Is it possible to localize objects in Facebook's OpenGraph?
My specific goal is having French/English users able to like the same URL or Graph object, while having local-specific descriptions appear in their timelines. So far the only way I can achieve this is having two separate graph nodes, effectively dividing the number of likes in half.
I've attempted to provide English and French versions of my page, with the French version using the English page's URL as its canonical URL, but this results in the French user's having the English page's title/description appear in their timeline.
Is there any way of having both French and English versions of the page while having one shared "like" count?

The detailed docs you want are here:
https://developers.facebook.com/docs/beta/opengraph/internationalization/
In short, you'll want to provide a primary locale in the og:locale tag, and then alternate locales in the og:locale:alternate tag. For each alternate locale, the FB scraper will rescrape the page, but pass in the alternate locale in the fb_locale query string parameter. You should take this query string parameter and provide the appropriate locale-specific meta data.

Related

Localization with Facebook Share for website

I have a website that supports few languages. Page detects and displays respective language based on browser settings (user can select desired language too).
Now id like to share this website with Facebook share.
According to Fb documentation i need to set a number of meta fields for needed language.
How can i detect a language Facebook is trying to scrape my website for? I was trying to use query`s fb_locale parameter, but it does not seem to pass this one with needed language.
Any ideas?
According to Fb documentation i need to set a number of meta fields for needed language.
This was never available for normal posts/shares in the first place, only for Open Graph stories - and for those it has been removed with API version 2.8, too.
https://developers.facebook.com/docs/apps/changelog#v2_8_deprecations
There is no way any more to do what you want.

How to localise Facebook Objects and Actions

Apologies if this has already been asked or if this is a dumb question, but I can't seem to figure out how to localise OG actions and objects and the Facebook documentation has defeated me (again).
Scenario:
I have a single OG action called Like (the same action that FB creates automatically for apps that use the Like button).
I also have two objects: post and comment.
Stories are created by my app along the lines of "{name} likes a post on {app name}". In the activity panel they appear as "{name} likes {title} on {app name}". Note i do not have any OG Stories defined - I'm simply publishing the Like action along with one of the two objects I have created.
What I'm struggling to figure out is, how to localise the "likes a post on" and "likes" part of the stories being published to a user's timeline.
I am already generating the appropriate locale and locale:alternate OG meta tags that the FB scraper uses to build the stories. The two locales I support are en_GB and ar_AR and for the ar_AR locale I also include localised title and description meta tags.
When I publish a story for a test user with the AR locale selected, the story includes the localised title and description text in Arabic however the "likes a post on" and "likes" text is still in English. I've checked the localisation app in Facebook and there are no strings appearing to localise, whilst the localisation section within the app settings only provides areas for the app title and description and locale specific images.
Does anyone out there have any insight in to how I can localise the "likes a post on" and "likes" associated with the publishing of the Like action?
Thanks in advance!

how to get the locale of a facebook user clicking on a localised object's link?

I'm about to implement open graph localised objects.
I have configured the og:locale:alternate meta tags, and, when a Facebook crawler request comes in, the correct locale is returned. As a result, I have one object per product (like counter is not divided), and the texts are correctly displayed on the wall posts, according to the user's locale setting.
If I look my own share, I see some Facebook URL parameters appended to the URL, but if someone shares my post, even these parameters are removed, leaving only the canonical URL. The canonical URL however does not contain any locale/language parameters, as these should be defined only by the og:locale tags which is OK for the posts.
But the problem is, that I am unable to find out the current user's locale (the person who actually clicked on the link) from these links.
I'm stuck here, because there's no locale, nor fb_locale parameters in the URL, nor the X-Facebook-locale header is sent. My app runs on an external site (not in canvas or tab) so the PHP SDK's getUser() and getSignedRequest() are not working either. I only have a Facebook cookie named locale.
Shouldn't Facebook append at least a locale/fb_locale parameter to the URL in this case?
Since I only need the locale (which is, I think, completely harmless), I don't want to ask the first-time visitors for their permission to only get their locale. That would be, in fact ridiculous, as they are following a link that they already had in their language.
I don't have any idea to solve this issue.
Thanks in advance if you have any ideas.

Localizing Facebook "scrapes"

We're running a canvas app that has fully localized og tags. Everything is working well except when users choose to manually copy the facebook app url (apps.facebook.com/mysite) into a post.
When that happens, we want the text in the posted message to be in the user's language. Instead, it's always uses the English text from the og: meta tags.
If I could detect which culture the user came from, I could change those meta tags. However I don't see anything in the request header or parameters that are sent from the scraper to indicate where the user is coming from.
I did see that there's an og:locale:alternate tag I could use to specify other languages the page is available in, but unless I get a second request from Facebook with a locale value I don't see how that benefits me.
How can I ensure the posted title/description is in the user's language?
Must it be done using the Localization section in the Facebook App settings?
If so, is there a way to automate it? Our translation workflow is pretty well established and I don't want to send translators into the facebook app to finish the job.
You most probably need some parameter in the querystring to differentiate the urls.
e.g
http://apps.facebook.com/my_app/en/
or
http://apps.facebook.com/my_app/it/
this parameter will actually set the active language on your app.
And facebook scraper will cache the localized title/ description from the meta tags.

How to access the facebook smart list?

I wanted my application to post a status on users wall which should be seen only by the persons in that locale? How is it possible to restrict it in facebook apis?
The documentation for a Post has a detailed list of all fields, one of them is the "privacy" which controls who will see the post, it says:
object containing the value field and optional friends, networks,
allow, deny and description fields. .... The description field may
contain a comma-separated lists of valid country, city and language if
a Page's post targeting by location/language is specified.
I recommend that you go and check it out since it has much more text written on this field.