How to dynamically change the text of the Global: result summary based on exposed filter on Views? There is a content type and it has a field called field_type. It's a select list and there is 5 options to select such as AAA, BBB, CCC, DDD, EEE.

I'm using the Views module to list the nodes of this content type. I added the field_type as exposed filter for this views.

In the header of the views, I added the Global: Result summary to show result summary.

 "@total results found."




What I want to do is dynamically change the text based on the exposed filter. For example if the AAA is selected on the field_type exposed filter then the results summary should display:

 "@total AAA found."



How can I do that?
I took the liberty of writing a little module for accomplishing what you asked for, I found it an interesting problem.
You can access it here:

https://www.drupal.org/sandbox/stefanos.petrakis/2666048

Hope this helps