fix non-gsm error message

Use `it`/`they` depending on how many different characters you've used
Also don't wrap the message with quotes, as it looks confusing and
potentialy implies that you can't use apostrophes
This commit is contained in:
Leo Hemsted
2017-02-15 16:21:14 +00:00
parent 9046ec3bbc
commit f550699daf
3 changed files with 24 additions and 10 deletions

View File

@@ -58,7 +58,8 @@ class OnlyGSMCharacters:
non_gsm_characters = sorted(list(get_non_gsm_compatible_characters(field.data)))
if non_gsm_characters:
raise ValidationError(
'You cant use {} in text messages. They wont show up properly on everyones phones.'.format(
formatted_list(non_gsm_characters, conjunction='or')
'You cant use {} in text messages. {} wont show up properly on everyones phones.'.format(
formatted_list(non_gsm_characters, conjunction='or', before_each='', after_each=''),
('It' if len(non_gsm_characters) == 1 else 'They')
)
)