How do I replace part of a webform component label with a variable token? I have webform component labels like this:

Did [your pet] have any illnesses?

and I want to replace [your pet] with a variable token?

Do I need to write a custom module or can I do this by editing one of the theme .tpl files?

Tried this code as suggested:

&lt;?php

/*
 * Implementation of hook_form_alter()
 */

drupal_set_message(t('Outwith the hook'), 'warning'); // display outwith the hook

function wit_bootstrap_form_alter(&amp;$form, &amp;$form_state, $form_id) {

drupal_set_message(t('Inside the hook'), 'warning'); // display within the hook


 // target my form / my field
  if ($form_id == "webform_client_form_1") {
    // target my form / my field

    if ($form['neutered']['#title']) {
        $title = $form['neutered']['#title'];
        $token_val = 'freelo';//get_tokenised_value(); // Which ever way you handle that...
        $title = str_replace('[your pet]', $token_val, $title);
        $form['neutered']['#title'] = $title;
    }
  }
}
hook_form_alter() should allow you to so.  

Within your theme you should be able to do something like :

/*
 * Implementation of hook_form_alter()
 */
function my_theme_form_alter(&amp;$form, &amp;$form_state, $form_id){
  // target my form / my field
  if ($form_id == "my_form") {
    if ( $form['my_field']['#title'] ) {
      $title =  $form['my_field']['#title'];
      $token_val = get_tokenised_value(); // Which ever way you handle that...
      $title = str_replace('[your pet]', $token_val, $title);
      $form['my_field']['#title'] = $title;
    }
  }
}


Also check the forms api reference to see what things you can set / alter on forms.