Skip to content

Commit

Permalink
adds additional i18n translations
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbattista committed Aug 2, 2018
1 parent 76641bc commit 53418c4
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 27 deletions.
10 changes: 5 additions & 5 deletions app/views/catalog/_home_text.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@
<div class='category-icon'>
<span class='glyphicon glyphicon-home'></span>
</div>
<h4>Institution</h4>
<%= content_tag :h4, t('geoblacklight.home.institution'), class: 'text-center' %>
<%= render_facet_tags [Settings.FIELDS.PROVENANCE] %>
</div>
<div class='category-block'>
<div class='category-icon'>
<span class='glyphicon glyphicon-download'></span>
</div>
<h4>Data type</h4>
<%= content_tag :h4, t('geoblacklight.home.data_type'), class: 'text-center' %>
<%= render_facet_tags [Settings.FIELDS.GEOM_TYPE] %>
</div>
<div class='category-block'>
<div class='category-icon'>
<span class='glyphicon glyphicon-globe'></span>
</div>
<h4>Placename</h4>
<%= content_tag :h4, t('geoblacklight.home.placename'), class: 'text-center' %>
<%= render_facet_tags [Settings.FIELDS.SPATIAL_COVERAGE] %>
</div>
<div class='category-block'>
<div class='category-icon'>
<span class='glyphicon glyphicon-tags'></span>
</div>
<h4>Subject</h4>
<%= content_tag :h4, t('geoblacklight.home.subject'), class: 'text-center' %>
<%= render_facet_tags [Settings.FIELDS.SUBJECT] %>
</div>
</div>
Expand All @@ -48,4 +48,4 @@
<%= content_tag :div, '', id: 'map', data: { map: 'home', 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %>
</div>
</div>
</div>
</div>
6 changes: 3 additions & 3 deletions app/views/catalog/_show_default_attribute_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<table id="attribute-table" class="table table-hover table-condensed table-responsive table-striped table-bordered col-md-12">
<thead>
<tr>
<th>Attribute</th>
<th>Value</th>
<th><%= t('geoblacklight.show.attribute') %></th>
<th><%= t('geoblacklight.show.value') %></th>
</tr>
</thead>
<tbody class='attribute-table-body'>
<tr>
<td class='default-text' colspan='2'><em>Click on map to inspect values</em></td>
<td class='default-text' colspan='2'><em><%= t('geoblacklight.show.click_map') %></em></td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_upper_metadata.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<% end %>
<% end %>
<% if !@document.references.nil? && !@document.references.url.nil? %>
<dt>More details at</dt>
<dt><%= t('geoblacklight.metadata.more_details') %></dt>
<dd itemprop="url"><%= link_to @document.references.url.endpoint, @document.references.url.endpoint %></dd>
<% end %>
</dl>
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_web_services_wfs.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<%= render partial: 'web_services_default', locals: { reference: reference } %>

<div class='form-group form-inline'>
<label class='control-label'>WFS <code>typeNames</code></label>
<label class='control-label'><%= t('geoblacklight.references.wfs_abv')%> <code><%= t('geoblacklight.references.wfs_label')%></code></label>
<input type='text' value='<%= document.wxs_identifier %>' readonly='readonly' class='form-control'>
</div>
2 changes: 1 addition & 1 deletion app/views/catalog/_web_services_wms.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<%= render partial: 'web_services_default', locals: { reference: reference } %>

<div class='form-group form-inline'>
<label class='control-label'>WMS <code>layers</code></label>
<label class='control-label'><%= t('geoblacklight.references.wms_abv')%> <code><%= t('geoblacklight.references.wms_label')%></code></label>
<input type='text' value='<%= document.wxs_identifier %>' readonly='readonly' class='form-control'>
</div>
2 changes: 1 addition & 1 deletion app/views/catalog/metadata.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="modal-header">
<button type="button" class="ajax-modal-close close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 class="modal-title">View Metadata</h3>
<h3 class="modal-title"><%= t('geoblacklight.metadata.view_metadata')%></h3>
</div>
<div class="modal-body metadata-body">
<%= render partial: 'metadata' %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/metadata/_markup.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="alert alert-warning" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Error:</span>
<span>The metadata for this item cannot be transformed.</span>
<span><%= t('geoblacklight.metadata.metadata_error')%></span>
</div>
<%= CodeRay.scan(content, :xml).div.html_safe %>
</div>
4 changes: 2 additions & 2 deletions app/views/catalog/metadata/_missing.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="metadata-error-container" class="container-fluid">
<div>
<h1>The metadata for this item doesn't exist.</h1>
<h1><%= t('geoblacklight.metadata.metadata_error')%></h1>
</div>
<p>If you are the application owner check the logs for more information.</p>
<p><%= t('geoblacklight.metadata.metadata_trace')%></p>
</div>
4 changes: 2 additions & 2 deletions app/views/catalog/web_services.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class="modal-header">
<button type="button" class="ajax-modal-close close" data-dismiss="modal" aria-hidden="true">×</button>
<h1 class="modal-title">Web services</h1>
<h1 class="modal-title"><%= t('geoblacklight.references.services')%></h1>
<div class="modal-body">
<%= render partial: 'web_services' %>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default hide-without-js" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-default hide-without-js" data-dismiss="modal"><%= t('geoblacklight.references.services_close')%></button>
</div>
</div>
12 changes: 6 additions & 6 deletions app/views/download/hgl.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Request Layer</h4>
<%= content_tag :h4, t('geoblacklight.download.hgl_request'), class: 'text-center' %>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form" id="hglRequest">
<p>Please enter your email address. You will receive a link to download the layer when it is ready.</p>
<p><%= t('geoblacklight.download.hgl_instructions')%></p>
<div class="form-group">
<label for="requestEmail" class="col-sm-2 control-label">Email</label>
<label for="requestEmail" class="col-sm-2 control-label"><%= t('geoblacklight.download.hgl_email')%></label>
<div class="col-sm-6">
<input class="form-control" type="email" id="requestEmail" />
</div>
<input type="hidden" id="requestUrl"
value="<%= download_hgl_path(id: @document) %>" />
<div class="col-sm-2">
<button type="submit" class="btn btn-primary">Request</button>
<button type="submit" class="btn btn-primary"><%= t('geoblacklight.download.hgl_request_button')%></button>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t('geoblacklight.download.hgl_close')%></button>
</div>
28 changes: 26 additions & 2 deletions config/locales/geoblacklight.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ en:
download: 'Download'
download_link: 'Original %{download_format}'
success: 'Your file %{title} is ready for download'
hgl_success: 'You should receive an email when your download is ready'
hgl_success: 'You should receive an email when your download is ready.'
hgl_request: 'Request Layer'
hgl_request_button: 'Request'
hgl_close: 'Close'
hgl_instructions: 'Please enter your email address. You will receive a link to download the layer when it is ready.' ## new variable
hgl_email: 'Email'
error: 'Sorry, the requested file could not be downloaded'
error_with_url: 'Sorry, the requested file could not be downloaded, try downloading it directly from: %{link}'
error_with_url: 'Sorry, the requested file could not be downloaded. Try downloading it directly from: %{link}'
export_formats: 'Export Formats'
export_link: 'Export'
export_shapefile_link: 'EPSG:4326 Shapefile'
Expand All @@ -18,6 +23,10 @@ en:
search_heading: 'Find the maps and data you need'
category_heading: 'Find by...'
map_heading: 'Find by location'
institution: 'Institution'
data_type: 'Data type'
placename: 'Placename'
subject: 'Subject'
tools:
login_to_view: 'Login to view and download'
open_carto: 'Open in Carto'
Expand All @@ -32,7 +41,11 @@ en:
sqlite_database: 'SQLite Database'
references:
wms: 'Web Mapping Service (WMS)'
wms_abv: 'WMS'
wms_label: 'layers'
wfs: 'Web Feature Service (WFS)'
wfs_abv: 'WFS'
wfs_label: 'typeNames'
iiif: 'International Image Interoperability Framework (IIIF)'
iso19139: 'ISO 19139'
mods: 'MODS'
Expand All @@ -43,8 +56,19 @@ en:
dynamic_map_layer: 'ArcGIS Dynamic Map Layer'
image_map_layer: 'ArcGIS Image Map Layer'
data_dictionary: 'Documentation'
services: 'Web services'
services_close: 'Close'
relations:
ancestor: 'Source Datasets'
descendant: 'Derived Datasets (%{count})'
browse_all: "Browse all %{count} records..."
title: 'Data Relations'
metadata:
view_metadata: 'View Metadata'
more_details: 'More details at'
metadata_error: 'The metadata view for selected schema is not available'
metadata_trace: 'Please select another metadata view. Alternately, try downloading the file or reaching out to the holding institution.'
show:
attribute: 'Attribute'
value: 'Value'
click_map: 'Click on map to inspect values'
2 changes: 1 addition & 1 deletion spec/features/download_layer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
expect(shapefile_download).to receive(:get).and_raise(Geoblacklight::Exceptions::ExternalDownloadFailed.new(message: 'Failed', url: 'http://www.example.com/failed'))
visit solr_document_path('mit-us-ma-e25zcta5dct-2000')
find('a[data-download-type="shapefile"]', text: 'Export').click
expect(page).to have_css 'div.alert.alert-danger', text: 'Sorry, the requested file could not be downloaded, try downloading it directly from:'
expect(page).to have_css 'div.alert.alert-danger', text: 'Sorry, the requested file could not be downloaded. Try downloading it directly from:'
expect(page).to have_css 'a', text: 'http://www.example.com/failed'
end
scenario 'clicking kmz download button should trigger download', js: true do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/web_services_modal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
expect(page).to have_css 'input', count: 4
expect(page).to have_css 'label', text: 'Web Feature Service (WFS)'
expect(page).to have_css 'input[value="http://geowebservices-restricted.stanford.edu/geoserver/wfs"]'
expect(page).to have_css 'label', text: 'WFS typeNames'
expect(page).to have_css 'label', text: 'Web Feature Service (WFS)'
expect(page).to have_css 'input[value="druid:cg357zz0321"]', count: 2
expect(page).to have_css 'label', text: 'Web Mapping Service (WMS)'
expect(page).to have_css 'input[value="http://geowebservices-restricted.stanford.edu/geoserver/wms"]'
Expand Down

0 comments on commit 53418c4

Please sign in to comment.