Fix i18n translations warnings.
This commit is contained in:
@@ -19,8 +19,11 @@ class DocumentsController < ApplicationController
|
||||
end
|
||||
|
||||
def destroy
|
||||
@document.destroy
|
||||
if @document.destroy
|
||||
flash[:notice] = t "documents.actions.destroy.notice"
|
||||
else
|
||||
flash[:alert] = t "documents.actions.destroy.alert"
|
||||
end
|
||||
redirect_to params[:from]
|
||||
end
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class Document < ActiveRecord::Base
|
||||
def validate_attachment_content_type
|
||||
if documentable.present? &&
|
||||
!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,
|
||||
accepted_content_types: documentable.class.accepted_content_types.join(", "))
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<% if can? :destroy, Document %>
|
||||
<%= link_to t('documents.buttons.destroy_document'),
|
||||
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' %>
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
@@ -37,6 +37,7 @@ data:
|
||||
- config/locales/%{locale}/officing.yml
|
||||
- config/locales/%{locale}/budgets.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:
|
||||
# `i18n-tasks normalize -p` will force move the keys according to these rules
|
||||
|
||||
Reference in New Issue
Block a user