From 83197023748a67623e74e768da8b9284970c8c90 Mon Sep 17 00:00:00 2001 From: Payten Giles Date: Mon, 12 Oct 2015 14:04:53 +1100 Subject: [PATCH] I18n in yo face --- frontend/locales/en.yml | 22 +++++++++++++++++++ .../views/onbase_documents/_form.html.erb | 10 ++++----- .../onbase_documents/_keywords_form.html.erb | 4 ++-- .../_keywords_readonly.html.erb | 2 +- .../views/onbase_documents/_readonly.html.erb | 14 ++++++------ .../views/onbase_documents/_template.html.erb | 6 ++--- .../views/onbase_documents/_toolbar.html.erb | 6 ++--- frontend/views/onbase_documents/show.html.erb | 4 ++-- 8 files changed, 45 insertions(+), 23 deletions(-) diff --git a/frontend/locales/en.yml b/frontend/locales/en.yml index bfc1c04..e585bac 100644 --- a/frontend/locales/en.yml +++ b/frontend/locales/en.yml @@ -11,16 +11,38 @@ en: onbase_id: OnBase ID document_type: Document Type keywords: Keywords + filename: Filename + mime_type: MIME-Type + linked_record: Linked Record _frontend: action: add: Add OnBase Document save: Save OnBase Document create: Create an OnBase Document + download: Download Document + upload: Upload Document + fetch_keywords: Fetch Keywords from OnBase + show_linker: Or link to an existing OnBase Document? + upload_and_link: Upload and Link to OnBase Document + delete: Delete OnBase Document messages: updated: OnBase Document Saved document_type_required: Document Type is required file_required: File to Import is required keyword_required: Keyword "%{code}" is required + no_document_types_defined: "There are no OnBase document types defined for this record: %{parent_type}" + transferring_file_step_1: Transferring file... + transferring_file_step_2: Transferred! + transferring_file_step_3: Sending to the OnBase Service... + transferring_file_step_4: Done! + transferring_file_error: Error -- see message above. + edit_not_supported: Edit of Onbase Record not supported + system_generated: System Generated + type_not_supported: "Type not supported: %{type}" + no_keywords: There are no keywords stored in OnBase for this document + delete: This action will queue the OnBase Document to be deleted from both ArchivesSpace and OnBase. This action cannot be undone. + unlinked: OnBase Document is unlinked + onbase_document_keyword: linked_record_system_id: Record ID agent_system_id: Agent ID diff --git a/frontend/views/onbase_documents/_form.html.erb b/frontend/views/onbase_documents/_form.html.erb index 1c0ba2e..9fc5860 100644 --- a/frontend/views/onbase_documents/_form.html.erb +++ b/frontend/views/onbase_documents/_form.html.erb @@ -23,7 +23,7 @@
<% else %>
- There are no OnBase document types defined for this record: <%= @parent_type %> + <%= I18n.t("plugins.onbase_document._frontend.messages.no_document_types_defined", :parent_type => @parent_type) %>
<% end %> @@ -34,17 +34,17 @@ <% else %> -
Edit of Onbase Record not supported
+
<%= I18n.t("plugins.onbase_document._frontend.messages.edit_not_supported") %>
<% end %> <%= form.hidden_input "onbase_id" %> <% end %> diff --git a/frontend/views/onbase_documents/_keywords_form.html.erb b/frontend/views/onbase_documents/_keywords_form.html.erb index dc8e836..65fa6c3 100644 --- a/frontend/views/onbase_documents/_keywords_form.html.erb +++ b/frontend/views/onbase_documents/_keywords_form.html.erb @@ -9,10 +9,10 @@ <% elsif field[:type] == 'generated' %>
- System Generated + <%= I18n.t("plugins.onbase_document._frontend.messages.system_generated") %>
<% else %> - Type not supported: <%= field[:type] %> + <%= I18n.t("plugins.onbase_document._frontend.messages.type_not_supported", :type => field[:type]) %> <% end %> <% end %> diff --git a/frontend/views/onbase_documents/_keywords_readonly.html.erb b/frontend/views/onbase_documents/_keywords_readonly.html.erb index f7e0920..b55bf2f 100644 --- a/frontend/views/onbase_documents/_keywords_readonly.html.erb +++ b/frontend/views/onbase_documents/_keywords_readonly.html.erb @@ -1,5 +1,5 @@ <% if @keywords.empty? %> - There are no keywords stored in OnBase for this document + <%= I18n.t("plugins.onbase_document._frontend.messages.no_keywords") %> <% else %>
<% @keywords.each do |keyword_value_pairs| %> diff --git a/frontend/views/onbase_documents/_readonly.html.erb b/frontend/views/onbase_documents/_readonly.html.erb index cd819c1..9115fec 100644 --- a/frontend/views/onbase_documents/_readonly.html.erb +++ b/frontend/views/onbase_documents/_readonly.html.erb @@ -5,33 +5,33 @@ <%= form.hidden_input("ref", form.obj["ref"] || "${ref}", {:class => "onbasedocument-ref"}) %> <%= form.hidden_input("_resolved", form.obj["_resolved"] ? form.obj["_resolved"].to_json : "", {:class => "onbasedocument-resolved"}) %>
- +
<%= form.obj["_resolved"] ? form.obj["_resolved"]["document_type"] : "${_resolved.document_type}" %>
- +
<%= form.obj["_resolved"] ? form.obj["_resolved"]["onbase_id"] : "${_resolved.onbase_id}" %>
- +
<%= form.obj["_resolved"] ? form.obj["_resolved"]["filename"] : "${_resolved.filename}" %>
- +
<%= form.obj["_resolved"] ? form.obj["_resolved"]["mime_type"] : "${_resolved.mime_type}" %>

