Programming, microcontrollers and photography




ELGG 1.7.10: Changing "GROUP" to "PROJECT"

05 Jul 2011
Posted by John

We worked on the following plugin earlier, but here it was for ELGG 1.8. This time the code will be for 1.7.10 and have a slightly easier way of using.
 
The plugin is built around this code:
 
$from = array("group", "groups", "Group", "Groups");
$to = array("project", "projects", "Project", "Projects");
foreach ($CONFIG->translations["en"] as $key => $value) {
  $CONFIG->translations["en"][$key] = str_replace($from, $to, $value);
} 
It will run through all known english texts and search/replace the strings. Now, the only thing you have to do is change the $from and $to arrays with your choice.
 
I've noticed other developers working on this as well. Here is one by Matt Beckett: http://community.elgg.org/pg/plugins/project/749463/developer/Beck24/rename-groups-17x
The advantage of Matt's solution is that an administrator can make changes. The disadvantage is that it is very dependant on other plugins and you'll need a new version whenever a new plugin uses the Group word.
 
I suppose the best solution would be to run an automatic change like the one I proposed above and tweak the wrong changes like done in Matt's solution. That way we would have the dynamics of both plugins.
 
Below you'll find the plugin attached. Installation like any elgg plugin, but it must be run as last one and should be at the bottom of your plugin-list.

AttachmentSize
grouprename 1.7.10.zip1.09 KB
Tags:


Powered by Drupal, an open source content management system