简体   繁体   English

Facebook Graph API性别

[英]Facebook Graph API Gender

Hi I have problem with Facebook Graph API. 嗨,我对Facebook Graph API有问题。 I'm using it in cordova with this plugin: https://github.com/jeduan/cordova-plugin-facebook4 (I think is not important) 我在此插件中使用了科尔多瓦: https : //github.com/jeduan/cordova-plugin-facebook4 (我认为并不重要)

The main problem is value gender. 主要问题是价值性别。 When system language is English I get following value: 当系统语言是英语时,我得到以下值:

gender: "male"

but when my system language is Czech I get following value: 但是当我的系统语言是捷克语时,我会得到以下值:

gender: "muž"

and this is problem for me because I expecting for future work "male" or "female" 这对我来说是个问题,因为我期望未来的工作是“男性”或“女性”

does anyone now how to figure it out and get always english? 有人现在如何弄清楚并始终保持英语水平吗?

Thanks for any answer 谢谢你的回答

You just have to add the locale to the API call, it would be like this for english: 您只需将语言环境添加到API调用中,对于英语来说就是这样:

/me?fields=gender&locale=en_US

Or with the Cordova plugin: 或使用Cordova插件:

facebookConnectPlugin.api('/me?fields=gender&locale=en_US', ...)

See this for more information about how to use the Graph API. 请参见有关如何使用图形API的更多信息。 Written under "Modifying API Requests": 写在“修改API请求”下:

locale 地区
Used if your app needs the ability to retrieve localized content in the language of a particular locale (when available). 如果您的应用需要以特定语言环境的语言检索本地化内容的功能(如果可用),则使用此选项。

So try to set the locale parameter to english. 因此,尝试将locale参数locale为english。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM