covid19-passbook-generator icon indicating copy to clipboard operation
covid19-passbook-generator copied to clipboard

Localization of open graph metadata

Open dlackty opened this issue 2 years ago • 3 comments

When I tried to share the Chinese link to social media, I found the preview of the link is still in English (description and image).

I wonder if we could make these metadata localized? The strings should be easy. If you have the original banner image file, I could help edit it and make it localized too.

dlackty avatar Jan 30 '22 16:01 dlackty

Hey there 👋🏼 Thanks for your first issue. This is an automated message but a real human will handle your issue very shortly.

github-actions[bot] avatar Jan 30 '22 16:01 github-actions[bot]

After digging a bit further, I found out the problem isn't that strings aren't translate but because Facebook follows the canonical eta tag and use the English version metadata instead.

Not sure what is the best practice to translate opengraph metadata for a multi language website. I'll spend some time figuring it out.

dlackty avatar Jan 30 '22 17:01 dlackty

For image i18n, usually it's something made server-side. The picture is rendered "on the fly" using translation strings. I just don't have any server to do so and creating a lambda to do it seems too much work.

I think there's some webservices that could do that, but for a fee obviously 🤷🏻‍♂️

According to Meta documentation and a quick StachOverflow search, if you want to do it you need to implement Meta propriatary mecanism where Meta will request a specific language for a ressource (like the image). https://stackoverflow.com/questions/12201245/facebook-opengraph-crawler-doesnt-send-me-fb-locale

clawfire avatar Feb 13 '22 15:02 clawfire