Skip to content
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

Better character limit message #5090

Closed
polsvoice opened this issue Jul 27, 2014 · 5 comments
Closed

Better character limit message #5090

polsvoice opened this issue Jul 27, 2014 · 5 comments

Comments

@polsvoice
Copy link
Contributor

I don't know what the character limit on posts is, but I know there is one. I was testing for large posts, so I went to lipsum.com, generated a 200-paragraph lipsum, and tried to post it. It wouldn't post, and the error I got was "Failed to post message!"

I think that there should be a more descriptive error message for this kind of thing. Maybe tell the user why it failed and what the character limit is?

@goobertron
Copy link

The character limit for posts in Diaspora is 65,535 – see https://diasporafoundation.org/getting_started/sharing

For some reason the character count has disappeared from the publisher. It would be good to add this back, so that someone writing a long post can see live how close to the character limit they are getting, or will get a warning when they paste in a text which is too long (rather than when or after they try posting it).

On a related note, I've just noticed when testing this that the counter when cross-posting to Facebook starts at 40000, even though the limit for Facebook posts is 63,206 characters (and MAX_CHARACTERS is set to this figure in app/models/services/facebook.rb). It might be the same but which is causing that discrepancy and preventing the character countdown for appearing when no external services have been enabled.

@goobertron
Copy link

OK, line 13 of /app/models/status_message.rb states that when the character limit is exceeded, the string 'status_messages.too_long' should be displayed, but looking at line 1150 of /config/locales/diaspora/en.yml, that string is broken into three subsections: zero, one and other. I'm not sure why this is the case, because that's usually done where pluralisation matters, but here it doesn't, because the text reads "please make your status messages less than %{count} characters" rather than "please shorten your status message by %{count} characters".

It could be that putting the text in 'status_messages.too_long' rather than in the subsections will display this message.

By the way, if someone fixes this, please also correct the English in the string text, because there are several errors: 'your status messages' should be 'your status message' (because we're only talking about the current message); the text in the one subsection ends with 'character', rather than 'characters', and it should be 'fewer than %{count} characters', not 'less than %{count} characters'.

The correct English for this string is: "please make your status message fewer than %{count} characters", although I would probably express this message in a different way, given the choice. I think I'd say something like "status messages can be no longer than 65,535 characters". If %{count} here = the length of the post minus 65,535, it could read "The limit for status messages is 65,535 characters. Your message is %{count} characters too long"

@MrFrety
Copy link
Contributor

MrFrety commented Aug 1, 2014

https://github.com/diaspora/diaspora/blob/develop/app/models/status_message.rb#L13
Maybe this line should be in the parent class post?

@MrFrety
Copy link
Contributor

MrFrety commented Aug 1, 2014

Of course, it would have rather something like the string 'post to long' in it then...

@MrFrety
Copy link
Contributor

MrFrety commented Aug 1, 2014

@jhass jhass added this to the next-major milestone Aug 25, 2014
@jhass jhass closed this as completed Aug 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants