Skip to content

Commit

Permalink
feat: more translations
Browse files Browse the repository at this point in the history
  • Loading branch information
maehr committed Feb 16, 2024
1 parent 1ee3a94 commit 2afcc81
Show file tree
Hide file tree
Showing 31 changed files with 512 additions and 104 deletions.
427 changes: 418 additions & 9 deletions _data/translations.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _includes/collection-banner.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1 class="display-4">{{ site.title }}</h1>
</div>
{% unless site.data.theme.featured-image contains '/' %}
<div class="position-absolute bottom-0 end-0 px-2 bg-dark bg-opacity-75">
<a class="text-white fs-6" href="{{ site.data.featured_item.link | relative_url }}" title="{{ site.data.featured_item.alt | escape }}">Featured Image</a>
<a class="text-white fs-6" href="{{ site.data.featured_item.link | relative_url }}" title="{{ site.data.featured_item.alt | escape }}">{{ site.data.translations['_includes']['collection-banner.html']['featured-item'][site.lang] | default: 'Featured Image' }}</a>
</div>{% endunless %}
</div>
</div>
Expand Down
51 changes: 26 additions & 25 deletions _includes/data-download-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,81 +6,82 @@
{%- endcomment -%}

{%- assign stubs = site.data.config-nav | map: 'stub' | join: ';' -%}
<button type="button" class="btn btn-primary btn-lg float-md-end" data-bs-toggle="modal" data-bs-target="#dataModal">Download Data</button>
<button type="button" class="btn btn-primary btn-lg float-md-end" data-bs-toggle="modal" data-bs-target="#dataModal">{{ site.data.translations['_includes']['data-download-modal.html']['download'][site.lang] | default: 'Download Data' }}</button>
<!-- Modal -->
<div class="modal fade" id="dataModal" tabindex="-1" role="dialog" aria-labelledby="dataModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title" id="dataModalLabel">Collection Data</h1>
<h1 class="modal-title" id="dataModalLabel">{{ site.data.translations['_includes']['data-download-modal.html']['title'][site.lang] | default: 'Collection Data' }}</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">

<p>Download this collection's data in a variety of reusable formats.</p>
<p>{{ site.data.translations['_includes']['data-download-modal.html']['description'][site.lang] | default: 'Download this collection\'s data in a variety of reusable formats.' }}</p>

