Twitter Languages


#1

I am currently getting the following error: “Couldn’t find TwitterLanguage with ‘code’=ca”

I can get around this by checking to see if it exists, but my question is why does this language code of “ca” not get returned when I use the “/1.1/help/languages.json” api call.

I currently use that api call to populate a table in my database so that I am able to get the actual name of the language of the user without having to hit the api every time and prevent rate limiting, but in this case it is not working out because “ca” is not being returned by that call.

Thank you for your help in advance,
Kevin Horvath


#2

Sorry for the inconvenience here!

Twitter’s language options does not change frequently, so I might suggest making a CRON job that populates that table nightly. If you need help implementing such a thing, let me know!

We currently don’t support ‘ca’ as-is, but here’s the list we do support, as of the writing of this post:

[
{
“code”: “fr”,
“name”: “French”,
“status”: “production”
},
{
“code”: “en”,
“name”: “English”,
“status”: “production”
},
{
“code”: “ar”,
“name”: “Arabic”,
“status”: “production”
},
{
“code”: “ja”,
“name”: “Japanese”,
“status”: “production”
},
{
“code”: “es”,
“name”: “Spanish”,
“status”: “production”
},
{
“code”: “de”,
“name”: “German”,
“status”: “production”
},
{
“code”: “it”,
“name”: “Italian”,
“status”: “production”
},
{
“code”: “id”,
“name”: “Indonesian”,
“status”: “production”
},
{
“code”: “pt”,
“name”: “Portuguese”,
“status”: “production”
},
{
“code”: “ko”,
“name”: “Korean”,
“status”: “production”
},
{
“code”: “tr”,
“name”: “Turkish”,
“status”: “production”
},
{
“code”: “ru”,
“name”: “Russian”,
“status”: “production”
},
{
“code”: “nl”,
“name”: “Dutch”,
“status”: “production”
},
{
“code”: “fil”,
“name”: “Filipino”,
“status”: “production”
},
{
“code”: “msa”,
“name”: “Malay”,
“status”: “production”
},
{
“code”: “zh-tw”,
“name”: “Traditional Chinese”,
“status”: “production”
},
{
“code”: “zh-cn”,
“name”: “Simplified Chinese”,
“status”: “production”
},
{
“code”: “hi”,
“name”: “Hindi”,
“status”: “production”
},
{
“code”: “no”,
“name”: “Norwegian”,
“status”: “production”
},
{
“code”: “sv”,
“name”: “Swedish”,
“status”: “production”
},
{
“code”: “fi”,
“name”: “Finnish”,
“status”: “production”
},
{
“code”: “da”,
“name”: “Danish”,
“status”: “production”
},
{
“code”: “pl”,
“name”: “Polish”,
“status”: “production”
},
{
“code”: “hu”,
“name”: “Hungarian”,
“status”: “production”
},
{
“code”: “fa”,
“name”: “Persian”,
“status”: “production”
},
{
“code”: “he”,
“name”: “Hebrew”,
“status”: “production”
},
{
“code”: “th”,
“name”: “Thai”,
“status”: “production”
},
{
“code”: “uk”,
“name”: “Ukrainian”,
“status”: “production”
},
{
“code”: “cs”,
“name”: “Czech”,
“status”: “production”
},
{
“code”: “ro”,
“name”: “Romanian”,
“status”: “production”
},
{
“code”: “en-gb”,
“name”: “British English”,
“status”: “production”
},
{
“code”: “vi”,
“name”: “Vietnamese”,
“status”: “production”
},
{
“code”: “bn”,
“name”: “Bengali”,
“status”: “production”
}
]


#3

Thank you for the response! I do have a CRON job type setup that refreshes a twitter_languages table like you speak of, if you don’t support ‘ca’ then how can the user be coming in with that language code? Can users select languages that are not apart of the supported list?


#4

Can you provide an example of the API call / Tweet object which is returning a language of “ca”? Thanks.


#5

Took a while to find it again, but here it is: id => 364400433, lang => ca. I can provide the screen_name as well, but I didn’t think that would be appropriate. (That is a user_id…)

Thanks.


#6

Oh, and this Wikipedia page, http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes, says that it should be translated to “Catalan, Valencian”.


#7

Thanks so much for this feedback and information. We will look into it!