How To Replace Text With String Overrides in Drupal ?

  0 comments
Share

String Overrides module allows you to replace any text across your Drupal website. It Easily replace any text/string that's passed through t() function.

One of our client want to replace the text related with commerce cart.

They wants to change some text string like below:

  • Add to cart to Add to Wishlist
  • Checkout to Quote Request etc...

I have easily fixed his requirement by using String Overrides module.

In this blog we are exploring how to replace any text that goes through t() function with String Overrides module.

  1. Download and install the String Overrides module
  2. Go to /admin/config/regional/stringoverrides
  3. Type the exact phrase you want to change on left column and the replacement phrase on the right. Click Save Configuration button.

    Text override

  4. You can add extra rows and make multiple changes at one time.

    Add multiple string

  5. Result before string overrides

    Before string override

  6. Result after string overrides

    Before string override

    Also at the place of Checkout Quote Request is showing everywhere in the site.

    Quote request

Note:-- There are some Troubleshooting with String Overrides module. if above settings are not properly working follow the below hints:

  • Clear your cache
  • Check your settings.php for any $conf["locale_custom_strings_en"] overrides, these conflict with the administration interface
  • Check the code to make sure your override is what's presented in t() in the code
  • Overlay module has been reported to break the administration. Please make sure to remove the "overlay=" in the URL.

Add new comment