-
Notifications
You must be signed in to change notification settings - Fork 334
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 ability to customise character count fallback text #2742
Conversation
c4a97ef
to
1338de2
Compare
My thoughts:
|
@vanitabarrett Regarding number 2: This was me trying to think of a solution to a possible source of confusion: In English, setting the I realise this isn't a big deal, just trying to cover off the bases! |
@querkmachine Hm, that's true. That might be ok, because it's the default? Tempted to try it out as-is for now and then consider adding something in if people found it confusing to use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks good to me - just left one comment about the macro option description. I think it'll need a changelog entry too.
@vanitabarrett Do you think we should wait until the JavaScript equivalent of this work is closer to completion before merging? It seems weird to release one without the other, even if they are functionally independent. |
@querkmachine I don't really have a strong opinion on it. On one side, we already have components where you can end up with mixed languages, whereas on the other side this feels different because it's letting you translate only some of the component 'furniture'. I'm happy for this to sit here until we're more confident in knowing when we're shipping the internationalisation work. |
e861420
to
8bdc08b
Compare
Adds a new Nunjucks parameter (
fallbackHintText
) which allows the user to customise the fallback message used on the character count in situations where JavaScript is not available. This text is also exposed to assistive technologies, regardless of JavaScript availability.It uses Nunjucks'
replace
filter to swap instances of the string%{count}
with the value ofmaxwords
, if defined, ormaxlength
.Closes #2687.
Questions
fallbackHintText
make sense as the name for this parameter? It was namedlimitHint
in the i18n tech spike, but I changed it here as this piece of text is commonly referred to as being the fallback and it helps avoid confusion with the live limit counter that the JS adds.