<commit_before><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <%= javascript_include_tag :defaults %>
    <title><%= h(@page_title) %></title>
    
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
      google.load("language", "1");

      function getGoogleTranslation(id, text, from_language, to_language) {
        google.language.translate(text, from_language, to_language, function(result) {
        if (!result.error) { 
            Form.Element.setValue(id, result.translation.unescapeHTML());
            }
        });

    }

    /*
    prototypeUtils.js from http://jehiah.com/
    Licensed under Creative Commons.
    version 1.0 December 20 2005

    Contains:
    + Form.Element.setValue()
    + unpackToForm()

    */

    /* Form.Element.setValue("fieldname/id","valueToSet") */<commit_msg>When sending strings to google, if they contained variables, the string would get messed up. So escape it to something google doesn't edit, and reassemble the string when a response comes back from the request.<commit_after><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <%= javascript_include_tag :defaults %>
    <title><%= h(@page_title) %></title>
    
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
      google.load("language", "1");

      function getGoogleTranslation(id, text, from_language, to_language) {
        text = text.replace(/\{\{/, '__').replace(/\}\}/, '__')
        google.language.translate(text, from_language, to_language, function(result) {
          if (!result.error) { 
            result_text = result.translation.unescapeHTML().gsub(/__(.+)__/, function(match){
              return '{{' + match[1] + '}}';
            });
            Form.Element.setValue(id, result_text);
          }
        });

    }

    /*
    prototypeUtils.js from http://jehiah.com/
    Licensed under Creative Commons.
    version 1.0 December 20 2005

    Contains:
    + Form.Element.setValue()
    + unpackToForm()

    */

    /* Form.Element.setValue("fieldname/id","valueToSet") */
{'fraction_non_alphanumeric': 0.17401215805471124, 'fraction_numerical': 0.018617021276595744, 'mean_word_length': 3.1076443057722307, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 2, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2736721', 'n_tokens_mistral': 895, 'n_tokens_neox': 825, 'n_words': 162}