Tuesday, February 7, 2012
Pairing Tour: Day 4
Today I had the opportunity to spend the day with Dave Moore on some client work. We were able to work on a few interesting stories throughout the day. Dave is currently on a team that is working on internationalizing a Rails application. I was able to pair with Dave while we tried to internationalize the social media widgets on the site, specifically the Facebook login, button, like button, and login window. This can be accomplished through calls to the FB API. However, we were seeing a very specific bug with Facebook's Api. When we opened the application in a specific language, say German, the Facebook button would render in German, no problem. Also, we could click on the login button and the FB Connect window would show up in German, no problem. Also, once we changed languages on our application, say we switched to French, the buttons would render find in French, all through the FB API, no problem. However, after changing languages in our application, the FB API login window would not change languages with us, even though the FB button was changing languages with us. After some searching we deduced that FB renders it's buttons solely off of the API calls you make to it, which can change on every page refresh. However, it renders it's login window based on the language that was specified when we first logged in, so we would see the window in German even though we had switched to French. We were able to track that FB was storing the locale information that we first gave to it within a cookie on the browser. So, our first instinct was to attempt to mutate the FB cookie every time we changed languages in our application. However, after some searching we found that altering cross domain cookies is not allowed. So, at this point we were essentially stuck. Facebook is going to render the login window based on the first API made to it. I definitely learned a lesson today about 3rd party dependencies. Even though they are extremely convenient at times, they come at a price of freedom. When you use a 3rd party library, you lose the freedom to manipulate every detail, and as I learned today, that can be a high price to pay.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment