Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 591701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:39:43+00:00 2026-05-13T15:39:43+00:00

Situation: my facebook application ( http://apps.facebook.com/mymagicmirror/ ) needed to detect user’s gender, and then

  • 0

Situation:

my facebook application ( http://apps.facebook.com/mymagicmirror/ ) needed to detect user’s gender, and then query opposite sex or male or female

FQL:

SELECT uid, name, pic, sex FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$user_id.') and sex='male'

Problem:
When the facebook user is using other locale, then the ‘sex’ field doesn’t match ‘male’ and ‘female’ anymore. Instead, say in Chinese, the sex will become 男性 / 女性, and the FQL for where sex=’male’ will return zero results.

Any solution to query all male / female friends even if the facebook user is having locale other than english?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:39:43+00:00Added an answer on May 13, 2026 at 3:39 pm

    Add one of the following functions to your facebookapi_php5_restlib.php file:

    Function for users.getInfo:
    from: http://forum.developers.facebook.com/viewtopic.php?pid=166745#p166745

    public function &users_getInfo_en_US($uids, $fields) {
      return $this->call_method('facebook.users.getInfo',
        array('uids' => $uids, 'fields' => $fields, 'locale' => 'en_US'));
    }
    

    Then, you can call users_getInfo_en_US($user, array('sex'));


    Functions for FQL:
    from the link above but with pid=166866#p166866
    One is for the en_US locale (from the post before it) and the other lets you pass in the locale you want to use, like so:

    public function &fql_query_localized($query, $locale) 
    {
      return $this->call_method('facebook.fql.query',
        array('query' => $query, 'locale' => $locale));
    }
    

    Then, just pass in the string 'en_US' for $locale.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Situation: I am developing a facebook canvas app. Facebook is sending my sever a
Situation is simple: I post a plain HTML form with a textarea. Then, in
Situation: 1. Linux TCP server 2 Windows C# client application The server receives messages
Situation is you have to develop an application against an Active Directory Tree. Want
I've been asked to develop a facebook application that allows users of their current
Situation: I am running my website on wordpress. I have installed the Simple Facebook
I am thinking of tying in a Facebook JavaScript-based application with an existing website
When building a Facebook tab application the first page receives the signed request, my
I would like to integrate Facebook into an iOS application I am building, however
I 'm creating FaceBook like application and everything is centered around Person model. Status,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.