Facebook now Loads Specific Locale version of JavaScript SDK automatically

If you have used the JavaScript SDK before, the following code fragment should not be something new to you:

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>

The above code will load the English version of the JavaScript SDK.  As a result, text used by the JavaScript SDK (e.g. when displaying the like button, the FB dialogs) will be in English.

If you are developing an app in other languages (e.g. German, Chinese), you may want to load the corresponding version of JavaScript SDK by changing the “locale” in loading the JavaScript SDK.

To if you want the text strings to be display as according to the user’s language preference in his/her Facebook profile settings, then what you need to do is first look up the user’s locale and load the corresponding version of the JavaScript SDK.

However, Facebook has changed the loading of the JavaScript SDK recently.  No matter which locale you have specified in loading the JavaScript SDK, Facebook will load the corresponding locale version of the JavaScript SDK as according to the currently active user’s language preference.

This sounds to be an enhancement / improvement.  However, personally, I don’t like it.  Even for the simple text “Like” used in the Like button, we all know that for different languages, the length of the text “Like” will be different. Therefore, what I usually do is to design the page layout by using the English version of the JavaScript SDK if I am developing an English application.  And I will design the page layout by using the German version of the JavaScript SDK if I am developing a German application. If a German user access my English app, as the text in my application will be in English, it makes not much  sense to display the “Like” buttons by using German.  And most of all, the layout of the content will be messed up!

As a conclusion, it sounds like Facebook is doing enhancement without reviewing different scenarios… when they see a use case that cannot be handled, they “fix” it.  OK, one issue is fixed but at the same time, other issue(s) arise….. and that breaks existing apps!

This entry was posted in news and tagged . Bookmark the permalink.

One Response to Facebook now Loads Specific Locale version of JavaScript SDK automatically

  1. Pingback: Facebook pushes code changes to production environment without considering the impact | Wing's Blog on Facebook Development & Virtualization

Leave a Reply

Your email address will not be published. Required fields are marked *