By default the statistics module shows "xx reads" below a node when it's enabled. I think "views" would be a better term these days.

For reference, anyone wanting to change that right now can add this code to the THEME_preprocess_node() function in template.php:

  $content['links']['statistics']['#links']['statistics_counter']['title'] = str_replace('reads', 'views', $content['links']['statistics']['#links']['statistics_counter']['title']);
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

timmillwood’s picture

Version: 7.9 » 8.x-dev
Assigned: Unassigned » timmillwood
Status: Active » Needs review
FileSize
794 bytes

Here's a patch for this if anyone wishes to review.

droplet’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, statistics-views-1418008-1.patch, failed testing.

timmillwood’s picture

Status: Needs work » Needs review
FileSize
2.14 KB

Fixed the tests

yoroy’s picture

Status: Needs review » Reviewed & tested by the community

I agree that 'views' is a better word here.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Makes sense to me. Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

smartsystems160’s picture

$content['links']['statistics']['#links']['statistics_counter']['title'] = str_replace('reads', 'views', $content['links']['statistics']['#links']['statistics_counter']['title']);

Code above didnt work for me (Drupal 7), so i used the built-in strings override function in my settings.php file to override it by adding the following:

'@count reads' => '@count views',
'1 read' => '1 view',

jboyette36’s picture

Issue summary: View changes

Slight adjustment to the code at the top that works for me on a current D7 site.

function THEME_preprocess_node(&$variables, $hook) {
	$variables['content']['links']['statistics']['#links']['statistics_counter']['title'] = str_replace('reads', 'views', $variables['content']['links']['statistics']['#links']['statistics_counter']['title']);
}