Closed phalt closed 8 years ago
hi! I'm interested in this
what I thought would be best is an eg. locale
object in each resource, something a little like this:
http://pokeapi.co/api/v1/pokemon/162/
{
"name": "Furret",
[...]
"locale": {
"Japanese": "オオタチ",
"Official roomaji": "Ootachi",
"Korean": "다꼬리",
"Chinese": "大尾立",
"French": "Fouinar",
"German": "Wiesenior",
"Spanish": "Furret",
"Italian": "Furret"
}
}
the language names are as they are defined by veekun: https://github.com/veekun/pokedex/blob/master/pokedex/data/csv/language_names.csv
is this okay?
Nice. Thanks for this @bui. We've done something similar to this so far in v2.
{
"id": 162,
"name": "furret",
...
"names": [{
"name": "Furret",
"language": {
"name": "en",
"url": "http://localhost:8000/api/v2/language/9/"
}
}, {
"name": "Wiesenior",
"language": {
"name": "de",
"url": "http://localhost:8000/api/v2/language/6/"
}
}, {
"name": "Fouinar",
"language": {
"name": "fr",
"url": "http://localhost:8000/api/v2/language/5/"
}
}],
}
With the way the api is structured this is the cleanest way I was able to see organizing names. I've been thinking about possibly allowing a user to limit their returns (maybe they don't want every language). Not totally sure yet if that's something anyone would be concerned with though. Have any thoughts on whats going on here?
@zaneadix that does look good! but what would be the purpose of those language resource URLs? and where do the language codes come from?
@bui Language will be a new resource. By codes I think you mean the short names like "fr" for "French"?
They come from the languages data in the Veekun database. https://github.com/veekun/pokedex/blob/master/pokedex/data/csv/languages.csv The data here matches to the Language Names data that you referenced above which will be accessible from one of the Language resources. For instance if you were to follow the url for "Fouinar", The French name of Furret you would find the Language resource something like the one below
{
"id": 5,
"name": "fr",
...
"names": [{
"name": "フランス語",
"language": {
"name": "ja",
"url": "http://localhost:8000/api/v2/language/1/"
}
}, {
"name": "Französisch",
"language": {
"name": "de",
"url": "http://localhost:8000/api/v2/language/6/"
}
}, {
"name": "French",
"language": {
"name": "en",
"url": "http://localhost:8000/api/v2/language/9/"
}
}]
}
Veekun's has done a pretty extraordinary job getting really deep with the data. I'm hoping that the api will create some sort of wave of people contributing to their data set so we can keep making the api a greater tool.
that makes the most sense, yeah looks good to me!
Have you considered evaluating the Accept-Language
header? If it's sent, you could only return the name of the pokemon and moves in the given language, otherwise provide all languages as drafted above.
Sorry to reopen this, but it seems that pokemon names are not translated, any idea on when this will be implemented ?
They are translated. Check the names
field on pokemon-species
.
@sargunster found it, thanks a lot !
Hello i have a repository and dont know how change the data language of pokeapi in my job. https://github.com/Pathsofpain97/SpanishPokedex.github.io
Currently no ETA, but we'd like to add multi language support