I Just Want to Change That One Word!

If you develop Drupal sites for clients, then you've no doubt been requested to change some of the default language found in Drupal core and/or contributed modules. For example, instead of "My account", your client wants it to read "User info". Or instead of "Create content", they request "Add stuff".

When I first started developing Drupal site a few years ago, I would actually (the faint of heart should avert your eyes) hack core or the modules to get it done. I very quickly learned my lesson and changed over to the Locale module (this was in the days of 4.7). While this was better, it was meant for full language translations and not for site-specific custom text.

Luckily, with Drupal 6, we have the String Overrides module. This module was intended exactly for this purpose - to change Drupal's default text to suit a particular site's needs. It still uses Drupal translation system underneath, but it is a little bit more lightweight than a full translation modules.

Be warned, though, it can still mess with you. For example, I recently wanted to change the term, "List price" in Ubercart to "MSRP". When I added this change to the String Overrides module configuration, nothing happened. I looked again at where "List price" was being printed out and it looked like this: "List price: $400". So, I tried entering "List price:" and "MSRP:" (note the colon) - still nothing. Finally, I tried "List price: " and "MSRP: " (note the colon and the space) - luckily that worked. Depending on how the string is defined in the module, you may have to be very particular in how you try to translate it.

Comments

I was mid-editing some core files in Drupal 6 to change the display of "username" to "your name" when I tried one last desparate search and found your post. Thank you for this headache relief. :)

Submitted by Guest (not verified) on Tue, 01/26/2010 - 14:23

I know this is a REALLY old thread, but I am having the problem of changing List Price to Original Price too.

So far I've had no joy!

I tried your suggestion but no luck.

Do you have any further info on this one?

Cheers,

Rebecca

Submitted by Guest (not verified) on Wed, 08/24/2011 - 08:53

Author comment

Rebecca,

The only other advice I can offer is to search the code for the string you want to change and see exactly what is being passed in the t() function. For example, it might be something like t('List price : '). Once you find it, you'll know exactly how the string is formed.

-mike

Submitted by ultimike on Wed, 08/24/2011 - 10:26

In reply to by Guest (not verified)

Add new comment

The content of this field is kept private and will not be shown publicly.