I have a Drupal 7 setup with an internationalized site. The default languages is English but the content is also available in German. However the site focuses on a German audience. As in Drupal you cannot switch the default languages without messing up all string translations, we have a custom language negotiation rule implemented (
hook_language_negotiation_info()) that makes sure if no session or query parameter (like
lang=en) is set, the site is shown in German. So, to make it short: If an user accesses our site like this:
it will be shown in German. Nevertheless Facebooks open graph scraper scraps the site always in English, as it would add programmatically
lang=en to all URLs. How can that be? we have the following language specific meta tags:
<link href="https://www.example.com/node/581?lang=en" rel="alternate" hreflang="en" /> <link href="https://www.example.com/task/581" rel="alternate" hreflang="de" /> <meta property="og:locale" content="de_DE" /> <meta property="og:locale:alternate" content="en_US" />
Does anybody know, what I could do, to convince Facebook open graph scraper to scrape the German version as default?