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

Allow localisable "apply filters" text for the filter component #486

Closed
pandu-supriyono opened this issue May 13, 2023 · 2 comments
Closed

Comments

@pandu-supriyono
Copy link

pandu-supriyono commented May 13, 2023

Summary

Allow the hard-coded "apply filters" text in the filter component to be customisable.

Motivation

We came across this requirement during the development of our app which is not in English. Related: WCAG SC 3.1.2 Language of Parts

Describe alternatives you've considered

For now, we've applied a patch (without thinking too much about the name of the parameter used to customise the text):

diff --git a/node_modules/@ministryofjustice/frontend/moj/components/filter/template.njk b/node_modules/@ministryofjustice/frontend/moj/components/filter/template.njk
index 5ebe066..26b944f 100644
--- a/node_modules/@ministryofjustice/frontend/moj/components/filter/template.njk
+++ b/node_modules/@ministryofjustice/frontend/moj/components/filter/template.njk 
@@ -48,7 +48,8 @@
     <div class="moj-filter__options">
 
       {{ govukButton({
-        text: 'Apply filters'
+        text: params.applyFilters.text or "Apply filters"
       }) }}
 
       {{params.optionsHtml | safe}}

A similar issue and use case is described in issue #404.

@pandu-supriyono
Copy link
Author

Almost related: #492

@stalwartsolutions
Copy link
Contributor

I've made this change, or something close to it at least (params.submit.text), as I was making related additions for my own project. :) It's been released in v1.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants