<commit_before><%
  @title = :edit_translations_title.t
  javascript_include('prototype')
  javascript_include('element_extensions')
%>

<style>
  table.translation td {
    margin: 0px;
    border: 1px solid black;
    padding: 5px 10px 5px 10px;
  }

  table.translation td div {
    height: 800px;
    overflow-y: auto;
  }

  table.old_versions td {
    margin: 0px;
    border: 0px;
    padding: 1px 0.5em 1px 0.5em;
    white-space: nowrap;
    text-align: left;
  }

  p.form_div {
    margin: 0px;
  }

  p.major_header {
    font-size: 150%;
    /* font-weight: bold; */
    margin: 2em 0em 1em 0em;
    padding: 0px;
  }

  p.minor_header {
    font-size: 100%;
    margin: 1.7em 0em 0.3em 0em;
    padding: 0px;
  }

  p.comment {
    font-size: 85%;
    margin: 0px;
    padding: 0px;
  }

  p.tag_field {
    margin: 0em 0em 0em 1em;
    padding: 0px;
    text-indent: -1em
  }

  span.translated {
  }

  span.untranslated {
    font-weight: bold;
  }

  span.tag {
  }

  iframe#hidden_frame {
    width: 0px;
    height: 0px;
    border: 0px;
  }

  div#whirly {
    position: absolute;
    border: 1px solid black;
    padding: 1em 2em 1em 2em;
    background: white;
    color: black;
    text-align: center;
  }
</style>

<%= javascript_tag %(
  var LOCALE = "#{@lang.locale}";
  var LOADED = false;
  var CHANGED = false;
  var CONFIRM_STRING = "#{:edit_translations_will_lose_changes.l}";
  var LOADING_STRING = "#{:edit_translations_loading.l}";
  var SAVING_STRING = "#{:edit_translations_saving.l}";

  window.onbeforeunload = function() {
    if (CHANGED)
      return CONFIRM_STRING;
  }

  function form_changed() {
    CHANGED = true;
    $("save_button").disabled = "";
    $("cancel_button").disabled = "";
  }

  function clear_form() {
    $("form_div").innerHTML = "";
    LOADED = false;
    CHANGED = false;
  }

  function submit_form() {
    CHANGED = false;
    show_whirly(SAVING_STRING);
    $("save_button").disabled = "disabled";
    $("cancel_button").disabled = "disabled";
    $("post_form").onsubmit();
    return(false);<commit_msg>Tweak edit translations again, this time I know it works with Chrome.<commit_after><%
  @title = :edit_translations_title.t
  javascript_include('prototype')
  javascript_include('element_extensions')
%>

<style>
  table.translation td {
    margin: 0px;
    border: 1px solid black;
    padding: 5px 10px 5px 10px;
  }

  table.translation td div {
    height: 800px;
    overflow-y: auto;
  }

  table.old_versions td {
    margin: 0px;
    border: 0px;
    padding: 1px 0.5em 1px 0.5em;
    white-space: nowrap;
    text-align: left;
  }

  p.form_div {
    margin: 0px;
  }

  p.major_header {
    font-size: 150%;
    /* font-weight: bold; */
    margin: 2em 0em 1em 0em;
    padding: 0px;
  }

  p.minor_header {
    font-size: 100%;
    margin: 1.7em 0em 0.3em 0em;
    padding: 0px;
  }

  p.comment {
    font-size: 85%;
    margin: 0px;
    padding: 0px;
  }

  p.tag_field {
    margin: 0em 0em 0em 1em;
    padding: 0px;
    text-indent: -1em
  }

  span.translated {
  }

  span.untranslated {
    font-weight: bold;
  }

  span.tag {
  }

  iframe#hidden_frame {
    width: 0px;
    height: 0px;
    border: 0px;
  }

  div#whirly {
    position: absolute;
    border: 1px solid black;
    padding: 1em 2em 1em 2em;
    background: white;
    color: black;
    text-align: center;
  }
</style>

<%= javascript_tag %(
  var LOCALE = "#{@lang.locale}";
  var LOADED = false;
  var CHANGED = false;
  var CONFIRM_STRING = "#{:edit_translations_will_lose_changes.l}";
  var LOADING_STRING = "#{:edit_translations_loading.l}";
  var SAVING_STRING = "#{:edit_translations_saving.l}";

  window.onbeforeunload = function() {
    if (CHANGED)
      return CONFIRM_STRING;
  }

  function form_changed() {
    CHANGED = true;
    $("save_button").disabled = "";
    $("cancel_button").disabled = "";
  }

  function clear_form() {
    $("form_div").innerHTML = "";
    LOADED = false;
    CHANGED = false;
  }

  function submit_form() {
    CHANGED = false;
    show_whirly(SAVING_STRING);
    $("save_button").disabled = "disabled";
    $("cancel_button").disabled = "disabled";
    $("post_form").submit();
    return(false);
{'fraction_non_alphanumeric': 0.13817663817663817, 'fraction_numerical': 0.026590693257359924, 'mean_word_length': 2.738243123336291, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '519103', 'n_tokens_mistral': 1741, 'n_tokens_neox': 1579, 'n_words': 336}