add translation system to pygeoapi (#725)

* adds translation keys to templates

* adds translation keys to templates

* suggestions from github pr 2
This commit is contained in:
paul van genuchten
2021-08-23 02:42:10 +02:00
committed by GitHub
parent bc97ed480a
commit 995ab2f04d
22 changed files with 1004 additions and 112 deletions
+3
View File
@@ -0,0 +1,3 @@
[python: **.py]
[jinja2: **/templates/**.html]
extensions=jinja2.ext.i18n,jinja2.ext.autoescape,jinja2.ext.with_
+32
View File
@@ -154,6 +154,38 @@ those values will be returned. However, if a `fr-CH` tag can also be found, that
.. todo:: Add docs on HTML templating.
Translator guide
----------------
Hardcoded strings in pygeoapi templates are translated using the Babel translation system.
Translation files are stored on the /locale folder.
Translators can follow these steps to prepare their environment for translations.
1. Extract from latest code the keys to be translated. These keys are captured in a .pot file.
.. code-block:: bash
pybabel extract -F babel-mapping.ini -o locale/messages.pot ./
2. Update the existing .po language file:
.. code-block:: bash
pybabel update -d locale -l fr -i locale/messages.pot
3. Open the relevant .po file and contribute your translations. Then compile a .mo file to be used by the application:
.. code-block:: bash
pybabel compile -d locale -l fr
Within jinja templates keys are prepared to be translated by wrapping them in:
.. code-block:: python
{% trans %}Key{% endtrans %}
Developer guide
---------------
+32
View File
@@ -0,0 +1,32 @@
# Howto set up language files
Inspired by https://phrase.com/blog/posts/i18n-advantages-babel-python/#Integration_with_Jinja2_templates
Add translate statements to jinja2 templates
```
<title>{% trans %}Page title{% endtrans %}</title>
```
To parse the jinja templates to extract the messages, first
create a file named `babel-mapping.ini`:
```
[python: **.py]
[jinja2: **/templates/**.html]
extensions=jinja2.ext.i18n,jinja2.ext.autoescape,jinja2.ext.with_
```
Then extract the base messages from templates:
> pybabel extract -F babel-mapping.ini -o locale/messages.pot ./
This file is not persisted on github.
Now setup a new language (french) using the init command:
> pybabel init -d locale -l fr -i locale/messages.pot
Or update an existing language using:
> pybabel update -d locale -l fr -i locale/messages.pot
Run compile command to generate MO files:
> pybabel compile -d locale -l fr
+171
View File
@@ -0,0 +1,171 @@
# German translations for PROJECT.
# Copyright (C) 2021 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2021.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-07-10 23:50+0200\n"
"PO-Revision-Date: 2021-07-11 00:15+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: de\n"
"Language-Team: de <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: pygeoapi/templates/conformance.html:2 pygeoapi/templates/conformance.html:4
#: pygeoapi/templates/conformance.html:8
#: pygeoapi/templates/landing_page.html:78
msgid "Conformance"
msgstr "Konformität"
#: pygeoapi/templates/exception.html:2 pygeoapi/templates/exception.html:5
msgid "Exception"
msgstr "Fehler"
#: pygeoapi/templates/landing_page.html:2
msgid "Home"
msgstr "Heim"
#: pygeoapi/templates/landing_page.html:25
msgid "Terms of service"
msgstr "Nutzungsbedingungen"
#: pygeoapi/templates/landing_page.html:35
msgid "License"
msgstr "Lizenz"
#: pygeoapi/templates/collections/items/index.html:4
#: pygeoapi/templates/collections/items/item.html:25
#: pygeoapi/templates/landing_page.html:47
msgid "Collections"
msgstr "Kollektionen"
#: pygeoapi/templates/landing_page.html:49
msgid "View the collections in this service"
msgstr ""
#: pygeoapi/templates/landing_page.html:54
msgid "SpatioTemporal Assets"
msgstr ""
#: pygeoapi/templates/landing_page.html:56
msgid "View the SpatioTemporal Assets in this service"
msgstr ""
#: pygeoapi/templates/landing_page.html:62
msgid "Processes"
msgstr ""
#: pygeoapi/templates/landing_page.html:64
msgid "View the processes in this service"
msgstr ""
#: pygeoapi/templates/landing_page.html:69
msgid "API Definition"
msgstr ""
#: pygeoapi/templates/landing_page.html:71
msgid "Documentation"
msgstr ""
#: pygeoapi/templates/landing_page.html:71
msgid "Swagger UI"
msgstr ""
#: pygeoapi/templates/landing_page.html:71
msgid "ReDoc"
msgstr ""
#: pygeoapi/templates/landing_page.html:74
msgid "OpenAPI Document"
msgstr ""
#: pygeoapi/templates/landing_page.html:80
msgid "View the conformance classes of this service"
msgstr ""
#: pygeoapi/templates/landing_page.html:87
msgid "Provider"
msgstr ""
#: pygeoapi/templates/landing_page.html:96
msgid "Contact point"
msgstr ""
#: pygeoapi/templates/landing_page.html:99
msgid "Address"
msgstr ""
#: pygeoapi/templates/landing_page.html:108
msgid "Email"
msgstr ""
#: pygeoapi/templates/landing_page.html:111
msgid "Telephone"
msgstr ""
#: pygeoapi/templates/landing_page.html:115
msgid "Fax"
msgstr ""
#: pygeoapi/templates/landing_page.html:119
msgid "Contact URL"
msgstr ""
#: pygeoapi/templates/landing_page.html:123
msgid "Hours"
msgstr ""
#: pygeoapi/templates/landing_page.html:127
msgid "Contact instructions"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:11
#: pygeoapi/templates/collections/items/item.html:31
msgid "Items"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:22
msgid "Items in this collection"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:35
msgid "Warning: Higher limits not recommended!"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:40
msgid "Limit"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:42
msgid "default"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:62
#: pygeoapi/templates/collections/items/item.html:60
msgid "Prev"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:64
#: pygeoapi/templates/collections/items/item.html:62
msgid "Next"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:114
msgid "No items"
msgstr ""
#: pygeoapi/templates/collections/items/item.html:75
msgid "Property"
msgstr ""
#: pygeoapi/templates/collections/items/item.html:76
msgid "Value"
msgstr ""
+323
View File
@@ -0,0 +1,323 @@
# English translations for pygeoapi.
# Copyright (C) 2021 OSGeo
# This file is distributed under the same license as the pygeoapi project.
# FIRST AUTHOR Tom Kralidis, 2020.
#
msgid ""
msgstr ""
"Project-Id-Version: 0.11\n"
"Report-Msgid-Bugs-To: pygeoapi@lists.osgeo.org\n"
"POT-Creation-Date: 2021-07-10 23:50+0200\n"
"PO-Revision-Date: 2021-07-11 00:15+0200\n"
"Last-Translator: Paul van Genuchten\n"
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: pygeoapi/templates/_base.html:40 pygeoapi/templates/landing_page.html:2
msgid "Home"
msgstr ""
#: pygeoapi/templates/_base.html:48 pygeoapi/templates/_base.html:56
msgid "json"
msgstr ""
#: pygeoapi/templates/_base.html:51 pygeoapi/templates/_base.html:59
msgid "jsonld"
msgstr "json-ld"
#: pygeoapi/templates/_base.html:76
msgid "prePoweredBy"
msgstr "Powered by"
#: pygeoapi/templates/_base.html:76
msgid "postPoweredBy"
msgstr " "
#: pygeoapi/templates/conformance.html:2 pygeoapi/templates/conformance.html:4
#: pygeoapi/templates/conformance.html:8
#: pygeoapi/templates/landing_page.html:78
msgid "Conformance"
msgstr ""
#: pygeoapi/templates/exception.html:2 pygeoapi/templates/exception.html:5
msgid "Exception"
msgstr ""
#: pygeoapi/templates/landing_page.html:25
msgid "Terms of service"
msgstr ""
#: pygeoapi/templates/landing_page.html:35
msgid "License"
msgstr ""
#: pygeoapi/templates/collections/coverage/rangetype.html:4
#: pygeoapi/templates/collections/edr/query.html:4
#: pygeoapi/templates/collections/items/index.html:4
#: pygeoapi/templates/collections/items/item.html:25
#: pygeoapi/templates/collections/tiles/index.html:4
#: pygeoapi/templates/collections/tiles/metadata.html:4
#: pygeoapi/templates/landing_page.html:47
msgid "Collections"
msgstr ""
#: pygeoapi/templates/landing_page.html:49
msgid "View the collections in this service"
msgstr ""
#: pygeoapi/templates/landing_page.html:54
msgid "SpatioTemporal Assets"
msgstr ""
#: pygeoapi/templates/landing_page.html:56
msgid "View the SpatioTemporal Assets in this service"
msgstr ""
#: pygeoapi/templates/landing_page.html:62
#: pygeoapi/templates/processes/process.html:4
msgid "Processes"
msgstr ""
#: pygeoapi/templates/landing_page.html:64
msgid "View the processes in this service"
msgstr ""
#: pygeoapi/templates/landing_page.html:69
msgid "API Definition"
msgstr ""
#: pygeoapi/templates/landing_page.html:71
msgid "Documentation"
msgstr ""
#: pygeoapi/templates/landing_page.html:71
msgid "Swagger UI"
msgstr ""
#: pygeoapi/templates/landing_page.html:71
msgid "ReDoc"
msgstr ""
#: pygeoapi/templates/landing_page.html:74
msgid "OpenAPI Document"
msgstr ""
#: pygeoapi/templates/landing_page.html:80
msgid "View the conformance classes of this service"
msgstr ""
#: pygeoapi/templates/landing_page.html:87
msgid "Provider"
msgstr ""
#: pygeoapi/templates/landing_page.html:96
msgid "Contact point"
msgstr ""
#: pygeoapi/templates/landing_page.html:99
msgid "Address"
msgstr ""
#: pygeoapi/templates/landing_page.html:108
msgid "Email"
msgstr ""
#: pygeoapi/templates/landing_page.html:111
msgid "Telephone"
msgstr ""
#: pygeoapi/templates/landing_page.html:115
msgid "Fax"
msgstr ""
#: pygeoapi/templates/landing_page.html:119
msgid "Contact URL"
msgstr ""
#: pygeoapi/templates/landing_page.html:123
msgid "Hours"
msgstr ""
#: pygeoapi/templates/landing_page.html:127
msgid "Contact instructions"
msgstr ""
#: pygeoapi/templates/collections/coverage/rangetype.html:11
msgid "Coverage range type"
msgstr ""
#: pygeoapi/templates/collections/coverage/rangetype.html:12
msgid "Fields"
msgstr ""
#: pygeoapi/templates/collections/edr/query.html:11
#: pygeoapi/templates/collections/items/index.html:11
#: pygeoapi/templates/collections/items/item.html:31
msgid "Items"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:22
msgid "Items in this collection"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:35
msgid "Warning: Higher limits not recommended!"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:40
msgid "Limit"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:42
msgid "default"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:62
#: pygeoapi/templates/collections/items/item.html:60
msgid "Prev"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:64
#: pygeoapi/templates/collections/items/item.html:62
msgid "Next"
msgstr ""
#: pygeoapi/templates/collections/items/index.html:114
msgid "No items"
msgstr ""
#: pygeoapi/templates/collections/items/item.html:75
#: pygeoapi/templates/stac/item.html:58
msgid "Property"
msgstr ""
#: pygeoapi/templates/collections/items/item.html:76
#: pygeoapi/templates/stac/item.html:59
msgid "Value"
msgstr ""
#: pygeoapi/templates/collections/tiles/index.html:6
#: pygeoapi/templates/collections/tiles/metadata.html:6
msgid "Tiles"
msgstr ""
#: pygeoapi/templates/collections/tiles/index.html:31
msgid "Tile Matrix Set"
msgstr ""
#: pygeoapi/templates/collections/tiles/index.html:42
msgid "Metadata"
msgstr ""
#: pygeoapi/templates/collections/tiles/metadata.html:18
msgid "Tiles metadata"
msgstr ""
#: pygeoapi/templates/collections/tiles/metadata.html:18
msgid "format"
msgstr ""
#: pygeoapi/templates/collections/tiles/metadata.html:19
msgid "Tileset"
msgstr ""
#: pygeoapi/templates/processes/process.html:20
msgid "Inputs"
msgstr ""
#: pygeoapi/templates/processes/process.html:23
#: pygeoapi/templates/processes/process.html:62
msgid "Id"
msgstr ""
#: pygeoapi/templates/processes/process.html:24
#: pygeoapi/templates/processes/process.html:63
msgid "Title"
msgstr ""
#: pygeoapi/templates/processes/process.html:25
msgid "Data Type"
msgstr ""
#: pygeoapi/templates/processes/process.html:26
#: pygeoapi/templates/processes/process.html:64
#: pygeoapi/templates/stac/collection.html:18
msgid "Description"
msgstr ""
#: pygeoapi/templates/processes/process.html:59
msgid "Outputs"
msgstr ""
#: pygeoapi/templates/processes/process.html:79
msgid "Execution modes"
msgstr ""
#: pygeoapi/templates/processes/process.html:81
msgid "Synchronous"
msgstr ""
#: pygeoapi/templates/processes/process.html:82
msgid "Asynchronous"
msgstr ""
#: pygeoapi/templates/processes/process.html:84
msgid "Jobs"
msgstr ""
#: pygeoapi/templates/processes/process.html:85
msgid "Browse jobs"
msgstr ""
#: pygeoapi/templates/processes/process.html:86
msgid "Links"
msgstr ""
#: pygeoapi/templates/stac/catalog.html:4
#: pygeoapi/templates/stac/collection.html:2
#: pygeoapi/templates/stac/collection.html:4
#: pygeoapi/templates/stac/item.html:4
msgid "SpatioTemporal Asset Catalog"
msgstr ""
#: pygeoapi/templates/stac/catalog.html:17
#: pygeoapi/templates/stac/collection.html:17
msgid "Name"
msgstr ""
#: pygeoapi/templates/stac/catalog.html:18
msgid "Last modified"
msgstr ""
#: pygeoapi/templates/stac/catalog.html:19 pygeoapi/templates/stac/item.html:34
msgid "Size"
msgstr ""
#: pygeoapi/templates/stac/collection.html:9
msgid "STAC Version"
msgstr ""
#: pygeoapi/templates/stac/item.html:19
msgid "Item"
msgstr ""
#: pygeoapi/templates/stac/item.html:28
msgid "Assets"
msgstr ""
#: pygeoapi/templates/stac/item.html:32
msgid "URL"
msgstr ""
#: pygeoapi/templates/stac/item.html:33
msgid "Last Modified"
msgstr ""
#: pygeoapi/templates/stac/item.html:64
msgid "id"
msgstr ""
+325
View File
@@ -0,0 +1,325 @@
# French translations for pygeoapi.
# Copyright (C) 2021 OSGeo
# This file is distributed under the same license as the pygeoapi project.
# FIRST AUTHOR Paul van Genuchten, 2021.
#
msgid ""
msgstr ""
"Project-Id-Version: 0.11\n"
"Report-Msgid-Bugs-To: pygeoapi@lists.osgeo.org\n"
"POT-Creation-Date: 2021-07-10 23:50+0200\n"
"PO-Revision-Date: 2021-07-11 00:15+0200\n"
"Last-Translator: Paul van Genuchten\n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: pygeoapi/templates/_base.html:40 pygeoapi/templates/landing_page.html:2
msgid "Home"
msgstr "Domicile"
#: pygeoapi/templates/_base.html:48 pygeoapi/templates/_base.html:56
msgid "json"
msgstr "json"
#: pygeoapi/templates/_base.html:51 pygeoapi/templates/_base.html:59
msgid "jsonld"
msgstr "json-ld"
#: pygeoapi/templates/_base.html:76
msgid "prePoweredBy"
msgstr "propulsé par"
#: pygeoapi/templates/_base.html:76
msgid "postPoweredBy"
msgstr ""
#: pygeoapi/templates/conformance.html:2 pygeoapi/templates/conformance.html:4
#: pygeoapi/templates/conformance.html:8
#: pygeoapi/templates/landing_page.html:78
msgid "Conformance"
msgstr "Conformité"
#: pygeoapi/templates/exception.html:2 pygeoapi/templates/exception.html:5
msgid "Exception"
msgstr "Exception"
#: pygeoapi/templates/landing_page.html:25
msgid "Terms of service"
msgstr "Conditions d'utilisation"
#: pygeoapi/templates/landing_page.html:35
msgid "License"
msgstr "Licence"
#: pygeoapi/templates/collections/coverage/rangetype.html:4
#: pygeoapi/templates/collections/edr/query.html:4
#: pygeoapi/templates/collections/items/index.html:4
#: pygeoapi/templates/collections/items/item.html:25
#: pygeoapi/templates/collections/tiles/index.html:4
#: pygeoapi/templates/collections/tiles/metadata.html:4
#: pygeoapi/templates/landing_page.html:47
msgid "Collections"
msgstr "Collections"
#: pygeoapi/templates/landing_page.html:49
msgid "View the collections in this service"
msgstr "Voir les collections de ce service"
#: pygeoapi/templates/landing_page.html:54
msgid "SpatioTemporal Assets"
msgstr "Actifs spatiotemporels"
#: pygeoapi/templates/landing_page.html:56
msgid "View the SpatioTemporal Assets in this service"
msgstr "Afficher les actifs spatiotemporels dans ce service"
#: pygeoapi/templates/landing_page.html:62
#: pygeoapi/templates/processes/process.html:4
msgid "Processes"
msgstr "Processus"
#: pygeoapi/templates/landing_page.html:64
msgid "View the processes in this service"
msgstr "Afficher les processus de ce service"
#: pygeoapi/templates/landing_page.html:69
msgid "API Definition"
msgstr ""
#: pygeoapi/templates/landing_page.html:71
msgid "Documentation"
msgstr ""
#: pygeoapi/templates/landing_page.html:71
msgid "Swagger UI"
msgstr ""
#: pygeoapi/templates/landing_page.html:71
msgid "ReDoc"
msgstr ""
#: pygeoapi/templates/landing_page.html:74
msgid "OpenAPI Document"
msgstr ""
#: pygeoapi/templates/landing_page.html:80
msgid "View the conformance classes of this service"
msgstr "Afficher les classes de conformité de ce service"
#: pygeoapi/templates/landing_page.html:87
msgid "Provider"
msgstr ""
#: pygeoapi/templates/landing_page.html:96
msgid "Contact point"
msgstr "Point de contact"
#: pygeoapi/templates/landing_page.html:99
msgid "Address"
msgstr ""
#: pygeoapi/templates/landing_page.html:108
msgid "Email"
msgstr ""
#: pygeoapi/templates/landing_page.html:111
msgid "Telephone"
msgstr ""
#: pygeoapi/templates/landing_page.html:115
msgid "Fax"
msgstr ""
#: pygeoapi/templates/landing_page.html:119
msgid "Contact URL"
msgstr "URL de contact"
#: pygeoapi/templates/landing_page.html:123
msgid "Hours"
msgstr "Les heures"
#: pygeoapi/templates/landing_page.html:127
msgid "Contact instructions"
msgstr "Coordonnées"
#: pygeoapi/templates/collections/coverage/rangetype.html:11
msgid "Coverage range type"
msgstr ""
#: pygeoapi/templates/collections/coverage/rangetype.html:12
msgid "Fields"
msgstr "les champs"
#: pygeoapi/templates/collections/edr/query.html:11
#: pygeoapi/templates/collections/items/index.html:11
#: pygeoapi/templates/collections/items/item.html:31
msgid "Items"
msgstr "Articles"
#: pygeoapi/templates/collections/items/index.html:22
msgid "Items in this collection"
msgstr "Articles de cette collection"
#: pygeoapi/templates/collections/items/index.html:35
msgid "Warning: Higher limits not recommended!"
msgstr "Attention : limites supérieures non recommandées ! "
#: pygeoapi/templates/collections/items/index.html:40
msgid "Limit"
msgstr "Limite"
#: pygeoapi/templates/collections/items/index.html:42
msgid "default"
msgstr "Defaut"
#: pygeoapi/templates/collections/items/index.html:62
#: pygeoapi/templates/collections/items/item.html:60
msgid "Prev"
msgstr "Précédent"
#: pygeoapi/templates/collections/items/index.html:64
#: pygeoapi/templates/collections/items/item.html:62
msgid "Next"
msgstr "Suivant"
#: pygeoapi/templates/collections/items/index.html:114
msgid "No items"
msgstr "Pas d'objet"
#: pygeoapi/templates/collections/items/item.html:75
#: pygeoapi/templates/stac/item.html:58
msgid "Property"
msgstr "Propriété"
#: pygeoapi/templates/collections/items/item.html:76
#: pygeoapi/templates/stac/item.html:59
msgid "Value"
msgstr "Valeur"
#: pygeoapi/templates/collections/tiles/index.html:6
#: pygeoapi/templates/collections/tiles/metadata.html:6
msgid "Tiles"
msgstr ""
#: pygeoapi/templates/collections/tiles/index.html:31
msgid "Tile Matrix Set"
msgstr ""
#: pygeoapi/templates/collections/tiles/index.html:42
msgid "Metadata"
msgstr "Métadonnées"
#: pygeoapi/templates/collections/tiles/metadata.html:18
msgid "Tiles metadata"
msgstr "Métadonnées"
#: pygeoapi/templates/collections/tiles/metadata.html:18
msgid "format"
msgstr ""
#: pygeoapi/templates/collections/tiles/metadata.html:19
msgid "Tileset"
msgstr ""
#: pygeoapi/templates/processes/process.html:20
msgid "Inputs"
msgstr "Les entrées"
#: pygeoapi/templates/processes/process.html:23
#: pygeoapi/templates/processes/process.html:62
msgid "Id"
msgstr "Identifiant"
#: pygeoapi/templates/processes/process.html:24
#: pygeoapi/templates/processes/process.html:63
msgid "Title"
msgstr "Titre"
#: pygeoapi/templates/processes/process.html:25
msgid "Data Type"
msgstr "Type de données"
#: pygeoapi/templates/processes/process.html:26
#: pygeoapi/templates/processes/process.html:64
#: pygeoapi/templates/stac/collection.html:18
#, fuzzy
msgid "Description"
msgstr "Exception"
#: pygeoapi/templates/processes/process.html:59
msgid "Outputs"
msgstr "Les sorties"
#: pygeoapi/templates/processes/process.html:79
msgid "Execution modes"
msgstr "Mode d'exécution"
#: pygeoapi/templates/processes/process.html:81
msgid "Synchronous"
msgstr "Synchrone"
#: pygeoapi/templates/processes/process.html:82
msgid "Asynchronous"
msgstr "Asynchrone"
#: pygeoapi/templates/processes/process.html:84
msgid "Jobs"
msgstr "Les tâches"
#: pygeoapi/templates/processes/process.html:85
msgid "Browse jobs"
msgstr "Parcourir les tâches"
#: pygeoapi/templates/processes/process.html:86
msgid "Links"
msgstr "Liens"
#: pygeoapi/templates/stac/catalog.html:4
#: pygeoapi/templates/stac/collection.html:2
#: pygeoapi/templates/stac/collection.html:4
#: pygeoapi/templates/stac/item.html:4
#, fuzzy
msgid "SpatioTemporal Asset Catalog"
msgstr "Actifs spatiotemporels"
#: pygeoapi/templates/stac/catalog.html:17
#: pygeoapi/templates/stac/collection.html:17
msgid "Name"
msgstr "Nom"
#: pygeoapi/templates/stac/catalog.html:18
msgid "Last modified"
msgstr "Dernière modification"
#: pygeoapi/templates/stac/catalog.html:19 pygeoapi/templates/stac/item.html:34
msgid "Size"
msgstr "Taille"
#: pygeoapi/templates/stac/collection.html:9
msgid "STAC Version"
msgstr ""
#: pygeoapi/templates/stac/item.html:19
msgid "Item"
msgstr "Objet"
#: pygeoapi/templates/stac/item.html:28
msgid "Assets"
msgstr "Actifs"
#: pygeoapi/templates/stac/item.html:32
msgid "URL"
msgstr ""
#: pygeoapi/templates/stac/item.html:33
msgid "Last Modified"
msgstr "Dernière modification"
#: pygeoapi/templates/stac/item.html:64
msgid "id"
msgstr "identifiant"
+6 -6
View File
@@ -37,7 +37,7 @@
<div class="sticky row crumbs">
<div class="col-sm-12 col-md-10 col-md-offset-1">
{% block crumbs %}
<a href="{{ config['server']['url'] }}">Home</a>
<a href="{{ config['server']['url'] }}">{% trans %}Home{% endtrans %}</a>
{% endblock %}
<span style="float:right">
{% set links_found = namespace(json=0, jsonld=0) %}
@@ -45,18 +45,18 @@
{% for link in data['links'] %}
{% if link['rel'] == 'alternate' and link['type'] and link['type'] in ['application/json', 'application/geo+json'] %}
{% set links_found.json = 1 %}
<a href="{{ link['href'] }}">JSON</a>
<a href="{{ link['href'] }}">{% trans %}json{% endtrans %}</a>
{% elif link['rel'] == 'alternate' and link['type'] and link['type'] == 'application/ld+json' %}
{% set links_found.jsonld = 1 %}
<a href="{{ link['href'] }}">JSON-LD</a>
<a href="{{ link['href'] }}">{% trans %}jsonld{% endtrans %}</a>
{% endif %}
{% endfor %}
{% if links_found.json == 0 %}
<a href="?f=json">JSON</a>
<a href="?f=json">{% trans %}json{% endtrans %}</a>
{% endif %}
{% if links_found.jsonld == 0 %}
<a href="?f=jsonld">JSON-LD</a>
<a href="?f=jsonld">{% trans %}jsonld{% endtrans %}</a>
{% endif %}
</span>
@@ -73,7 +73,7 @@
</div>
</div>
</main>
<footer class="sticky">Powered by <a title="pygeoapi" href="https://pygeoapi.io"><img src="{{ config['server']['url'] }}/static/img/pygeoapi.png" title="pygeoapi logo" style="height:24px;vertical-align: middle;"/></a> {{ version }}</footer>
<footer class="sticky">{% trans %}prePoweredBy{% endtrans %} <a title="pygeoapi" href="https://pygeoapi.io"><img src="{{ config['server']['url'] }}/static/img/pygeoapi.png" title="pygeoapi logo" style="height:24px;vertical-align: middle;"/></a> {{ version }} {% trans %}postPoweredBy{% endtrans %}</footer>
{% block extrafoot %}
{% endblock %}
<script>
@@ -8,30 +8,30 @@
<section id="collection">
<h1>{{ data['title'] }}</h1>
<p>{{ data['description'] }}</p>
<h3>Coverage domain set</h3>
<h4>Axis labels</h4>
<h3>{% trans %}Coverage domain set{% endtrans %}</h3>
<h4>{% trans %}Axis labels{% endtrans %}</h4>
<ul>
{% for al in data['generalGrid']['axisLabels'] %}
<li>{{ al }}</li>
{% endfor %}
</ul>
<h4>Extent</h4>
<h4>{% trans %}Extent{% endtrans %}</h4>
<ul>
<li>minx: {{ data['generalGrid']['axis'][0]['lowerBound'] }}</li>
<li>miny: {{ data['generalGrid']['axis'][1]['lowerBound'] }}</li>
<li>miny: {{ data['generalGrid']['axis'][1]['lowerBound'] }}</li>
<li>maxx: {{ data['generalGrid']['axis'][0]['upperBound'] }}</li>
<li>maxy: {{ data['generalGrid']['axis'][1]['upperBound'] }}</li>
<li>Coordinate reference system: {{ data['generalGrid']['srsName'] }}</li>
<li>{% trans %}Coordinate reference system{% endtrans %}: {{ data['generalGrid']['srsName'] }}</li>
</ul>
<h4>Size</h4>
<h4>{% trans %}Size{% endtrans %}</h4>
<ul>
<li>width: {{ data['generalGrid']['gridLimits']['axis'][0]['upperBound'] }} </li>
<li>height: {{ data['generalGrid']['gridLimits']['axis'][1]['upperBound'] }} </li>
<li>{% trans %}width{% endtrans %}: {{ data['generalGrid']['gridLimits']['axis'][0]['upperBound'] }} </li>
<li>{% trans %}{height% endtrans %}: {{ data['generalGrid']['gridLimits']['axis'][1]['upperBound'] }} </li>
</ul>
<h4>Resolution</h4>
<h4>{% trans %}Resolution{% endtrans %}</h4>
<ul>
<li>x: {{ data['generalGrid']['axis'][0]['resolution'] }} </li>
<li>y: {{ data['generalGrid']['axis'][1]['resolution'] }} </li>
<li>{% trans %}x{% endtrans %}: {{ data['generalGrid']['axis'][0]['resolution'] }} </li>
<li>{% trans %}y{% endtrans %}: {{ data['generalGrid']['axis'][1]['resolution'] }} </li>
</ul>
</section>
{% endblock %}
@@ -1,15 +1,15 @@
{% extends "_base.html" %}
{% block title %}{{ super() }} {{ data['title'] }} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="../../">Collections</a>
/ <a href="../../">{% trans %}Collections{% endtrans %}</a>
/ <a href="../../../collections/{{ data['id'] }}">{{ data['title'] }}</a>
{% endblock %}
{% block body %}
<section id="collection">
<h1>{{ data['title'] }}</h1>
<p>{{ data['description'] }}</p>
<h3>Coverage range type</h3>
<h4>Fields</h4>
<h3>{% trans %}Coverage range type{% endtrans %}</h3>
<h4>{% trans %}Fields{% endtrans %}</h4>
<ul>
{% for field in data['field'] %}
<li>{{ field['id'] }}: {{ field['name'] }} ({{ field['definition'] }})</li>
@@ -1,14 +1,14 @@
{% extends "_base.html" %}
{% block title %}{{ super() }} {{ data['title'] }} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="{{ data['collections_path'] }}">Collections</a>
/ <a href="{{ data['collections_path'] }}">{% trans %}Collections{% endtrans %}</a>
{% for link in data['links'] %}
{% if link.rel == 'collection' %} /
<a href="{{ data['dataset_path'] }}">{{ link['title'] | truncate( 25 ) }}</a>
{% set col_title = link['title'] %}
{% endif %}
{% endfor %}
/ <a href="{{ data['items_path']}}">Items</a>
/ <a href="{{ data['items_path']}}">{% trans %}Items{% endtrans %}</a>
{% endblock %}
{% block extrahead %}
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css"/>
@@ -1,14 +1,14 @@
{% extends "_base.html" %}
{% block title %}{{ super() }} {{ data['title'] }} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="{{ data['collections_path'] }}">Collections</a>
/ <a href="{{ data['collections_path'] }}">{% trans %}Collections{% endtrans %}</a>
{% for link in data['links'] %}
{% if link.rel == 'collection' %} /
<a href="{{ data['dataset_path'] }}">{{ link['title'] | truncate( 25 ) }}</a>
{% set col_title = link['title'] %}
{% endif %}
{% endfor %}
/ <a href="{{ data['items_path']}}">Items</a>
/ <a href="{{ data['items_path']}}">{% trans %}Items{% endtrans %}</a>
{% endblock %}
{% block extrahead %}
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css"/>
@@ -19,7 +19,7 @@
<section id="items"></section>
<section id="collection">
<h1>{% for l in data['links'] if l.rel == 'collection' %} {{ l['title'] }} {% endfor %}</h1>
<p>Items in this collection.</p>
<p>{% trans %}Items in this collection{% endtrans %}.</p>
</section>
<section id="items">
{% if data['features'] %}
@@ -32,14 +32,14 @@
<div class="col-sm-12">
<div class="row">
<div class="col-sm-12">
Warning: Higher limits not recommended!
{% trans %}Warning: Higher limits not recommended!{% endtrans %}
</div>
</div>
<div class="row">
<div class="col-sm-12">
Limit:
{% trans %}Limit{% endtrans %}:
<select id="limits">
<option value="10">10 (default)</option>
<option value="10">10 ({% trans %}default{% endtrans %})</option>
<option value="100">100</option>
<option value="1000">1,000</option>
<option value="2000">2,000</option>
@@ -59,9 +59,9 @@
<div class="col-sm-12">
{% for link in data['links'] %}
{% if link['rel'] == 'prev' and data['startindex'] > 0 %}
<a role="button" href="{{ link['href'] }}">Prev</a>
<a role="button" href="{{ link['href'] }}">{% trans %}Prev{% endtrans %}</a>
{% elif link['rel'] == 'next' and data['features'] %}
<a role="button" href="{{ link['href'] }}">Next</a>
<a role="button" href="{{ link['href'] }}">{% trans %}Next{% endtrans %}</a>
{% endif %}
{% endfor %}
</div>
@@ -111,7 +111,7 @@
</div>
{% else %}
<div class="row col-sm-12">
<p>No items</p>
<p>{% trans %}No items{% endtrans %}</p>
</div>
{% endif %}
</section>
@@ -22,13 +22,13 @@
{%- endmacro %}
{% block title %}{{ ptitle }} - {{ super() }}{% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="../../../collections">Collections</a>
/ <a href="../../../collections">{% trans %}Collections{% endtrans %}</a>
{% for link in data['links'] %}
{% if link.rel == 'collection' %}
/ <a href="{{ link['href'] }}">{{ link['title'] | truncate( 25 ) }}</a>
{% endif %}
{% endfor %}
/ <a href="../items">Items</a>
/ <a href="../items">{% trans %}Items{% endtrans %}</a>
/ <a href="./{{ data['id'] }}">{{ ptitle | truncate( 25 ) }}</a>
{% endblock %}
{% block extrahead %}
@@ -57,9 +57,9 @@
<div class="col-sm-12">
{% for link in data['links'] %}
{% if link['rel'] == 'prev' %}
<a role="button" href="./{{ data['prev'] }}">Previous</a>
<a role="button" href="./{{ data['prev'] }}">{% trans %}Prev{% endtrans %}</a>
{% elif link['rel'] == 'next' %}
<a role="button" href="./{{ data['next'] }}">Next</a>
<a role="button" href="./{{ data['next'] }}">{% trans %}Next{% endtrans %}</a>
{% endif %}
{% endfor %}
</div>
@@ -72,8 +72,8 @@
<table class="striped">
<thead>
<tr>
<th>Property</th>
<th>Value</th>
<th>{% trans %}Property{% endtrans %}</th>
<th>{% trans %}Value{% endtrans %}</th>
</tr>
</thead>
<tbody>
@@ -1,9 +1,9 @@
{% extends "_base.html" %}
{% block title %}{{ super() }} {{ data['title'] }} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="../../collections">Collections</a>
/ <a href="../../collections">{% trans %}Collections{% endtrans %}</a>
/ <a href="../{{ data['id'] }}">{{ data['title'] }}</a>
/ <a href="../{{ data['id'] }}/tiles">Tiles</a>
/ <a href="../{{ data['id'] }}/tiles">{% trans %}Tiles{% endtrans %}</a>
{% endblock %}
{% block extrahead %}
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" />
@@ -28,7 +28,7 @@
</p>
<h3>Tiles</h3>
<div class="row">
<div class="col-md-2 col-sm-12">Tile Matrix Set</div>
<div class="col-md-2 col-sm-12">{% trans %}Tile Matrix Set{% endtrans %}</div>
<div class="col-md-8">
<select id="tilingScheme">
{% for tileset in data['tilesets'] %}
@@ -39,7 +39,7 @@
</div>
<br/>
<div class="row">
<div class="col-md-2 col-sm-12">Metadata</div>
<div class="col-md-2 col-sm-12">{% trans %}Metadata{% endtrans %}</div>
<div class="col-md-8"><a id="tilejson" href="" target="_blank">Tiles metadata in {{ data['format'] }} format</a></div>
</div>
<script>
@@ -1,9 +1,9 @@
{% extends "_base.html" %}
{% block title %}{{ super() }} {{ data['title'] }} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="../../../../collections">Collections</a>
/ <a href="../../../../collections">{% trans %}Collections{% endtrans %}</a>
/ <a href="../../../{{ data['id'] }}">{{ data['title'] }}</a>
/ <a href="../../../{{ data['id'] }}/tiles">Tiles</a>
/ <a href="../../../{{ data['id'] }}/tiles">{% trans %}Tiles{% endtrans %}</a>
/ <a href="../../../{{ data['id'] }}/tiles/{{ data['tileset'] }}/metadata">Tile Metadata</a>
{% endblock %}
{% block body %}
@@ -15,8 +15,8 @@
<mark class="tag">{{ kw }}</mark>
{% endfor %}
</p>
<h3>Tiles metadata - {{ data['format'] }} format</h3>
<h4>Tileset {{ data['tileset'] }}</h4>
<h3>{% trans %}Tiles metadata{% endtrans %} - {{ data['format'] }} {% trans %}format{% endtrans %}</h3>
<h4>{% trans %}Tileset{% endtrans %} {{ data['tileset'] }}</h4>
<ul>
{% for metadata in data['metadata'].items() %}
<li>{{ metadata[0] }} (<code>{{ metadata[1] }}</code>)</li>
+3 -3
View File
@@ -1,11 +1,11 @@
{% extends "_base.html" %}
{% block title %}{{ super() }} Conformance {% endblock %}
{% block title %}{{ super() }} {% trans %}Conformance{% endtrans %} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="./conformance">Conformance</a>
/ <a href="./conformance">{% trans %}Conformance{% endtrans %}</a>
{% endblock %}
{% block body %}
<section id="conformance">
<h2>Conformance</h2>
<h2>{% trans %}Conformance{% endtrans %}</h2>
<ul>
{% for link in data['conformsTo'] %}
<li><a title="{{ link }}" href="{{ link }}">{{ link }}</a></li>
+2 -2
View File
@@ -1,8 +1,8 @@
{% extends "_base.html" %}
{% block title %}{{ super() }} Exception {% endblock %}
{% block title %}{{ super() }} {% trans %}Exception{% endtrans %} {% endblock %}
{% block body %}
<section id="exception">
<h2>Exception</h2>
<h2>{% trans %}Exception{% endtrans %}</h2>
<p>{{ data['description'] }}</p>
</section>
{% endblock %}
+23 -23
View File
@@ -1,5 +1,5 @@
{% extends "_base.html" %}
{% block title %}{{ super() }} Home {% endblock %}
{% block title %}{{ super() }} {% trans %}Home{% endtrans %} {% endblock %}
{% block body %}
<br/>
@@ -22,7 +22,7 @@
{% if config['metadata']['identification']['terms_of_service'] %}
<div class="row">
<div class="col-sm-4">
Terms of service
{% trans %}Terms of service{% endtrans %}
</div>
<div class="col-sm-8">
{{ config['metadata']['identification']['terms_of_service'] | urlize() }}
@@ -32,7 +32,7 @@
{% if config['metadata']['license']['url'] %}
<div class="row">
<div class="col-sm-4">
License
{% trans %}License{% endtrans %}
</div>
<div class="col-sm-8">
<a href="{{ config['metadata']['license']['url'] }}">
@@ -44,47 +44,47 @@
</div>
</section>
<section id="collections">
<h2>Collections</h2>
<h2>{% trans %}Collections{% endtrans %}</h2>
<p>
<a href="{{ config['server']['url'] }}/collections?f=html">View the collections in this service</a>
<a href="{{ config['server']['url'] }}/collections?f=html">{% trans %}View the collections in this service{% endtrans %}</a>
</p>
</section>
{% if data['stac'] %}
<section id="collections">
<h2>SpatioTemporal Assets</h2>
<h2>{% trans %}SpatioTemporal Assets{% endtrans %}</h2>
<p>
<a href="{{ config['server']['url'] }}/stac?f=html">View the SpatioTemporal Assets in this service</a>
<a href="{{ config['server']['url'] }}/stac?f=html">{% trans %}View the SpatioTemporal Assets in this service{% endtrans %}</a>
</p>
</section>
{% endif %}
{% if data['processes'] %}
<section id="processes">
<h2>Processes</h2>
<h2>{% trans %}Processes{% endtrans %}</h2>
<p>
<a href="{{ config['server']['url'] }}/processes?f=html">View the processes in this service</a>
<a href="{{ config['server']['url'] }}/processes?f=html">{% trans %}View the processes in this service{% endtrans %}</a>
</p>
</section>
{% endif %}
<section id="openapi">
<h2>API Definition</h2>
<h2>{% trans %}API Definition{% endtrans %}</h2>
<p>
Documentation: <a href="{{ config['server']['url'] }}/openapi?f=html">Swagger UI</a> <a href="{{ config['server']['url'] }}/openapi?f=html&ui=redoc">ReDoc</a>
{% trans %}Documentation{% endtrans %}: <a href="{{ config['server']['url'] }}/openapi?f=html">{% trans %}Swagger UI{% endtrans %}</a> <a href="{{ config['server']['url'] }}/openapi?f=html&ui=redoc">{% trans %}ReDoc{% endtrans %}</a>
</p>
<p>
<a href="{{ config['server']['url'] }}/openapi?f=json">OpenAPI Document</a>
<a href="{{ config['server']['url'] }}/openapi?f=json">{% trans %}OpenAPI Document{% endtrans %}</a>
</p>
</section>
<section id="conformance">
<h2>Conformance</h2>
<h2>{% trans %}Conformance{% endtrans %}</h2>
<p>
<a href="{{ config['server']['url'] }}/conformance?f=html">View the conformance classes of this service</a>
<a href="{{ config['server']['url'] }}/conformance?f=html">{% trans %}View the conformance classes of this service{% endtrans %}</a>
</p>
</section>
</div>
<div class="col-md-4 col-sm-12">
<div class="card fluid">
<div class="section dark">
<b>Provider</b>
<b>{% trans %}Provider{% endtrans %}</b>
</div>
<div class="section">
<b>{{ config['metadata']['provider']['name'] }}</b><br/>
@@ -93,10 +93,10 @@
</div>
<div class="card fluid">
<div class="section dark">
<b>Contact point</b>
<b>{% trans %}Contact point{% endtrans %}</b>
</div>
<div class="section">
<b>Address</b><br/>
<b>{% trans %}Address{% endtrans %}</b><br/>
<div class="section">
<span>{{ config['metadata']['contact']['address'] }}</span><br/>
<span>{{ config['metadata']['contact']['city'] }}</span>,
@@ -105,26 +105,26 @@
<span>{{ config['metadata']['contact']['country'] }}</span>
</div>
<div>
<b>Email</b><br/>
<b>{% trans %}Email{% endtrans %}</b><br/>
<span><a href="mailto:{{ config['metadata']['contact']['email'] }}">{{ config['metadata']['contact']['email'] }}</a></span><br/>
{% if config['metadata']['contact']['phone'] %}
<b>Telephone</b><br/>
<b>{% trans %}Telephone{% endtrans %}</b><br/>
<span><a href="tel:{{ config['metadata']['contact']['phone'] }}">{{ config['metadata']['contact']['phone'] }}</a></span><br/>
{% endif %}
{% if config['metadata']['contact']['fax'] %}
<b>Fax</b><br/>
<b>{% trans %}Fax{% endtrans %}</b><br/>
<span><a href="tel:{{ config['metadata']['contact']['fax'] }}">{{ config['metadata']['contact']['fax'] }}</a></span><br/>
{% endif %}
{% if config['metadata']['contact']['url'] %}
<b>Contact URL</b><br/>
<b>{% trans %}Contact URL{% endtrans %}</b><br/>
<span><a href="{{ config['metadata']['contact']['url'] }}">{{ config['metadata']['contact']['url'] }}</a></span><br/>
{% endif %}
{% if config['metadata']['contact']['hours'] %}
<b>Hours</b><br/>
<b>{% trans %}Hours{% endtrans %}</b><br/>
<span>{{ config['metadata']['contact']['hours'] }}</span><br/>
{% endif %}
{% if config['metadata']['contact']['instructions'] %}
<b>Contact instructions</b><br/>
<b>{% trans %}Contact instructions{% endtrans %}</b><br/>
<span>{{ config['metadata']['contact']['instructions'] }}</span>
{% endif %}
</div>
+16 -16
View File
@@ -1,7 +1,7 @@
{% extends "_base.html" %}
{% block title %}{{ super() }} {{ data['title'] }} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="../processes">Processes</a>
/ <a href="../processes">{% trans %}Processes{% endtrans %}</a>
/ <a href="./{{ data['id'] }}">{{ data['title'] }}</a>
{% endblock %}
{% block body %}
@@ -17,13 +17,13 @@
<div class="row">
<div class="col-sm-12 col-md-12">
<table class="striped hoverable">
<caption>Inputs</caption>
<caption>{% trans %}Inputs{% endtrans %}</caption>
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Data Type</th>
<th>Description</th>
<th>{% trans %}Id{% endtrans %}</th>
<th>{% trans %}Title{% endtrans %}</th>
<th>{% trans %}Data Type{% endtrans %}</th>
<th>{% trans %}Description{% endtrans %}</th>
</tr>
</thead>
<tbody>
@@ -48,12 +48,12 @@
</div>
<div class="col-sm-12 col-md-12">
<table class="striped hoverable">
<caption>Outputs</caption>
<caption>{% trans %}Outputs{% endtrans %}</caption>
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Description</th>
<th>{% trans %}Id{% endtrans %}</th>
<th>{% trans %}Title{% endtrans %}</th>
<th>{% trans %}Description{% endtrans %}</th>
</tr>
</thead>
<tbody>
@@ -68,14 +68,14 @@
{% endfor %}
</tbody>
</table>
<h2>Execution modes</h2>
<h2>{% trans %}Execution modes{% endtrans %}</h2>
<ul>
{% if 'sync-execute' in data.jobControlOptions %}<li>Synchronous</li>{% endif %}
{% if 'async-execute' in data.jobControlOptions %}<li>Asynchronous</li>{% endif %}
{% if 'sync-execute' in data.jobControlOptions %}<li>{% trans %}Synchronous{% endtrans %}</li>{% endif %}
{% if 'async-execute' in data.jobControlOptions %}<li>{% trans %}Asynchronous{% endtrans %}</li>{% endif %}
</ul>
<h2>Jobs</h2>
<a title="Browse jobs" href="{{config.server.url}}/processes/{{data.id}}/jobs">Browse jobs</a>
<h2>Links</h2>
<h2>{% trans %}Jobs{% endtrans %}</h2>
<a title="Browse jobs" href="{{config.server.url}}/processes/{{data.id}}/jobs">{% trans %}Browse jobs{% endtrans %}</a>
<h2>{% trans %}Links{% endtrans %}</h2>
<ul>
{% for link in data['links'] %}
<li>
+4 -4
View File
@@ -1,7 +1,7 @@
{% extends "_base.html" %}
{% block title %}{{ super() }} stac/{{ data['path'] }} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="{{ config['server']['url'] }}/stac">SpatioTemporal Asset Catalog</a>
/ <a href="{{ config['server']['url'] }}/stac">{% trans %}SpatioTemporal Asset Catalog{% endtrans %}</a>
{% for link in get_breadcrumbs(data['path']) %}
/ <a class="crumbs-path" href="{{config['server']['url'] }}/stac/{{ link['href'] }}">{{ link['title'] }}</a>
{% endfor %}
@@ -14,9 +14,9 @@
<table class="striped">
<thead>
<tr>
<th>Name</th>
<th>Last modified</th>
<th>Size</th>
<th>{% trans %}Name{% endtrans %}</th>
<th>{% trans %}Last modified{% endtrans %}</th>
<th>{% trans %}Size{% endtrans %}</th>
</tr>
</thead>
<tbody>
+5 -5
View File
@@ -1,12 +1,12 @@
{% extends "_base.html" %}
{% block title %}{{ super() }} SpatioTemporal Asset Catalog {% endblock %}
{% block title %}{{ super() }} {% trans %}SpatioTemporal Asset Catalog{% endtrans %} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="./stac">SpatioTemporal Asset Catalog</a>
/ <a href="./stac">{% trans %}SpatioTemporal Asset Catalog{% endtrans %}</a>
{% endblock %}
{% block body %}
<section id="identification">
<h4>STAC Version: {{ data['stac_version'] }}</h4>
<h4>{% trans %}STAC Version{% endtrans %}: {{ data['stac_version'] }}</h4>
</section>
<section id="collections">
@@ -14,8 +14,8 @@
<table class="striped">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>{% trans %}Name{% endtrans %}</th>
<th>{% trans %}Description{% endtrans %}</th>
</tr>
</thead>
<tbody>
+9 -9
View File
@@ -1,7 +1,7 @@
{% extends "_base.html" %}
{% block title %}{{ super() }} stac/{{ data['path'] }} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="{{ config['server']['url'] }}/stac">SpatioTemporal Asset Catalog</a>
/ <a href="{{ config['server']['url'] }}/stac">{% trans %}SpatioTemporal Asset Catalog{% endtrans %}</a>
{% for link in get_breadcrumbs(data['path']) %}
/ <a class="crumbs-path" href="{{config['server']['url'] }}/stac/{{ link['href'] }}">{{ link['title'] }}</a>
{% endfor %}
@@ -16,7 +16,7 @@
<section id="item">
<div class="row">
<div class="col-sm">
<h2>Item {{ data['id'] }}</h2>
<h2>{% trans %}Item{% endtrans %} {{ data['id'] }}</h2>
</div>
</div>
<div class="row">
@@ -25,13 +25,13 @@
<div class="col-sm-12">
<div id="items-map"></div>
<div id="assets">
<h4>Assets</h4>
<h4>{% trans %}Assets{% endtrans %}</h4>
<table class="striped">
<thead>
<tr>
<th>URL</th>
<th>Last Modified</th>
<th>Size</th>
<th>{% trans %}URL{% endtrans %}</th>
<th>{% trans %}Last Modified{% endtrans %}</th>
<th>{% trans %}Size{% endtrans %}</th>
</tr>
</thead>
<tbody>
@@ -55,13 +55,13 @@
<table class="striped">
<thead>
<tr>
<th>Property</th>
<th>Value</th>
<th>{% trans %}Property{% endtrans %}</th>
<th>{% trans %}Value{% endtrans %}</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>{% trans %}id{% endtrans %}</td>
<td>{{ data.id }}</td>
</tr>
{% for k, v in data['properties'].items() %}
+11 -5
View File
@@ -45,8 +45,8 @@ from urllib.parse import urlparse
from shapely.geometry import Polygon
import dateutil.parser
# from babel.support import Translations
from jinja2 import Environment, FileSystemLoader
from jinja2 import Environment, FileSystemLoader, select_autoescape
from babel.support import Translations
from jinja2.exceptions import TemplateNotFound
import yaml
@@ -320,12 +320,16 @@ def render_j2_template(config, template, data, locale_=None):
try:
templates_path = config['server']['templates']['path']
env = Environment(loader=FileSystemLoader(templates_path),
extensions=['jinja2.ext.i18n'])
extensions=['jinja2.ext.i18n',
'jinja2.ext.autoescape'],
autoescape=select_autoescape(['html', 'xml']))
custom_templates = True
LOGGER.debug('using custom templates: {}'.format(templates_path))
except (KeyError, TypeError):
env = Environment(loader=FileSystemLoader(TEMPLATES),
extensions=['jinja2.ext.i18n'])
extensions=['jinja2.ext.i18n',
'jinja2.ext.autoescape'],
autoescape=select_autoescape(['html', 'xml']))
LOGGER.debug('using default templates: {}'.format(TEMPLATES))
env.filters['to_json'] = to_json
@@ -343,7 +347,9 @@ def render_j2_template(config, template, data, locale_=None):
env.filters['filter_dict_by_key_value'] = filter_dict_by_key_value
env.globals.update(filter_dict_by_key_value=filter_dict_by_key_value)
# TODO: insert Babel Translation stuff here
translations = Translations.load('locale', [locale_])
env.install_gettext_translations(translations)
try:
template = env.get_template(template)
except TemplateNotFound as err: