Answer the question
In order to leave comments, you need to log in
Getting localized city and country name on Facebook?
Hello.
It is necessary to get the name of the city where the user lives in a localized form.
To get the city I use the following url:
<a href="https://graph.facebook.com/">graph.facebook.com/</a><id_юзера>?locale=ru_RU&access_token=<access_token>&fields=location
{<br/>
"location": {<br/>
"id": "112313418795468",<br/>
"name": "Donetsk, Ukraine"<br/>
},<br/>
"id": "100000407160933"<br/>
}
Answer the question
In order to leave comments, you need to log in
Try adding locale=ru_RU to the request:
graph.facebook.com/19292868552 - displays category
in English
graph.facebook.com/19292868552&locale=ru_RU - displays category in Russian
should roll.
It seems that so far FB does not provide such an option in its API. The first thing that comes to mind from workarounds (stupidly, but since there are no other options): make a request of the form
api.facebook.com/method/pages.getinfo?fields=page_url&page_ids=112313418795468&access_token=...&format=json
where page_ids is the id of the received locations (instead of this request, you can at least use Graph, at least FQL, it doesn’t matter - I think the point is clear: find a page with the desired id), and then parse the page at the specified page_url (take the value of the title tag, for example).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question