Skip to content

Commit

Permalink
I18n in yo face
Browse files Browse the repository at this point in the history
  • Loading branch information
payten committed Oct 12, 2015
1 parent ffe2621 commit 8319702
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 23 deletions.
22 changes: 22 additions & 0 deletions frontend/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions frontend/views/onbase_documents/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<section id="onBaseKeywords"></section>
<% else %>
<div class="alert alert-danger">
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) %>
</div>
<% end %>

Expand All @@ -34,17 +34,17 @@

<div id="importOnBaseLog" class="alert alert-info" style="display:none">
<div>
<span class="import-onbase-step step-1" style="display:none">Transferring file...</span> <span class="import-onbase-step step-2 text-success" style="display:none">Transferred!</span>
<span class="import-onbase-step step-1" style="display:none"><%= I18n.t("plugins.onbase_document._frontend.messages.transferring_file_step_1") %></span> <span class="import-onbase-step step-2 text-success" style="display:none"><%= I18n.t("plugins.onbase_document._frontend.messages.transferring_file_step_2") %></span>
</div>
<div>
<span class="import-onbase-step step-3" style="display:none">Sending to the OnBase Service...</span> <span class="import-onbase-step step-4 text-success" style="display:none">Done!</span>
<span class="import-onbase-step step-3" style="display:none"><%= I18n.t("plugins.onbase_document._frontend.messages.transferring_file_step_3") %></span> <span class="import-onbase-step step-4 text-success" style="display:none"><%= I18n.t("plugins.onbase_document._frontend.messages.transferring_file_step_4") %></span>
</div>

