Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Open Graph markup, what's the use of 'og:locale:alternate' without the location (href)?

Tags:

Facebook's Open Graph Protocol markup allows for defining the current web page's locale, and any alternative locales it's also available in, using a markup like this:

<meta property="og:locale" content="en_GB">
<meta property="og:locale:alternate" content="fr_FR">
<meta property="og:locale:alternate" content="es_ES">

The current page's permalink can be easily deduced (from the URL, Canonical URL meta tag, or og:url).

But what's the point of including og:locale:alternate without their respective URLs? How is it at all useful?

like image 894
its_me Avatar asked Dec 29 '13 17:12

its_me


People also ask

What is OG locale?

og:locale – defines the language; American English is the default. og:site_name – if the page (object) you are sharing is part of a larger network. og:audio or og:video – to add additional audio or video files to your object. fb:app_id – for linking to a Facebook application (e.g., FB Comments) with the object.

What are OG tags used for?

Open Graph meta tags are snippets of code that control how URLs are displayed when shared on social media. They're part of Facebook's Open Graph protocol and are also used by other social media sites, including LinkedIn and Twitter (if Twitter Cards are absent).

What is OG image alt?

The og:image:alt is an Open Graph tag meant to accompany the og:image tag. According to the specification, it should provide 'A description of what is in the image'.

Is og URL necessary?

You do not ever need og:url . Instead, use the existing rel=canonical standard to link to your canonical page URL. Facebook's own documentation states they support this [1].


1 Answers

It's clearly stated in the article titled "Internationalizing Open Graph Apps" on the official Facebook Developers blog:

Translating Objects

In order to translate Open Graph objects, two things must happen. The developer must specify which locales are supported by the object through Open Graph meta tags, and the app must return the correct strings in the requested locale. For example, if the object can be translated into French and Spanish, the markup that describes this would look like the following:

<html>
<head>
    <meta property="og:locale:alternate" content="fr_FR" />
    <meta property="og:locale:alternate" content="es_ES" />
    ...
</head>
    ...
</html>

When Facebook needs to render an object in one of the specified locales, we will make a request to the object URL with the fb_locale URL parameter set, e.g. &fb_locale=es_ES. The app should then return the object markup in that specified locale. For more details on translating Open Graph objects, please look at the Open Graph I18N doc.

You can debug issues with translating objects by adding a fb_locale parameter, e.g. fb_locale=es_ES, to the Debugger and entering your object URL. If you change or add locales for a particular object, you can make Facebook re-scrape your object to pick up the changes by adding a scrape=true as described in the Objects section in the I18N documentation.

like image 105
its_me Avatar answered Sep 16 '22 14:09

its_me