Fix i18n translations warnings.

This commit is contained in:
Senén Rodero Rodríguez
2017-07-24 11:36:45 +02:00
parent 63621aa526
commit 17ad148cd7
4 changed files with 8 additions and 4 deletions

View File

@@ -19,8 +19,11 @@ class DocumentsController < ApplicationController
end end
def destroy def destroy
@document.destroy if @document.destroy
flash[:notice] = t "documents.actions.destroy.notice" flash[:notice] = t "documents.actions.destroy.notice"
else
flash[:alert] = t "documents.actions.destroy.alert"
end
redirect_to params[:from] redirect_to params[:from]
end end

View File

@@ -28,7 +28,7 @@ class Document < ActiveRecord::Base
def validate_attachment_content_type def validate_attachment_content_type
if documentable.present? && if documentable.present? &&
!documentable.class.accepted_content_types.include?(attachment_content_type) !documentable.class.accepted_content_types.include?(attachment_content_type)
errors[:attachment] = I18n.t("documents.errors.messages.content_type", errors[:attachment] = I18n.t("documents.errors.messages.wrong_content_type",
content_type: attachment_content_type, content_type: attachment_content_type,
accepted_content_types: documentable.class.accepted_content_types.join(", ")) accepted_content_types: documentable.class.accepted_content_types.join(", "))
end end

View File

@@ -9,7 +9,7 @@
<% if can? :destroy, Document %> <% if can? :destroy, Document %>
<%= link_to t('documents.buttons.destroy_document'), <%= link_to t('documents.buttons.destroy_document'),
document_path(document, from: request.url), method: :delete, document_path(document, from: request.url), method: :delete,
data: { confirm: "¿Está segurto de que desea eliminar el documento?. Esta acción no se puede deshacer." }, data: { confirm: t('documents.actions.destroy.alert') },
class: 'button hollow alert' %> class: 'button hollow alert' %>
<% end %> <% end %>
</td> </td>

View File

@@ -37,6 +37,7 @@ data:
- config/locales/%{locale}/officing.yml - config/locales/%{locale}/officing.yml
- config/locales/%{locale}/budgets.yml - config/locales/%{locale}/budgets.yml
- config/locales/%{locale}/legislation.yml - config/locales/%{locale}/legislation.yml
- config/locales/%{locale}/documents.yml
# Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom: # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
# `i18n-tasks normalize -p` will force move the keys according to these rules # `i18n-tasks normalize -p` will force move the keys according to these rules