Online Book Reader

Home Category

Facebook Cookbook - Jay Goldman [95]

By Root 603 0

A few things to note about fb-intl and its children:

The fb:intl tag that wraps the whole block makes this text translatable.

The optional desc in the fb:intl tag provides context to the translators so they understand what they’re translating.

Wrapping part of the text in curly braces—{ and }—turns it into a token that can then be defined using the fb:intl-token tag. This is important because it helps translators know what they need to translate and what they don’t. In this case, we’re assuming that the Pan Galactic Gargle Blaster is truly pan-galactic and therefore doesn’t need to be translated.

Facebook will automatically turn the fb:name tag into a second token when presenting this phrase to translators: “Share a {drink} with {name}?”

You’ll need to load the FBML pages containing translation tags once before they appear in the Translations app (i.e., go through your site after adding tags so other people see the phrases).

The other main set of Translations tags have to do with translating HTML tags with attributes and content. Consider the following:

Setting that same block up for translation considerably increases the amount of code but is still far less work than trying to translate it all on your own:

share_drink

share_something

You've shared {numDrinks} drinks.

10

Share a {drink} with ?

Pan Galactic Gargle Blaster

A brief explanation:

The fb:attr tag contains an attribute of the enclosing fb:tag, in this case the id, class, and title for the div.

fb:attr tags can contain fb:intl tags in order to make those attributes translatable, as per the title shown in the example.

Once you’ve wrapped your tags and been back through your app, you can keep tabs on translation progress inside the Translations app itself. All of your apps have their own Application Admin Panel, which you’ll find at the URL http://www.new.facebook.com/translations/admin/dashboard.php?app=12345 (where 12345 is your app’s ID, not the API key).

Discussion


Translating, localizing, globalizing, and internationalizing might well be considered swear words if you’ve previously gone through any of those processes. Although the end result is fantastic, the journey to get to a multilingual website or web app is often a torturous, bumpy, and highly repetitive process.

Trust Facebook to save the day! When faced with the enormous task of translating their site into lots and lots of languages, the Facebook team built an extremely clever crowdsourcing application that lets their members do all of the hard work (a task they took to in droves). For every page on Facebook, members have the ability to translate any string into a different language, which is then voted on by other Translations users. So far, in the French translation of the Facebook site itself, 9,437 translators have submitted 65,887 translations.

The Translations app presents users with a list of phrases that need to be translated, like the page shown in Figure 6-62.

Figure 6-62. Translations list

Clicking on the Translate link next to a phrase opens a contextual dialog to enter your translation, as shown in Figure 6-63.

Figure 6-63. Submit a translation (mediocre French translation courtesy of Google Translate)

For incomplete languages, such as Georgian, you can get a sense of how much work is left on the Translations home page (after you’ve picked it as your language); see Figure 6-64.

Figure 6-64. Translating

Return Main Page Previous Page Next Page

®Online Book Reader