开发者

Can internationalization through the facebook Translations app be achieved inside an iFrame app, without using deprecated FBML technology?

We've invested some time into using the Translations app for our old-style FBML facebook apps. The creation of FBML apps is now deprecated, and only开发者_开发知识库 iFrame apps can be created. We would like to have translations in them too, and are considering how to use the Translations app to achieve this.

The internationalization page indicates translations are renderable through (deprecated) FBML tags like fb:intl. It also mentions that XFBML tags (the "newer" tag-set parsed by JavaScript) can play a part, however the documentation for the JavaScript FB.XFBML.parse(..) XFBML method doesn't list any XFBML internationalization tags available to be used with it!

In short, I would like to know if we can use the Facebook Translation app for translations inside an iFrame app, without using any deprecated technology?

[The state of facebook, May 2011]


Since we were trying to use these features and they're still not working I just went ahead and wrote a wrapper that will help parse these tags (using intl.getTranslations and intl.uploadNativeStrings in the background).

It's a bit rough but seems to do the job. Would love to see some forks: https://github.com/yeldarby/translation.js


If you are using JavaScript SDK just like this:

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
  FB.init({
    appId  : 'YOUR APP ID',
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml  : true  // parse XFBML
  });
</script>

Then on this line, change the en_US into your language's code:

<script src="http://connect.facebook.net/en_US/all.js"></script>

You may also use FQL (Not to be deprecated by facebook)

http://developers.facebook.com/docs/reference/fql/translation/


The docs indicate that you can do it, but you can't.

The only way you can use the translation app is by calling intl.getTranslations, intl.uploadNativeStrings, or querying the FQL translation table

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