Skip to content

Commit

Permalink
Add missing translation for GEOJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanulde committed Jun 9, 2022
1 parent 08de676 commit 7a03619
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docker/default.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ links:
JSON:
en: This document as JSON
fr: Ce document en JSON
GEOJSON:
en: This document as GeoJSON
fr: Ce document en GeoJSON
RDF:
en: This document as RDF (JSON-LD)
fr: Ce document en RDF (JSON-LD)
Expand Down
3 changes: 3 additions & 0 deletions pygeoapi-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ links:
JSON:
en: This document as JSON
fr: Ce document en JSON
GEOJSON:
en: This document as GeoJSON
fr: Ce document en GeoJSON
RDF:
en: This document as RDF (JSON-LD)
fr: Ce document en RDF (JSON-LD)
Expand Down
6 changes: 4 additions & 2 deletions pygeoapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,8 @@ def get_collection_items(
content['links'] = [{
'type': 'application/geo+json',
'rel': request.get_linkrel(F_JSON),
'title': 'This document as GeoJSON',
'title': l10n.translate(
self.config['links']['GEOJSON'], request.locale),
'href': '{}?f={}{}'.format(
uri, F_JSON, serialized_query_params)
}, {
Expand Down Expand Up @@ -1945,7 +1946,8 @@ def get_collection_item(self, request: Union[APIRequest, Any],
content['links'] = [{
'rel': request.get_linkrel(F_JSON),
'type': 'application/geo+json',
'title': 'This document as GeoJSON',
'title': l10n.translate(
self.config['links']['GEOJSON'], request.locale),
'href': '{}?f={}'.format(uri, F_JSON)
}, {
'rel': request.get_linkrel(F_JSONLD),
Expand Down
3 changes: 3 additions & 0 deletions tests/pygeoapi-test-config-envvars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ links:
JSON:
en: This document as JSON
fr: Ce document en JSON
GEOJSON:
en: This document as JSON
fr: Ce document en JSON
RDF:
en: This document as RDF (JSON-LD)
fr: Ce document en RDF (JSON-LD)
Expand Down
3 changes: 3 additions & 0 deletions tests/pygeoapi-test-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ links:
JSON:
en: This document as JSON
fr: Ce document en JSON
GEOJSON:
en: This document as JSON
fr: Ce document en JSON
RDF:
en: This document as RDF (JSON-LD)
fr: Ce document en RDF (JSON-LD)
Expand Down
3 changes: 3 additions & 0 deletions tests/pygeoapi-test-ogr-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ links:
JSON:
en: This document as JSON
fr: Ce document en JSON
GEOJSON:
en: This document as JSON
fr: Ce document en JSON
RDF:
en: This document as RDF (JSON-LD)
fr: Ce document en RDF (JSON-LD)
Expand Down

0 comments on commit 7a03619

Please sign in to comment.