Hi - I found http://drupal.org/node/190580 where it is suggested to use either locale and a po file, or to use an override in the template.php file for your theme. I haven't tried to use the translation method but when I try to override the buddy_api_translation() function in my template.php file, I get nasty errors. I'm very new to coding and from what I gather, in order to override a module or core function, it needs to be in a theme_function() pattern rather than just function().

Could anyone tell me firstly if I'm wrong, and if not, would it be possible to request that more buddylist2 functions are made into theme overridable functions - specifically the one that lets me change my "buddies" into "connections" etc?

I'd rather not involve the locale module just for this small edit (performance reasons) and at the same time, I'd rather not hack the module code itself either.

Comments

criz’s picture

If you don't want to use the locale module, maybe this module (String Overrides) could be a solution...

4drian’s picture

Thanks criz - I've had a look. I've not yet tried it but isn't there a risk that strings from anywhere on the site will get overridden?

Is it a difficult task to change the current buddy_api_translation() into a theme overridable function? If not, does anyone see why this should not be a feature request?

criz’s picture

I haven't yet tried String Overrides module also, but it looks like only strings passed through t() would be overwritten.

Had a short look at the code. Wouldn't it be a better solution if you just override the buddylist_api_translation variable (variable_set())? As a consequence there would be no theming function necessary. Or I'm wrong?

4drian’s picture

You seem to know a lot more about this than I do thankfully. I'll investigate this variable_set() function as it's new to me. If you've got any pointers I'd appreciate it but I'm not expecting step-by-step instructions. That would be far too lazy of me.

criz’s picture

Status: Active » Closed (fixed)