How can I override JavaScript settings used by a contributed module? I am using the Fivestar module for rating purpose in my project.
In that module there is a function called fivestar_add_js(), which is used to add the necessary terms to Javascript. The function is given below:

function fivestar_add_js() {
  static $js_added = FALSE;

  // Add necessary javascript only once per page.
  if (!$js_added) {
    $settings = array(
      'titleUser' =&gt; t('Your rating') .': ',
      'titleAverage' =&gt; t('Average') .': ',
      'feedbackSavingVote' =&gt; t('Saving your vote...'),
      'feedbackVoteSaved' =&gt; t('Your vote has been saved.'),
      'feedbackDeletingVote' =&gt; t('Deleting your vote...'),
      'feedbackVoteDeleted' =&gt; t('Your vote has been deleted.'),
    );

    drupal_add_js(drupal_get_path('module', 'fivestar') .'/js/fivestar.js');
    drupal_add_js(array('fivestar' =&gt; $settings), 'setting');
    $js_added = TRUE;
  }
}


In that function I need to replace the word from vote to rating.
How can I do this?
As those strings are passed to t() the faster way to rewrite those strings is to overwrite then in the settings.php file, using something similar to the following code (write only the code for the Drupal version you are using):

// Drupal 6.
$conf['locale_custom_strings_en'] = array(
  'Saving your vote' =&gt; 'Saving your rating',
  'Your vote has been saved' =&gt; 'Your rating has been saved',
  'Deleting your vote...' =&gt; 'Deleting your rating...',
  'Your vote has been deleted.' =&gt; 'Your rating has been deleted.'
);

// Drupal 7.
$conf['locale_custom_strings_en'][''] = array(
  'Saving your vote' =&gt; 'Saving your rating',
  'Your vote has been saved' =&gt; 'Your rating has been saved',
  'Deleting your vote...' =&gt; 'Deleting your rating...',
  'Your vote has been deleted.' =&gt; 'Your rating has been deleted.'
);