code: function translate(locale) {
      // Check to see if we have the locale translation data available. If not, fetch it via Ajax.
      if(_locales[locale] === undefined) {
        $.getJSON(getLocaleAssetUrl(locale), function (localeData) {
          // Store the returned locale data.
          _locales[locale] = localeData;
          // Try to perform translation again.
          translate(locale);
        });
        return;
      }
  
      // Translate elements to the given locale.
      $('[data-translate]').each(function(i, element) {
        translateElement(element, locale);
      });
  
      // Save the chosen locale in a cookie.
      localeCookie.write(locale);
    }
docs: Translate all elements on the page marked up with data-translate attributes to the given locale.
  
  @param locale