Home ›
Overriding a string the second-simplest way in Drupal 7Overriding a string the second-simplest way in Drupal 7
Submitted by Benjamin Melançon on December 11, 2012 - 10:52pm
Here's the situation: You don't need administrator-customizable strings like the String Overrides modules provide, but you'd like the changes in a more share-able (or consistently version controlled) place than settings.php, which details an easy $conf way of doing string overrides.
Well, here's how to do it with a variable set function that can go in a module's install or update hook:
<?php
variable_set("locale_custom_strings_en", array('' => array("Existing string." => "Replacement string.")));
?>More like this
- How to fetch a file at a URL and set it as the default image in an image field
- Define and Use a JQuery Plugin as a Helper Function for Drupal JavaScript
- Change the text of a tab, such as 'View', for one node type
- Return user to current page: How to link to a form from a Drupal menu
- There's more than one way to span a date...


Comments
Overriding
Hey buddy thanks for the code this will help in my project. custom made to order rugs
Post new comment