New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-English error message? #1702
Comments
The background wrt 255 character limit is outlined a bit here #1593 Outside of that, what were you actually using when you got the message? It doesn't seem to be a string on the website/API nor in iD. |
OSM API from my server side. |
As @simonpoole says that message does not appear anywhere in our code. |
Please reopen. It certainly isn't from my code as I'm not speaking German. |
The message is coming from Rails' translations, which means that the locale is being set to French. This should be set by the client request or user account settings. Is it possible that your user account's default language is set to French, or your browser / HTTP library / web proxy is adding an
Our servers all run with |
Please don't encourage people to use the |
Ooops, sorry. In that case, it would be best to have a complete (except |
If he's logged in then it should be entirely down to the preferred language in his user profile and if not then to the Accept-Language header his browser sends. If there is a bug then it's probably that |
I think the only API methods which allow updating something guarded with a length validation require a logged-in user. Once we have a request and response trace we'll have somewhere to start looking. |
I'll send the entire info once I get home. The call is made from a c# http client. |
I got a different error response just now:
Seems like the error message is changing according to the text I set inside the description? Not sure, in any case when I sent just numbers I got an English error message. |
Right. Old style single object changes like that are quite unusual now. It looks like most api methods never bother calling Mostly it doesn't matter because our own API errors are all in english I think and don't go through the translations but the errors that come from rails itself are getting translated. |
I'm not sure what you mean by old style. Is there a newer way of updating OSM elements from non-OSM server side code (meaning my server)? |
Well most things use changeset diff upload these days rather than the single object change. It probably doesn't make any difference to this issue anyway as I don't think either of them initialises the locale. |
I wonder if we just can't provide our own :too_long message in English instead? Will that work, i.e. not automatically getting translated by i18n anymore? node_tag.rb:
|
That would be a very silly solution. |
Yes, I thought so. Since we want API calls to return messages in English only, could we add something like set_locale_api to the application controller, and set I18n.locale to en_GB:en or en_US. Next would be adding a call to set_locale_api to node_controller.rb in I've noticed that |
I don't especially want them to return english only. That was just a comment that we have never made any effort to I18n them. |
Side note: I was a bit worried about i18n for api messages, as people might rely in funny ways on them already and it's quite late to introduce them. As an example, this snippet from Potlatch2 parses the original English error messages and extracts values: https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/XMLConnection.as#L330-L365 - any change to those API messages would immediately break error handling in Potlatch2. |
I'm getting the following error message when updating a description using the API with the following error message:
description:he: v: est trop long (pas plus de 255 caractères)
I'm guessing this means that the field can't be more than 255 characters long.
Would be better if it was in English.
Would be super if I could add a description to a point that has more than 255 characters...
The text was updated successfully, but these errors were encountered: