Sunday 20 March 2011

Facebook graph API: locale dependent user info

Sometimes it is necessary to get the data that are already translated to certain language. For example it can be fields such as gender, relationship status, etc. By default, these fields are translated to language that is set in user profile.

The new graph api allows to pass the parameter that points to the language in which the data should be translated.

The example shows how to get my friends info in necessary locale (currently in Danish):
$myFriends = $facebook->api('/me/friends?fields=gender,location,
relationship_status&locale=da_DK');
So, looks simple.

3 comments:

  1. Definitely a great post. Hats off to you! The information that you have provided is very helpful. Thanks! :)

    facebook applications developers

    ReplyDelete
  2. Use this link to find your answer the answer on this post is 100% tested and you will get definitely the solution of your problem....


    http://howtoblogr.blogspot.com/2013/10/getting-facebook-friends-by-gender.html

    ReplyDelete
  3. Thank you for such a sweet tutorial - all this time later, I've found it and love the end result. I appreciate the time you spent sharing your skills.

    supersmashflash2s.com

    ReplyDelete