<% @page_title = "Translate" show_filters = ["all", "untranslated", "translated"] show_filters << "changed" if @from_locale != @to_locale %> <%= form_tag(params, :method => :get, :name => 'filter_form') do %> <%= hidden_field_tag(:filter, params[:filter]) %> <%= hidden_field_tag(:sort_by, params[:sort_by]) %>
<% if @page_title %>

<%= 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 <%= @total_entries %> messages <%= link_to "Reload messages", translate_reload_path %>

<% end %> <% flash.each do |key, msg| %>
<%= msg %>
<% end %>
<% end %>
<%= build_namespace(@deep_keys).html_safe %>
<%= render :partial => 'pagination', :locals => {:total_entries => @total_entries, :per_page => per_page} %>
<% if @total_entries > 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("_") %>

<%= hidden_field_tag("version[#{key}]", @versions[key] || '0') %> <% if n_lines > 1 %> <%=h key %> <% if @files[key] %> <%= @files[key].join("").html_safe %> <% end %>

<%= from_text %>
<%= text_area_tag(field_name, to_text, :rows => n_lines+1, :id => tid) %>
<% else %> <%= from_text %> <%=h key %> <% if @files[key] %> <%= @files[key].join("").html_safe %> <% end %> <%= 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 => @total_entries, :per_page => per_page} %>