Search Pokemon with other language
We/I have the Problem that the Api only uses english (I think) names for the endpoints of "api/v2/pokemon/{name}/" but I (and others in a chat where I use the API) only learned the german names. Is there a way to call the API with german names or to "auto-translate" it correct?
No, that functionality doesn't exist. Your best bet is to call by id instead. The full object contains translated names.
On Fri, Jul 15, 2016, 3:50 PM Marcel [email protected] wrote:
We/I have the Problem that the Api only uses english (I think) names for the endpoints of "api/v2/pokemon/{name}/" but I (and others in a chat where I use the API) only learned the german names. Is there a way to call the API with german names or to "auto-translate" it correct?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PokeAPI/pokeapi/issues/235, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQlpbKWitG9mbtMPv3r0Kr7FG0-W_Rvks5qV-SZgaJpZM4JNuny .
And is there a file where these translations are belongside the english ones? I have as idea that I could use the german names and "translate" it to an id or where do you get the translations from?
https://github.com/PokeAPI/pokeapi/blob/master/data/v2/csv/pokemon_species_names.csv
I believe German is language id 6.
Ok than I write and thingy that searches the german name in that file and gets that ID. If you want you can close the issue :)
I've made the proposal #236 to cover use cases like this. Go ahead and follow that if you're interested.
@MTRNord # könntest du mir das mal erklären wie das funktioniert die Pokemon und den Pokedex auf Deutsch einzustellen? Ich verstehe die Computersprache nicht so wirklich. Das einzige was ich bis jetzt geschafft habe ist das man nun die Texte auf dDeutsch hat wenn man es gefangen hat ect.
@MTRNord did you come up with something?
@MTRNord did you come up with something?
I don't even remember having opened this issue 6 years ago :D so I also don't remember where I used it or how I used it. Sorry 😅
@MTRNord all good :) the api is kinda frustrating tho not offering proper language support :(
@Davidwalser here you go:
query searchForPokemonInGerman {
pokemon_v2_pokemonspecies(
where: {
pokemon_v2_pokemonspeciesnames: {
pokemon_v2_language: { name: { _eq: "de" } }
name: { _regex: "Ento.*" }
}
}
) {
pokemon_v2_pokemonspeciesnames(
where: { pokemon_v2_language: { name: { _eq: "de" } } }
) {
name
}
id
}
}
I used GraphQL. If you want you can insert two variables (language_name and pokemon_name_in_the_specified_language) and use the native GQL functionality to form a GQL query. Or use the above and substitute "de" with your language and "Ento* with your pokemon name.
Btw, Enton and Entoron are Psyduck and Golduck in German.