<%= render 'tolk/nav' %> <% if @phrases.any? %>
<%= form_for @locale do |locale_form| %> <% @phrases.each do |phrase| %> <% if translation = phrase.translations.where(locale_id: @locale.id).first || Tolk::Translation.new(locale: @locale, phrase: phrase) %> <% end %> <% end %>
<%= @locale.language_name -%> <%= Tolk::Locale.primary_language_name -%>
<%= hidden_field_tag :"translations[][id]", translation.id, id: "#{translation.object_id}_id" %> <%= hidden_field_tag :"translations[][phrase_id]", phrase.id, id: "#{translation.object_id}_phrase_id" %> <%= hidden_field_tag :"translations[][locale_id]", translation.locale_id, id: "#{translation.object_id}_locale_id" %> <%= text_area_tag :"translations[][text]", format_i18n_text_area_value(translation.text), class: "locale", id: "#{translation.object_id}_text", onfocus: "$(this).up('tr').addClassName('active');", onblur: "$(this).up('tr').removeClassName('active');" %>
<%= text_area_tag :"translations[][original_text]", format_i18n_text_area_value(phrase.translations.primary.text), disabled: true %> <% if params[:q].present? -%> <%= highlight(format_i18n_value(phrase.translations.primary.text), params[:q]) -%> <% else -%> <%= format_i18n_value(phrase.translations.primary.text) -%> <% end -%> <%= boolean_warning if phrase.translations.primary.boolean? -%> <%= params[:k].present? ? highlight(h(truncate(phrase.key, length: 100)), params[:k]) : h(truncate(phrase.key, length: 100)) %>

<%= locale_form.submit "Save changes", class: 'save-translations btn btn--large' %>

<% end %> <%= tolk_paginate @phrases %>
<% else %>
<%= render 'tolk/no_data' %>

No search results.

<% end %>