translate / amagama

Web service for implementing a large-scale translation memory
http://amagama.translatehouse.org
GNU General Public License v3.0
90 stars 27 forks source link

Do not return 404 on queries for the same language pair #3210

Open unho opened 8 years ago

unho commented 8 years ago

This comes from https://github.com/translate/pootle/issues/4759.

amaGama currently returns a 404 for queries where the source and target language are the same. See https://github.com/translate/amagama/blob/master/amagama/tmdb.py#L441-L443

It was suggested to return a different HTTP error code, but given that that might trigger error handling on Pootle perhaps it is better to instead return an empty result.

friedelwolff commented 8 years ago

As I recall, my idea was to return something so that clients could know if a certain language pair is unsupported. This way they can (hopefully) stop asking, instead of handling the error with each request. I didn't investigate the error codes, but I guess something else might be just as useful if existing users (Pootle and Virtaal) can handle it just as well.

unho commented 8 years ago

@friedelwolff Would old Virtaal instances be able to handle the scenario where amaGama returns a different HTTP code, or if it returns the message you suggested?