language parameter of Species API

Hi, SpeciesAPI document http://www.gbif.org/developer/species specifies language parameter of simple get species, i.e. species/{int}. Language parameter is explained at http://www.gbif.org/developer/species#p_language as "default=en or use HTTP header for this", I tried to specify 'de' in HTTP header as Language request property, but it doesn't work. Instead, http://api.gbif.org/v1/species/5231190?language=de works fine. Do I misunderstand the documentation? I also tried languages are not included in vernacular names list http://api.gbif.org/v1/species/5231190/vernacularNames such as http://api.gbif.org/v1/species/5231190?language=ja or zh or kr... I expected empty field for vernacularName or no record returned, but I got English one. It is misleading implementation that one ignorant of the language specified can misundarstand that the language uses the same word with English. I suggest to return null vernacularName if vernacular name of specified language is unavailable. Cheers, James

Hi James, it is correct that we default to english for non existing languages. I agree it might be confusing when you requested sth different and it might be hard to tell what language that name actually represents. We will consider returning null in those cases. As for the http headers Ill take a look and file a bug report. Thanks! Markus On 21 Aug 2014, at 03:26, Nozomi James Ytow <nozomi@biol.tsukuba.ac.jp> wrote:
Hi,
SpeciesAPI document http://www.gbif.org/developer/species specifies language parameter of simple get species, i.e. species/{int}. Language parameter is explained at http://www.gbif.org/developer/species#p_language as "default=en or use HTTP header for this",
I tried to specify 'de' in HTTP header as Language request property, but it doesn't work. Instead, http://api.gbif.org/v1/species/5231190?language=de works fine. Do I misunderstand the documentation?
I also tried languages are not included in vernacular names list http://api.gbif.org/v1/species/5231190/vernacularNames such as http://api.gbif.org/v1/species/5231190?language=ja or zh or kr... I expected empty field for vernacularName or no record returned, but I got English one. It is misleading implementation that one ignorant of the language specified can misundarstand that the language uses the same word with English. I suggest to return null vernacularName if vernacular name of specified language is unavailable.
Cheers, James
_______________________________________________ API-users mailing list API-users@lists.gbif.org http://lists.gbif.org/mailman/listinfo/api-users

Hi James, I can confirm we have a bug requesting the language via http header. I've created a jira for this: http://dev.gbif.org/issues/browse/POR-2411 Thanks! Markus On 21 Aug 2014, at 09:38, Markus Döring <mdoering@gbif.org> wrote:
Hi James, it is correct that we default to english for non existing languages. I agree it might be confusing when you requested sth different and it might be hard to tell what language that name actually represents. We will consider returning null in those cases.
As for the http headers Ill take a look and file a bug report. Thanks!
Markus
On 21 Aug 2014, at 03:26, Nozomi James Ytow <nozomi@biol.tsukuba.ac.jp> wrote:
Hi,
SpeciesAPI document http://www.gbif.org/developer/species specifies language parameter of simple get species, i.e. species/{int}. Language parameter is explained at http://www.gbif.org/developer/species#p_language as "default=en or use HTTP header for this",
I tried to specify 'de' in HTTP header as Language request property, but it doesn't work. Instead, http://api.gbif.org/v1/species/5231190?language=de works fine. Do I misunderstand the documentation?
I also tried languages are not included in vernacular names list http://api.gbif.org/v1/species/5231190/vernacularNames such as http://api.gbif.org/v1/species/5231190?language=ja or zh or kr... I expected empty field for vernacularName or no record returned, but I got English one. It is misleading implementation that one ignorant of the language specified can misundarstand that the language uses the same word with English. I suggest to return null vernacularName if vernacular name of specified language is unavailable.
Cheers, James
_______________________________________________ API-users mailing list API-users@lists.gbif.org http://lists.gbif.org/mailman/listinfo/api-users
_______________________________________________ API-users mailing list API-users@lists.gbif.org http://lists.gbif.org/mailman/listinfo/api-users

Hello Markus, Thanks for the great work on the API. I think there may be problems because of the two ways of specifying the language. Which takes priority if both the HTTP header and the parameter are specified? If the HHTP header is not specified, then according to the HTTP spec: "A request without any Accept-Language header field implies that the user agent will accept any language in response." That doesn't seem consistent with the ability to specify the language as a parameter. Alan

Hi Alan, the original intention is that the GET parameter takes precedence over the http header. Markus On 21 Aug 2014, at 12:33, Alan R Williams <alan.r.williams@manchester.ac.uk> wrote:
Hello Markus,
Thanks for the great work on the API.
I think there may be problems because of the two ways of specifying the language.
Which takes priority if both the HTTP header and the parameter are specified?
If the HHTP header is not specified, then according to the HTTP spec:
"A request without any Accept-Language header field implies that the user agent will accept any language in response."
That doesn't seem consistent with the ability to specify the language as a parameter.
Alan
_______________________________________________ API-users mailing list API-users@lists.gbif.org http://lists.gbif.org/mailman/listinfo/api-users
participants (3)
-
Alan R Williams
-
Markus Döring
-
Nozomi James Ytow