{% if site.data.theme.metadata-export-fields %}
<div class="card my-3">
<div class="card-body">
<h2 class="card-title h4">Complete Metadata</h2>
<p class="card-text">All metadata fields for all collection items, available as a CSV spreadsheet (usable in Excel, Google Sheets, and similar programs) or JSON file (often used with web applications).</p>
<a href="{{ '/assets/data/metadata.csv' | relative_url }}" class="btn btn-outline-dark" target="_blank">Metadata CSV</a>
<a href="{{ '/assets/data/metadata.json' | relative_url }}" class="btn btn-outline-dark" target="_blank">Metadata JSON</a>
<h2 class="card-title h4">{{ site.data.translations['_includes']['data-download-modal.html']['complete-metadata'][site.lang] | default: 'Complete Metadata' }}</h2>
<p class="card-text">
{{ site.data.translations['_includes']['data-download-modal.html']['metadata-description'][site.lang] | default: 'All metadata fields for all collection items, available as a CSV spreadsheet (usable in Excel, Google Sheets, and similar programs) or JSON file (often used with web applications).' }}
</p>
<a href="{{ '/assets/data/metadata.csv' | relative_url }}" class="btn btn-outline-dark" target="_blank">{{ site.data.translations['_includes']['data-download-modal.html']['metadata'][site.lang] | default: 'Metadata' }} CSV</a>
<a href="{{ '/assets/data/metadata.json' | relative_url }}" class="btn btn-outline-dark" target="_blank">{{ site.data.translations['_includes']['data-download-modal.html']['metadata'][site.lang] | default: 'Metadata' }} JSON</a>
</div>
</div>
{%- endif -%}
{% if site.data.theme.metadata-facets-fields %}
<div class="card my-3">
<div class="card-body">
<h2 class="card-title h4">Metadata Facets</h2>
<p class="card-text">List of unique values and their count for specific metadata fields, useful for understanding content of the fields.</p>
<a href="{{ '/assets/data/facets.json' | relative_url }}" class="btn btn-outline-dark" target="_blank">Facets JSON</a>
<h2 class="card-title h4">{{ site.data.translations['_includes']['data-download-modal.html']['facets'][site.lang] | default: 'Metadata Facets' }}</h2>
<p class="card-text">{{ site.data.translations['_includes']['data-download-modal.html']['facets-description'][site.lang] | default: 'List of unique values and their count for specific metadata fields, useful for understanding content of the fields.' }}</p>
<a href="{{ '/assets/data/facets.json' | relative_url }}" class="btn btn-outline-dark" target="_blank">{{ site.data.translations['_includes']['data-download-modal.html']['facets'][site.lang] | default: 'Facets' }} JSON</a>
</div>
</div>
{%- endif -%}
{% if stubs contains "subject" %}
<div class="card my-3">
<div class="card-body">
<h2 class="card-title h4">Subject Metadata</h2>
<p class="card-text">Unique values and counts of subject metadata, useful for further analyzing the content of this collection.</p>
<a href="{{ '/assets/data/subjects.csv' | relative_url }}" class="btn btn-outline-dark" target="_blank">Subjects CSV</a>
<a href="{{ '/assets/data/subjects.json' | relative_url }}" class="btn btn-outline-dark" target="_blank">Subjects JSON</a>
<h2 class="card-title h4">{{ site.data.translations['_includes']['data-download-modal.html']['subject-metadata'][site.lang] | default: 'Subject Metadata' }}</h2>
<p class="card-text">{{ site.data.translations['_includes']['data-download-modal.html']['subject-metadata-description'][site.lang] | default: 'Unique values and counts of subject metadata, useful for further analyzing the content of this collection.' }}</p>
<a href="{{ '/assets/data/subjects.csv' | relative_url }}" class="btn btn-outline-dark" target="_blank">{{ site.data.translations['_includes']['data-download-modal.html']['subject'][site.lang] | default: 'Subjects' }} CSV</a>
<a href="{{ '/assets/data/subjects.json' | relative_url }}" class="btn btn-outline-dark" target="_blank">{{ site.data.translations['_includes']['data-download-modal.html']['subject'][site.lang] | default: 'Subjects' }} JSON</a>
</div>
</div>
{% endif %}
{% if stubs contains "location" %}
<div class="card my-3">
<div class="card-body">
<h2 class="card-title h4">Locations</h2>
<p class="card-text">Unique values and counts of location metadata, useful for further visualization and analysis of this collection's place names.</p>
<a href="{{ '/assets/data/locations.csv' | relative_url }}" class="btn btn-outline-dark" target="_blank">Locations CSV</a>
<a href="{{ '/assets/data/locations.json' | relative_url }}" class="btn btn-outline-dark" target="_blank">Locations JSON</a>
<h2 class="card-title h4">{{ site.data.translations['_includes']['data-download-modal.html']['location'][site.lang] | default: 'Locations' }}</h2>
<p class="card-text">{{ site.data.translations['_includes']['data-download-modal.html']['location-description'][site.lang] | default: 'Unique values and counts of location metadata, useful for further visualization and analysis of this collection's place names.' }}</p>
<a href="{{ '/assets/data/locations.csv' | relative_url }}" class="btn btn-outline-dark" target="_blank">{{ site.data.translations['_includes']['data-download-modal.html']['location'][site.lang] | default: 'Locations' }} CSV</a>
<a href="{{ '/assets/data/locations.json' | relative_url }}" class="btn btn-outline-dark" target="_blank">{{ site.data.translations['_includes']['data-download-modal.html']['location'][site.lang] | default: 'Locations' }} JSON</a>
</div>
</div>
{%- endif -%}
{% if stubs contains "map" %}
<div class="card my-3">
<div class="card-body">
<h2 class="card-title h4">GeoJSON</h2>
<p class="card-text">Metadata for all collection items that have geographic coordinates in <a href="https://en.wikipedia.org/wiki/GeoJSON" target="_blank" rel="noopener">GeoJSON</a> format, useful for further exploration and analysis of this collection through a geographical lense.</p>
<p class="card-text">{{ site.data.translations['_includes']['data-download-modal.html']['geojson-description'][site.lang] | default: "Metadata for all collection items that have geographic coordinates in <a href='https://en.wikipedia.org/wiki/GeoJSON' target='_blank' rel='noopener'>GeoJSON</a> format, useful for further exploration and analysis of this collection through a geographical lense." }}</p>
<a href="{{ '/assets/data/geodata.json' | relative_url }}" class="btn btn-outline-dark" target="_blank">Geodata JSON</a>
</div>
</div>
{%- endif -%}
{% if stubs contains "timeline" %}
<div class="card my-3">
<div class="card-body">
<h2 class="card-title h4">Timeline</h2>
<p class="card-text">A time-focused JSON data export designed for use with <a href="https://timeline.knightlab.com/" target="_blank" rel="noopener">TimelineJS</a>.</p>
<h2 class="card-title h4">{{ site.data.translations['_includes']['data-download-modal.html']['timeline'][site.lang] | default: 'Timeline' }}</h2>
<p class="card-text">{{ site.data.translations['_includes']['data-download-modal.html']['timeline-description'][site.lang] | default: "Time-based metadata formatted for <a href='https://timeline.knightlab.com/' target='_blank' rel='noopener'>TimelineJS</a> or other applications, useful for further exploration and analysis of this collection's temporal aspects." }}</p>
<a href="{{ '/assets/data/timelinejs.json' | relative_url }}" class="btn btn-outline-dark" target="_blank">TimelineJS JSON</a>
</div>
</div>
{%- endif -%}
<div class="card my-3">
<div class="card-body">
<h2 class="card-title h4">Website Source Code</h2>
<p class="card-text">GitHub repository containing source code for this project built with <a href="https://github.com/CollectionBuilder/collectionbuilder-csv" target="_blank" rel="noopener">CollectionBuilder-CSV</a>.</p>
<a href="{{ site.source-code | default: 'https://github.com/CollectionBuilder/collectionbuilder-csv' }}" class="btn btn-outline-dark" target="_blank" rel="noopener">Source Code</a>
<h2 class="card-title h4">{{ site.data.translations['_includes']['data-download-modal.html']['source-code'][site.lang] | default: 'Source Code' }}</h2>
<p class="card-text">{{ site.data.translations['_includes']['data-download-modal.html']['source-code-description'][site.lang] | default: "GitHub repository containing source code for this project built with <a href='https://github.com/CollectionBuilder/collectionbuilder-csv' target='_blank' rel='noopener'>CollectionBuilder-CSV</a>." }}</p>
<a href="{{ site.source-code | default: 'https://github.com/CollectionBuilder/collectionbuilder-csv' }}" class="btn btn-outline-dark" target="_blank" rel="noopener">{{ site.data.translations['_includes']['data-download-modal.html']['source-code'][site.lang] | default: 'Source Code' }}</a>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h2 class="h4"><a href="{{ '/' | relative_url }}" class="text-white">{{ site.tit
</p>
{% endif %}
<p class="text-white text-md-end" id="footer-credits">
<small><em>built with</em>
<small><em>{{ site.data.translations['_includes']['footer.html']['built-with'][site.lang] | default: 'built with' }}</em>
<a href="https://collectionbuilder.github.io/" target="_blank" rel="noopener" title="CollectionBuilder">
<img src="{{ '/assets/img/collectionbuilder-logo.png' | relative_url }}" class="img-fluid" alt="CollectionBuilder" >
</a>
Expand All @@ -45,7 +45,7 @@ <h2 class="h4"><a href="{{ '/' | relative_url }}" class="text-white">{{ site.tit
</div>

<div class="col-md-12 text-center pt-3 pb-1">
<p class="text-white">Last updated {{ site.time | date: '%Y' }}</p>
<p class="text-white">{{ site.data.translations['_includes']['footer.html']['last-updated'][site.lang] | default: 'Last updated' }} {{ site.time | date: '%Y' }}</p>
</div>

</footer>
3 changes: 1 addition & 2 deletions _includes/item/3d-model-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
<model-viewer id="item-model-viewer" alt="{{ page.image_alt_text | default: page.description | default: page.title | escape }}" src="{{ page.object_location | relative_url }}" shadow-intensity="1" camera-controls touch-action="pan-y" {% if page.image_small %}reveal="manual"{% endif %}>
{% if page.image_small %}
<div id="poster-image" slot="poster"></div>
<button id="load-model-btn" class="btn btn-lg btn-primary" slot="poster">Load 3D Model</button>
{% endif %}
<button id="load-model-btn" class="btn btn-lg btn-primary" slot="poster">{{ site.data.translations['_includes']['item']['3d-model-viewer.html']['load-model'][site.lang] | default: "Load 3D Model" }}</button>{% endif %}
</model-viewer>
</div>
{% if page.image_small %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/item/audio-player.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
{%- endcomment -%}
<audio controls class="w-100">
<source src="{{ page.object_location | relative_url }}">
Your browser does not support the audio element. Please <a href="{{ page.object_location | relative_url }}">download the audio file</a>.
{{ site.data.translations['_includes']['item']['audio-player.html']['no-support'][site.lang] | default: "Your browser does not support the audio element." }} <a href="{{ page.object_location | relative_url }}">{{ site.data.translations['_includes']['item']['audio-player.html']['download'][site.lang] | default: "Download Audio" }}</a>.
</audio>
4 changes: 2 additions & 2 deletions _includes/item/breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{%- endcomment -%}
<ol class="breadcrumb">
<li class="breadcrumb-item"><a class="text-dark" href="{{ '/' | relative_url }}">Home</a></li>
<li class="breadcrumb-item"><a class="text-dark" href="{{ '/browse.html' | relative_url }}">Items</a></li>
<li class="breadcrumb-item"><a class="text-dark" href="{{ '/' | relative_url }}">{{ site.data.translations['_includes']['item']['breadcrumbs.html']['home'][site.lang] | default: "Home" }}</a></li>
<li class="breadcrumb-item"><a class="text-dark" href="{{ '/browse.html' | relative_url }}">{{ site.data.translations['_includes']['item']['breadcrumbs.html']['items'][site.lang] | default: "Items" }}</a></li>
<li class="breadcrumb-item active text-dark" aria-current="page">{{ page.title | truncatewords: 10 }}</li>
</ol>
6 changes: 3 additions & 3 deletions _includes/item/browse-buttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

{%- endcomment -%}
<div class="text-center">
<a class="btn btn-secondary" href="{{ page.previous_item | relative_url }}" id="prev-page-button">&laquo; Previous</a>
<a class="btn btn-secondary" href="{{ '/browse.html' | relative_url }}">Back to Browse</a>
<a class="btn btn-secondary" href="{{ page.next_item | relative_url }}" id="next-page-button">Next &raquo;</a>
<a class="btn btn-secondary" href="{{ page.previous_item | relative_url }}" id="prev-page-button">&laquo; {{ site.data.translations['_includes']['item']['browse-buttons.html']['previous'][site.lang] | default: "Previous" }}</a>
<a class="btn btn-secondary" href="{{ '/browse.html' | relative_url }}">{{ site.data.translations['_includes']['item']['browse-buttons.html']['back-to-browse'][site.lang] | default: "Back to Browse" }}</a>
<a class="btn btn-secondary" href="{{ page.next_item | relative_url }}" id="next-page-button">{{ site.data.translations['_includes']['item']['browse-buttons.html']['next'][site.lang] | default: "Next" }} &raquo;</a>
</div>
<div id="item-nav">
<div class="d-none d-md-block">
Expand Down
6 changes: 3 additions & 3 deletions _includes/item/child/compound-item-download-buttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
{%- endcomment -%}
<div class="btn-group my-3" role="group" aria-label="Item options">
{% if page.date %}{%- capture year -%}{% if page.date contains "-" %}{{ page.date | split: "-" | first }}{% elsif page.date contains "/" %}{{ page.date | split: "/" | last }}{% else %}{{ page.date }}{% endif %}{%- endcapture -%}
<a href="{{ year | strip | prepend: '/timeline.html#y' | relative_url }}" class="btn btn-outline-primary">View on Timeline</a>{% endif %}
<a href="{{ year | strip | prepend: '/timeline.html#y' | relative_url }}" class="btn btn-outline-primary">{{ site.data.translations['_includes']['item']['child']['compound-item-download-buttons.html']['timeline'][site.lang] | default: "View on Timeline"}}</a>{% endif %}
{% if page.latitude and page.longitude %}
<a href="{{ '/map.html?location=' | append: page.latitude | append: ',' | append: page.longitude | append: '&marker=' | append: page.objectid | relative_url }}" class="btn btn-outline-primary">View on Map</a>{% endif %}
<a href="{{ '/map.html?location=' | append: page.latitude | append: ',' | append: page.longitude | append: '&marker=' | append: page.objectid | relative_url }}" class="btn btn-outline-primary">{{ site.data.translations['_includes']['item']['child']['compound-item-download-buttons.html']['map'][site.lang] | default: "View on Map" }}</a>{% endif %}

<div class="btn-group" role="group">
<button class="btn btn-outline-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Download
{{ site.data.translations['_includes']['item']['child']['compound-item-download-buttons.html']['download'][site.lang] | default: "Download" }}
</button>
<ul class="dropdown-menu">
{% if page.object_location %}<li><a target="_blank" rel="noopener" href="{{ page.object_location | relative_url }}" class="dropdown-item">{{ page.title }} ({{ page.format | split: '/' | last | upcase }})</a></li>{% endif %}
Expand Down
Loading

0 comments on commit 2afcc81

Please sign in to comment.