<%= form_tag(params, :method => :get, :name => 'filter_form') do %> <%= hidden_field_tag(:filter, params[:filter]) %> <%= hidden_field_tag(:sort_by, params[:sort_by]) %>

<%= select_tag(:from_locale, options_for_select(I18n.available_locales, @from_locale.to_sym)) %> to <%= select_tag(:to_locale, options_for_select(I18n.available_locales, @to_locale.to_sym)) %> <%= submit_tag "Display" %>
<%= link_to '.. /', '../' %> <%= link_to @page_title, root_path %>
<%= simple_filter(@show_filters).html_safe %> Found <%= @keys.all_keys.size %> messages <%= link_to "Reload messages", translate_reload_path(params) %>

<% flash.each do |key, msg| %>
<%= msg %>
<% end %>
<% end %>
<%= build_namespace(@keys.namespaces).html_safe %>
<%= render :partial => 'pagination', :locals => {:total_entries => @keys.all_keys.size, :per_page => @per_page} %>
<% if @keys.all_keys.size > 0 %> <%= form_tag(translate_path, method: :put) do %>
<%= hidden_field_tag(:filter, params[:filter], :id => "hid_filter") %> <%= hidden_field_tag(:sort_by, params[:sort_by], :id => "hid_sort_by") %> <%= hidden_field_tag(:key_type, params[:key_type], :id => "hid_key_type") %> <%= hidden_field_tag(:key_pattern, params[:key_pattern], :id => "hid_key_pattern") %> <%= hidden_field_tag(:text_type, params[:text_type], :id => "hid_text_type") %> <%= hidden_field_tag(:text_pattern, params[:text_pattern], :id => "hid_text_pattern") %>

Translations from <%= @from_locale %> to <%= @to_locale %> - <%= simple_filter(["key", "text"], 'sort_by').html_safe %> <%= submit_tag "Save Translations", style: 'float:right;' %>

<% @paginated_keys.each do |key| from_text = lookup(@from_locale, key) to_text = lookup(@to_locale, key) line_size = 100 n_lines = n_lines(from_text, line_size) field_name = "key[#{key}]" tid = key.split('.').join("_") %>

<% if n_lines > 1 %>

<% if @keys.files[key] %>
found in <%= @keys.files[key].count %> files
<%= @keys.files[key].join("
").html_safe %>
<% end %> <%=h key %> X
<%= from_text %>
<%= text_area_tag(field_name, to_text, :rows => n_lines, :id => tid) %>
<% else %>
<% if @keys.files[key] %>
found in <%= @keys.files[key].count %> files
<%= @keys.files[key].join("
").html_safe %>
<% end %> <%=h key %> X
<%= from_text %>
<%= text_field_tag(field_name, to_text, :size => line_size, :id => tid) %> <% end %>

<% end %>

Translations from <%= @from_locale %> to <%= @to_locale %> <%= submit_tag "Save Translations", style: 'float:right' %>

<% end %> <% end %>
<%= render :partial => 'pagination', :locals => {:total_entries => @keys.all_keys.size, :per_page => @per_page} %>