(function($) { /** * String Overrides behavior to load in JavaScript-based translations. */ Drupal.behaviors.stringoverrides = { attach: function (context, settings) { if (settings.stringoverrides || false) { // Make sure the JavaScript localization is available. Drupal.locale = Drupal.locale || {}; Drupal.locale.strings = Drupal.locale.strings || {}; Drupal.locale.strings[''] = Drupal.locale.strings[''] || {}; // Add the string overrides translations to the Drupal.locale array. jQuery.extend(Drupal.locale.strings[''], settings.stringoverrides); } } }; })(jQuery);