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

Add thousands comma-seperation in character count messages #2568

Closed
dalepotter opened this issue Mar 9, 2022 · 9 comments · Fixed by #2853 or #2887
Closed

Add thousands comma-seperation in character count messages #2568

dalepotter opened this issue Mar 9, 2022 · 9 comments · Fixed by #2853 or #2887
Assignees
Labels
character count feature request User requests a new feature 🕔 hours A well understood issue which we expect to take less than a day to resolve. localisation
Milestone

Comments

@dalepotter
Copy link
Contributor

Related component

Character count

Context

The current GDS content style guide states:

For numerals over 999 - insert a comma for clarity: 9,000

...however the information/error message (when over 999 characters) does not include comma separation.

Example entering 1200 characters in the Design System documentation page:
image

The expected message in this case would beYou have 1,000 characters too many

Alternatives

None found yet, but we are considering adding some custom JS to our service. This would modify the comma-seperation message output for screens which use Character Count component.

Additional information (if applicable)

@dalepotter dalepotter added awaiting triage Needs triaging by team feature request User requests a new feature labels Mar 9, 2022
@domoscargin domoscargin added 🕔 hours A well understood issue which we expect to take less than a day to resolve. character count and removed awaiting triage Needs triaging by team labels Mar 16, 2022
@domoscargin
Copy link
Contributor

Hi @dalepotter,

Thanks for this!

We recommend you use maximum word count for longer answers which might help here.

We think it's a sensible change to consider, since there will be cases where somebody's copying and pasting, or there's just no other way to ask the question. But generally, if there's a situation where a user could enter that many characters/words over the limit, there's probably a different way to design the question.

@domoscargin
Copy link
Contributor

Encountered this recently on the DDaT skills assessment tool, which allows 3000 characters per character count.

Form showing two empty character count components with text "You have 3000 characters remaining"

@36degrees
Copy link
Contributor

We intend to look at this when we pick up the other localisation issues for the character count component.

querkmachine added a commit that referenced this issue Jun 13, 2022
Adds Intl.NumberFormat detection, using it for `count` values if supported by the browser. Addresses #2568.
@querkmachine querkmachine self-assigned this Jun 22, 2022
querkmachine added a commit that referenced this issue Jun 23, 2022
Adds Intl.NumberFormat detection, using it for `count` values if supported by the browser. Addresses #2568.
@kellylee-gds
Copy link
Contributor

kellylee-gds commented Jun 28, 2022

@querkmachine can you write a summary of work done so far, then update the done whens on this to reflect what we'll need to do next when we pick the other internationalisation work, and move back into the backlog. Thanks!

@vanitabarrett
Copy link
Contributor

Another alternative (if there's nothing left to do on this other than release i18n) could be to attach this to a Github milestone and move the card to Ready To Release. I think it'll sit there for a while, but that might be ok?

@querkmachine
Copy link
Member

Formatting of the character count text has been included in the internationalisation PR as a progressive enhancement for browsers that support Intl.NumberFormat.

@querkmachine querkmachine added this to the [NEXT] milestone Jun 28, 2022
@querkmachine
Copy link
Member

Moving this back to blocked whilst we do internationalisation pre-release testing.

@36degrees
Copy link
Contributor

In the spike we formatted the number only if it matched the key count, but I wonder if it might make sense to format any placeholder replacement that is of type number, rather than tying it specifically to count.

@querkmachine
Copy link
Member

Reopened as was closed in error. The underlying functionality needed for this to work has been completed, but the actual changes to the character count component will happen as part of #2701 and #2805.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
character count feature request User requests a new feature 🕔 hours A well understood issue which we expect to take less than a day to resolve. localisation
Projects
8 participants