<commit_before><div id='translations'>
  <div id="header">
    <h1>Translations</h1>

    <%= form_tag translations_path, :method => "get" do %>
      <%= label_tag :key, "Filter: " %>
      <%= text_field_tag :search, params[:search], :placeholder => "Search for text..." %>
      <%= select_tag :key, options_for_select(@sections.collect {|k| [k.humanize, k]}.unshift(["All sections", nil]), params[:key]) %>
      <%= select_tag :group, options_for_select(@groups.collect {|k| [k.humanize, k]}.unshift(["All groups", nil]), params[:group]) %>
      <%= select_tag :translated, options_for_select([["Translation state", nil], ['Fully translated', '1'], ['Missing translations', '0']], params[:translated]) %>
      <%= submit_tag "Submit" %>
    <% end %>
  </div>
  <% if params[:group] && params[:group] == 'deleted' %>
    <div>
      You can delete those translations from database as application doesn't use them anymore.
    </div>
  <% end %>

  <% @keys.each do |key| %>
    <div id="<%= key.gsub('.','-')  %>" class="translation">
      <h2>
        <%-
          parts = key.split('.').map(&:humanize)
          if params[:key].present?
            parts.delete_at(0)
          elsif parts.size > 1
            parts[0] = link_to(parts[0], translations_path(:group => params[:group], :key => parts[0].underscore), :title => "Go to section " + parts[0])
          end
        %>
        <%= parts.join(' > ').html_safe %>
      </h2>

      <% if params[:group] && params[:group] == 'deleted' %>
        <%= link_to 'destroy', translation_path(:id => key.gsub('.','-')),
                      :remote => true,
                      :method => :delete,
                      :confirm => 'Are you sure? This operation is irreversible.',
                      :class => 'button warning',
                      :title => 'Clear form database as translation no longer exists in default language file.'
        %>
      <% end %>
      <% Translator.locales.each do |locale| %>
        <%= render :partial => "form", :locals => {:locale => locale, :key => key} %>
      <% end %>
    </div>
  <% end %>

  <% unless @total_pages < 2 %>
    <% (1..@total_pages).each do |p| %>
      <%= link_to_unless_current p, translations_path(:group => params[:group],
                                                      :search => params[:search],
                                                      :key => params[:key],
                                                      :translated => params[:translated],
                                                      :page => p), :class => "button small" %>
    <% end %>
  <% end %>
</div>

<div id="footer">
  <div id="shameless">
    Brought to you by <%= link_to "AmberBit", "http://amberbit.com" %> Ruby on Rails web development team.
    <br/>
    2010-2011 &copy; <NAME> &lt;<EMAIL>&gt;
  </div>
  <%= link_to image_tag("http://amberbit.com/images/logo.png"), "http://amberbit.com" %>
</div>

<script type="text/javascript">
  $("a[data-recover]").live("click", function(event) {
    event.preventDefault();
    $("input[type='text']", $(this).parents("form")).val($(this).attr("data-recover"));
  });
</script>
<commit_msg>fix translator / restet default<commit_after><div id='translations'>
  <div id="header">
    <h1>Translations</h1>

    <%= form_tag translations_path, :method => "get" do %>
      <%= label_tag :key, "Filter: " %>
      <%= text_field_tag :search, params[:search], :placeholder => "Search for text..." %>
      <%= select_tag :key, options_for_select(@sections.collect {|k| [k.humanize, k]}.unshift(["All sections", nil]), params[:key]) %>
      <%= select_tag :group, options_for_select(@groups.collect {|k| [k.humanize, k]}.unshift(["All groups", nil]), params[:group]) %>
      <%= select_tag :translated, options_for_select([["Translation state", nil], ['Fully translated', '1'], ['Missing translations', '0']], params[:translated]) %>
      <%= submit_tag "Submit" %>
    <% end %>
  </div>
  <% if params[:group] && params[:group] == 'deleted' %>
    <div>
      You can delete those translations from database as application doesn't use them anymore.
    </div>
  <% end %>

  <% @keys.each do |key| %>
    <div id="<%= key.gsub('.','-')  %>" class="translation">
      <h2>
        <%-
          parts = key.split('.').map(&:humanize)
          if params[:key].present?
            parts.delete_at(0)
          elsif parts.size > 1
            parts[0] = link_to(parts[0], translations_path(:group => params[:group], :key => parts[0].underscore), :title => "Go to section " + parts[0])
          end
        %>
        <%= parts.join(' > ').html_safe %>
      </h2>

      <% if params[:group] && params[:group] == 'deleted' %>
        <%= link_to 'destroy', translation_path(:id => key.gsub('.','-')),
                      :remote => true,
                      :method => :delete,
                      :confirm => 'Are you sure? This operation is irreversible.',
                      :class => 'button warning',
                      :title => 'Clear form database as translation no longer exists in default language file.'
        %>
      <% end %>
      <% Translator.locales.each do |locale| %>
        <%= render :partial => "form", :locals => {:locale => locale, :key => key} %>
      <% end %>
    </div>
  <% end %>

  <% unless @total_pages < 2 %>
    <% (1..@total_pages).each do |p| %>
      <%= link_to_unless_current p, translations_path(:group => params[:group],
                                                      :search => params[:search],
                                                      :key => params[:key],
                                                      :translated => params[:translated],
                                                      :page => p), :class => "button small" %>
    <% end %>
  <% end %>
</div>

<div id="footer">
  <div id="shameless">
    Brought to you by <%= link_to "AmberBit", "http://amberbit.com" %> Ruby on Rails web development team.
    <br/>
    2010-2011 &copy; <NAME> &lt;<EMAIL>&gt;
  </div>
  <%= link_to image_tag("http://amberbit.com/images/logo.png"), "http://amberbit.com" %>
</div>

<script type="text/javascript">
  $("a[data-recover]").live("click", function(event) {
    event.preventDefault();
    $("textarea", $(this).parents("form")).val($(this).attr("data-recover"));
  });
</script>

{'fraction_non_alphanumeric': 0.19585036152153412, 'fraction_numerical': 0.0069160641307764855, 'mean_word_length': 2.2299492385786803, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 147, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3427013', 'n_tokens_mistral': 2033, 'n_tokens_neox': 1858, 'n_words': 433}