Reputation: 5607
How do you set a specific locale/language when using the PHP API for Twitter, as there doesn't seem to be an option?
I can set a language for the plugins/buttons when using HTML/JavaScript, but I can't see anywhere for a PHP API call. There's nothing in the docs.
E.g. I've looked on https://dev.twitter.com/docs/api/1.1 but there's nothing about setting a language. The responses often include a language, but that's obviously not the same thing.
As an example, when getting info of a user in a PHP API call, Facebook's API will return 'male' or 'homme' if the user's sex is male, depending on if the language is set to English or French (default English).
Of course sometimes you want to always return English in an API call if your programming code relies on testing for 'male' or 'female', but if you're just outputting the exact response of the sex field (e.g. a user profile) then you would want to use the same language as the rest of the site.
Upvotes: 1
Views: 197
Reputation: 2521
Unfortunately this isn't possible with the Twitter API (a member of the Twitter Platform team confirms it here).
The closest Twitter comes to language support is providing support for retrieving tweets in specific languages, as documented here:
https://dev.twitter.com/docs/streaming-apis/parameters#language
Upvotes: 1