- <%= link_to " Download Document".html_safe, url_for(:controller => :onbase_documents, :action => :download, :id => onbase_document_id), {:class => "btn btn-default col-sm-6 btn-onbase-document-download", :target => "_blank"} %> + <%= link_to " #{I18n.t("plugins.onbase_document._frontend.action.download")}".html_safe, url_for(:controller => :onbase_documents, :action => :download, :id => onbase_document_id), {:class => "btn btn-default col-sm-6 btn-onbase-document-download", :target => "_blank"} %>

- +
- +
diff --git a/frontend/views/onbase_documents/_template.html.erb b/frontend/views/onbase_documents/_template.html.erb index 717e818..6b66224 100644 --- a/frontend/views/onbase_documents/_template.html.erb +++ b/frontend/views/onbase_documents/_template.html.erb @@ -8,13 +8,13 @@
<% parent_type = form.obj["jsonmodel_type"] || form.parent_context %> - +
<% end %> @@ -30,7 +30,7 @@
diff --git a/frontend/views/onbase_documents/_toolbar.html.erb b/frontend/views/onbase_documents/_toolbar.html.erb index 49e5086..6025d86 100644 --- a/frontend/views/onbase_documents/_toolbar.html.erb +++ b/frontend/views/onbase_documents/_toolbar.html.erb @@ -8,9 +8,9 @@
<%= button_delete_action url_for(:controller => :onbase_documents, :action => :unlink, :id => @onbase_document.id), { - :label => "Delete OnBase Document", - :"data-title" => "Delete OnBase Document", - :"data-message" => "This action will queue the OnBase Document to be deleted from both ArchivesSpace and OnBase. This action cannot be undone." + :label => I18n.t("plugins.onbase_document._frontend.action.delete"), + :"data-title" => I18n.t("plugins.onbase_document._frontend.action.delete"), + :"data-message" => I18n.t("plugins.onbase_document._frontend.messages.delete") } %>
diff --git a/frontend/views/onbase_documents/show.html.erb b/frontend/views/onbase_documents/show.html.erb index 9bacfc8..8c79c03 100644 --- a/frontend/views/onbase_documents/show.html.erb +++ b/frontend/views/onbase_documents/show.html.erb @@ -16,7 +16,7 @@ <% if @onbase_document['linked_record'].blank? || @onbase_document['linked_record']['ref'].blank? %>
- OnBase Document is unlinked + <%= I18n.t("plugins.onbase_document._frontend.messages.unlinked") %>
<% end %> @@ -31,7 +31,7 @@ <% if @onbase_document['linked_record'] && @onbase_document['linked_record']['_resolved'] %>
- +
<%= render_token :object => @onbase_document['linked_record']['_resolved'], :label => @onbase_document['linked_record']['_resolved']['display_string'] || @onbase_document['linked_record']['_resolved']['title'] || @onbase_document['linked_record']['_resolved']['uri'],