Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added new route to the project: GET /:name/:language
This solves the second item of this issue: #198
This pull request was made before and some changes were requested (#217):
I feel like this route should only return a string, I don't see the point of returning the name and the language.
It should also find translations of aliases, for example: http://localhost:3000/david finds dave, which is an alias of david, but http://localhost:3000/david/deu doesn't find the German translation of dave, and I feel like it should.
As I commented in Add features to the API #198, I'd want the API to be able to recognize both language codes and language names, so I except http://localhost:3000/daniel/Arabic to work as well as http://localhost:3000/daniel/ara
The first one was solved, however the other two weren't.
About the second change requested, I got a bit confused when I read it again. Because aliases don't have translations only the real name, I want to know if a request to /dave/deu should return the translation to
david
About the third change requested, I want to know were should I get the full name of a language that I only have the short name of it. Looking on the database I found these tables: 'Meanings', 'Translations' and 'Aliases'. But I did not find in any of those the information to look for a relation of languages and their shortnames.