String Overrides is a pretty sweet module for getting the text on your site more exactly like the client wants. In general it works with any t function – what I didn’t realize at first is that this means it’ll override variables embedded in the t function as well.
So I was looking for some text that was on the site and initially was doing a search for a pretty long string, not realizing that within the string were several variables that were to be replaced… so by shortening the search to a few words within the string – specifically grep with the flags -H (for the filename) and -r (for recursive search within the modules directory) I got the following
grep -H -r "entities with this value set" .* ./field_analytics/field_analytics.reports.inc: $headers = array(t('Value'), t('Number of %bundle entities with this value set', $replacements), t('Percentage of total %bundle entities with this value set', $replacements)); ../contrib/field_analytics/field_analytics.reports.inc: $headers = array(t('Value'), t('Number of %bundle entities with this value set', $replacements), t('Percentage of total %bundle entities with this value set', $replacements));
So then it was obvious – the %bundle was actually pulling in a variable and thus doing the search for what seemed like the string was failing, however doing a string override with “Number of %bundle entities with this value set” worked beautifully
Anyhow, this may be old news to some, but it totally saved my weekend… Aloha