Skip to Main Content
Facebook Cookbook
book

Facebook Cookbook

by Jay Goldman
October 2008
Intermediate to advanced content levelIntermediate to advanced
434 pages
12h 7m
English
O'Reilly Media, Inc.
Content preview from Facebook Cookbook

Translations

Problem

I’d like to be able to offer my application in other languages, but I only speak and write English.

Solution

Facebook has made their amazing Translations app available to all developers. When added to your FBML, the following family of tags represents the Translations capability on your pages:

fb:intl

Wrap content you want to make translatable in this tag.

fb:intl-token

Replaces a token contained within an fb:intl tag with its content.

fb:tag

Renders an HTML tag that has translatable attributes.

fb:tag-attribute

Contains the translatable attributes of an HTML tag specified by the enclosing fb:tag tag.

fb:tag-body

Contains the contents of an HTML tag specified by an enclosing fb:tag.

fb:date

Renders a locale-specific date based on the settings of the viewing user.

fb:fbml-attribute

Contains and makes translatable the value of an attribute of an FBML tag.

The Translations app isn’t intended to provide translations for user-generated content within your application (which you hopefully have if you’ve built a good Facebook app), but rather for all of your static text (application description, About Page content, etc.), FBML content, Notifications, requests, and Feed stories.

Using the tags is quite simple and will become second nature as you write new FBML. Assuming you haven’t built a gargantuan app with hundreds of pages, you should be able to go back and retrofit the Translations tags fairly quickly. As an example, consider this FBML:

Share a Pan Galactic Gargle Blaster with <fb:name ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning PHP 5.3

Beginning PHP 5.3

Matt Doyle
HTML5 Geolocation

HTML5 Geolocation

Anthony T. Holdener

Publisher Resources

ISBN: 9780596156695Errata