<div class="import-onbase-step step-error text-danger" style="display:none">Error -- see message above.</div>
<div class="import-onbase-step step-error text-danger" style="display:none"><%= I18n.t("plugins.onbase_document._frontend.messages.transferring_file_error") %></div>
</div>
</section>
<% else %>
<div class="alert alert-error">Edit of Onbase Record not supported</div>
<div class="alert alert-error"><%= I18n.t("plugins.onbase_document._frontend.messages.edit_not_supported") %></div>
<% end %>
<%= form.hidden_input "onbase_id" %>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions frontend/views/onbase_documents/_keywords_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
</div>
<% elsif field[:type] == 'generated' %>
<div class="label-only">
<em class="text-muted">System Generated</em>
<em class="text-muted"><%= I18n.t("plugins.onbase_document._frontend.messages.system_generated") %></em>
</div>
<% else %>
Type not supported: <%= field[:type] %>
<%= I18n.t("plugins.onbase_document._frontend.messages.type_not_supported", :type => field[:type]) %>
<% end %>
</div>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if @keywords.empty? %>
<span class="text-warning">There are no keywords stored in OnBase for this document</span>
<span class="text-warning"><%= I18n.t("plugins.onbase_document._frontend.messages.no_keywords") %></span>
<% else %>
<dl>
<% @keywords.each do |keyword_value_pairs| %>
Expand Down
14 changes: 7 additions & 7 deletions frontend/views/onbase_documents/_readonly.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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"}) %>
<div class="form-group">
<label class="col-sm-2 control-label">Document Type</label>
<label class="col-sm-2 control-label"><%= I18n.t("plugins.onbase_document.document_type") %></label>
<div class="col-sm-9 label-only"><%= form.obj["_resolved"] ? form.obj["_resolved"]["document_type"] : "${_resolved.document_type}" %></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">OnBase ID</label>
<label class="col-sm-2 control-label"><%= I18n.t("plugins.onbase_document.onbase_id") %></label>
<div class="col-sm-9 label-only"><%= form.obj["_resolved"] ? form.obj["_resolved"]["onbase_id"] : "${_resolved.onbase_id}" %></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Filename</label>
<label class="col-sm-2 control-label"><%= I18n.t("plugins.onbase_document.filename") %></label>
<div class="col-sm-9 label-only"><%= form.obj["_resolved"] ? form.obj["_resolved"]["filename"] : "${_resolved.filename}" %></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Mime-Type</label>
<label class="col-sm-2 control-label"><%= I18n.t("plugins.onbase_document.mime_type") %></label>
<div class="col-sm-9 label-only"><%= form.obj["_resolved"] ? form.obj["_resolved"]["mime_type"] : "${_resolved.mime_type}" %></div>
</div>
<hr>
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-9 label-only">
<%= link_to "<span class='glyphicon glyphicon-download'></span> 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 "<span class='glyphicon glyphicon-download'></span> #{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"} %>
</div>
</div>
<hr>
<div class="form-group">
<label class="col-sm-2 control-label">Keywords</label>
<label class="col-sm-2 control-label"><%= I18n.t("plugins.onbase_document.keywords") %></label>
<div class="col-sm-9 label-only">
<button class="btn btn-xs btn-default aspace-onbase-fetch-keywords-btn" data-url="<%= url_for(:controller => :onbase_documents, :action => :keywords, :id => onbase_document_id) %>">Fetch Keywords from OnBase</button>
<button class="btn btn-xs btn-default aspace-onbase-fetch-keywords-btn" data-url="<%= url_for(:controller => :onbase_documents, :action => :keywords, :id => onbase_document_id) %>"><%= I18n.t("plugins.onbase_document._frontend.action.fetch_keywords") %></button>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions frontend/views/onbase_documents/_template.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
<div class="col-sm-2 control-label"></div>
<div class="col-sm-9">
<% parent_type = form.obj["jsonmodel_type"] || form.parent_context %>
<button data-target="<%= url_for :controller => :onbase_documents, :action => :new, :inline => true, :parent_type => parent_type %>" class="btn btn-success upload-onbase-document-btn col-sm-6"><span class="glyphicon glyphicon-upload"></span> Upload Document</button>
<button data-target="<%= url_for :controller => :onbase_documents, :action => :new, :inline => true, :parent_type => parent_type %>" class="btn btn-success upload-onbase-document-btn col-sm-6"><span class="glyphicon glyphicon-upload"></span> <%= I18n.t("plugins.onbase_document._frontend.action.upload") %></button>
</div>
</div>
<div class="form-group">
<div class="col-sm-2 control-label"></div>
<div class="col-sm-9">
<a href="javascript:void(0);" class="onbase-show-linker">Or link to an existing OnBase Document?</a>
<a href="javascript:void(0);" class="onbase-show-linker"><%= I18n.t("plugins.onbase_document._frontend.action.show_linker") %></a>
</div>
</div>
<% end %>
Expand All @@ -30,7 +30,7 @@
<div id="aspace_onbase_upload_template"><!--
<div class="modal-body upload-onbase-document-container"></div>
<div class="modal-footer">
<button id="uploadAndLinkOnBaseDocumentButton" class="btn btn-primary">Upload and Link to OnBase Document</button>
<button id="uploadAndLinkOnBaseDocumentButton" class="btn btn-primary"><%= I18n.t("plugins.onbase_document._frontend.action.upload_and_link") %></button>
<button class="btn btn-cancel btn-default" data-dismiss="modal"><%= I18n.t "actions.cancel" %></button>
</div>
--></div>
6 changes: 3 additions & 3 deletions frontend/views/onbase_documents/_toolbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<div class="btn btn-inline-form pull-right">
<%= 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")
}
%>
</div>
Expand Down
4 changes: 2 additions & 2 deletions frontend/views/onbase_documents/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<% if @onbase_document['linked_record'].blank? || @onbase_document['linked_record']['ref'].blank? %>
<div class="alert alert-warning">
OnBase Document is unlinked
<%= I18n.t("plugins.onbase_document._frontend.messages.unlinked") %>
</div>
<% end %>

Expand All @@ -31,7 +31,7 @@
<% if @onbase_document['linked_record'] && @onbase_document['linked_record']['_resolved'] %>
<hr>
<div class="form-group">
<label class="col-sm-2 control-label">Linked Record</label>
<label class="col-sm-2 control-label"><%= I18n.t("plugins.onbase_document.linked_record") %></label>
<div class="col-sm-9 token-list">
<%= 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'],
Expand Down

0 comments on commit 8319702

Please sign in to comment.