Skip to content

Commit b7646da

Browse files
authored
Merge pull request #57 from datopian/feature/auto-translate-title-notes
Auto-translation
2 parents 7be941f + 8b0d7d6 commit b7646da

File tree

9 files changed

+249
-37
lines changed

9 files changed

+249
-37
lines changed

i18n/da.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"Follow us": "Følg os",
1717
"Recently Added or updated datasets": "For nylig tilføjede eller opdaterede datasæt",
1818
"Mise en garde": "Mise en garde",
19-
"License": "Licenser",
19+
"License": "Licens",
2020
"Dataset": "Datasæt",
2121
"data file": "datasæt",
2222
"Download": "Download",
@@ -128,5 +128,10 @@
128128
"Frequent": "Løbende",
129129
"Yearly": "Årligt",
130130
"Update frequency": "Opdatering frekvens",
131-
"Update comments": "Opdatering kommentarer"
131+
"Update comments": "Opdatering kommentarer",
132+
"Formats": "Formats",
133+
"Licenses": "Licens",
134+
"Update frequencies": "Opdatering frekvens",
135+
"Author Email": "Dataejer",
136+
"Group": "Grupper"
132137
}

i18n/en.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"Skip to main content": "Skip to main content",
3+
"Navigate": "Navigate",
4+
"Home": "Home",
5+
"Website navigation": "Website navigation",
6+
"Request data": "Request data",
7+
"News": "News",
8+
"Data": "Data",
9+
"Submenu": "Submenu",
10+
"Datasets": "Datasets",
11+
"Organizations": "Organizations",
12+
"Groups": "Groups",
13+
"Andres data": "Andres data",
14+
"Search datasets": "Search datasets",
15+
"Search": "Search",
16+
"Search ...": "Search ...",
17+
"Search Datasets": "Search Datasets",
18+
"Search website": "Search website",
19+
"Search content": "Search content",
20+
"Breadcrumb": "Breadcrumb",
21+
"Blog": "Blog",
22+
"Main content": "Main content",
23+
"Read": "Read",
24+
"Read full article": "Read full article",
25+
"Previous": "Previous",
26+
"Next": "Next",
27+
"Featured blog posts": "Featured blog posts",
28+
"Tags": "Tags",
29+
"Formats": "Formats",
30+
"Licenses": "Licenses",
31+
"Update frequencies": "Update frequencies",
32+
"Test tag": "Test tag",
33+
"CSV": "CSV",
34+
"Yearly": "Yearly",
35+
"Demo org": "Demo org",
36+
"opendata.dk": "opendata.dk",
37+
"results found": "results found",
38+
"Order by:": "Order by:",
39+
"Relevance": "Relevance",
40+
"Name Ascending": "Name Ascending",
41+
"Name Descending": "Name Descending",
42+
"Last Modified": "Last Modified",
43+
"Popular": "Popular",
44+
"Download": "Download",
45+
"Featured groups": "Featured groups",
46+
"Blog posts": "Blog posts",
47+
"Navigate to news": "Navigate to news",
48+
"View all news": "View all news",
49+
"Events": "Events",
50+
"More": "More",
51+
"Page Not Found": "Page Not Found",
52+
"PAGE NOT FOUND": "PAGE NOT FOUND",
53+
"Dataset": "Dataset",
54+
"data file": "data file",
55+
"Navigate to": "Navigate to",
56+
"or": "or",
57+
"Preview": "Preview",
58+
"Organization": "Organization",
59+
"About": "About",
60+
"Metadata": "Metadata",
61+
"Author Email": "Author Email",
62+
"License": "License",
63+
"Group": "Group",
64+
"Update frequency": "Update frequency",
65+
"Update comments": "Update comments",
66+
"Keywords": "Keywords",
67+
"Share": "Share",
68+
"Application for": "Application for",
69+
"PAGE NOT FOUND: favicon.ico": "PAGE NOT FOUND: favicon.ico"
70+
}

i18n/fr.json

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
{
2+
"Home": "Accueil",
3+
"News": "Nouvelles",
4+
"Dashboard": "Tableau de bord",
5+
"Collection": "Grouper",
6+
"Tags": "Mots clés",
7+
"Format": "Format",
8+
"Data": "Données",
9+
"About": "à propos",
10+
"about": "À propos",
11+
"Search": "Rechercher",
12+
"Search ...": "Rechercher ...",
13+
"Search Datasets": "Rechercher les jeux des données",
14+
"Search datasets": "Rechercher les jeux des données",
15+
"Events": "Événements",
16+
"Follow us": "Suivez-nous",
17+
"Recently Added or updated datasets": "Ensembles de données récemment ajoutés ou mis à jour",
18+
"Mise en garde": "Mise en garde",
19+
"License": "Licence",
20+
"Dataset": "Jeu de données",
21+
"data file": "jeu de données",
22+
"Download": "Télécharger",
23+
"Dataset Collections": "Grouper",
24+
"CKAN Organizations are used to create, manage and publish collections of datasets. Users can have different roles within an Organization, depending on their level of authorisation to create, edit and publish.": "Les organisations CKAN sont utilisées pour créer, gérer et publier des collections d'ensembles de données. Les utilisateurs peuvent avoir différents rôles au sein d'une organisation, en fonction de leur niveau d'autorisation pour créer, modifier et publier.",
25+
"Catalogue of datasets for a particular project or team, or on a particular theme, or as a very simple way to help people find and search your own published datasets.": "Catalogue d'ensembles de données pour un projet ou une équipe en particulier, ou sur un thème particulier, ou comme moyen très simple d'aider les gens à trouver et rechercher vos propres ensembles de données publiés.",
26+
"Organizations": "Organisations",
27+
"title": "titre",
28+
"Blog": "Blog",
29+
"More": "Plus",
30+
"Page Not Found": "Page non trouvée",
31+
"Not Found": "Pas trouvé",
32+
"results found": "résultats trouvés",
33+
"Order by:": "Par Ordre:",
34+
"Relevance": "Pertinence",
35+
"Name Ascending": "Nom Croissant",
36+
"Name Descending": "Nom Décroissant",
37+
"Last Modified": "Modifié le",
38+
"Popular": "Populaire",
39+
"Previous": "Précédent",
40+
"Next": "Suivant",
41+
"Collections": "Grouper",
42+
"Miljø": "Miljø",
43+
"Oversvømmelse, affald, klima, vandløb, kyst, vandstigning, spildevand, kloakering, natur, skove/park": "Oversvømmelse, affald, klima, vandløb, kyst, vandstigning, spildevand, kloakering, natur, skove/park",
44+
"Share": "Partager",
45+
"Organization": "Organisation",
46+
"Metadata": "Métadonnées",
47+
"Show more": "Montre plus",
48+
"Conflict": "Conflit",
49+
"knowledge": "connaissance",
50+
"hvad-er-open-data-dk": "hvad-er-open-data-dk",
51+
"Search website": "Rechercher un site Web",
52+
"Datasets": "Jeu de données",
53+
"Groups": "Grouper",
54+
"Internationale spørgsmål": "Internationale spørgsmål",
55+
"This is a preview version. There might be more data in the original version.": "Ceci est une version préliminaire. Il pourrait y avoir plus de données dans la version originale.",
56+
"View all news": "Voir toutes les actualités",
57+
"Featured blog posts": "Articles de blog en vedette",
58+
"Calendar": "Calendrier",
59+
"Uncategorized": "Non classé",
60+
"Use-case": "Cas d'utilisation",
61+
"Nyheder": "Nyheder",
62+
"Use-cases": "Cas d'utilisation",
63+
"At opendata.dk we use cookies to collect statistics and improve the website.": "Chez opendata.dk, nous utilisons des cookies pour collecter des statistiques et améliorer le site Web.",
64+
"You accept cookies by clicking further.": "Vous acceptez les cookies en cliquant plus loin.",
65+
"Read full article": "Lire l'article complet",
66+
"Alle datasæt på Open Data DK portalen er grupperet for at skabe overblik. De er opdelt efter de samme kategorier som på European Data Portal.\nDataejere har ikke mulighed for selv at kategorisere datasæt. Du er derimod velkommen til at kontakte [email protected] med forslag til kategorisering af dine datasæt i de eksisterende grupper.": "Alle datasæt på Open Data DK portalen er grupperet for at skabe overblik. De er opdelt efter de samme kategorier som på European Data Portal.\nDataejere har ikke mulighed for selv at kategorisere datasæt. Du er derimod velkommen til at kontakte [email protected] med forslag til kategorisering af dine datasæt i de eksisterende grupper.",
67+
"På opendata.dk bruger vi cookies til at samle statistik og forbedre hjemmesiden.": "På opendata.dk bruger vi cookies til at samle statistik og forbedre hjemmesiden.",
68+
"Du accepterer cookies ved at klikke videre.": "Du accepterer cookies ved at klikke videre.",
69+
"Alle datasæt på Open Data DK portalen er grupperet for at skabe overblik. De er opdelt efter de samme kategorier som på European Data Portal.": "Alle datasæt på Open Data DK portalen er grupperet for at skabe overblik. De er opdelt efter de samme kategorier som på European Data Portal.",
70+
"Dataejere har ikke mulighed for selv at kategorisere datasæt. Du er derimod velkommen til at kontakte [email protected] med forslag til kategorisering af dine datasæt i de eksisterende grupper.": "Dataejere har ikke mulighed for selv at kategorisere datasæt. Du er derimod velkommen til at kontakte [email protected] med forslag til kategorisering af dine datasæt i de eksisterende grupper.",
71+
"Her er en oversigt over de kommuner, regioner og andre organisationer, der udstiller data på Open Data DK portalen. Under hver organisation kan du finde alle de datasæt, organisationen udstiller.": "Her er en oversigt over de kommuner, regioner og andre organisationer, der udstiller data på Open Data DK portalen. Under hver organisation kan du finde alle de datasæt, organisationen udstiller.",
72+
"Som dataejer i en organisation kan du oprette, redigere og publicere data afhængigt af din autorisation. Dette foregår via administrationsmodulet. Hvis I er medlem af Open Data DK, har I modtaget et link til administrationsmodulet.": "Som dataejer i en organisation kan du oprette, redigere og publicere data afhængigt af din autorisation. Dette foregår via administrationsmodulet. Hvis I er medlem af Open Data DK, har I modtaget et link til administrationsmodulet.",
73+
"Dataejere har ikke mulighed for selv at kategorisere datasæt. Du er derimod velkommen til at kontakte <a href=\"mailto:[email protected]\">[email protected]</a> med forslag til kategorisering af dine datasæt i de eksisterende grupper.": "Dataejere har ikke mulighed for selv at kategorisere datasæt. Du er derimod velkommen til at kontakte <a href=\"mailto:[email protected]\">[email protected]</a> med forslag til kategorisering af dine datasæt i de eksisterende grupper.",
74+
"Preview": "Aperçu",
75+
"Keywords": "Mots clés",
76+
"Energi": "Energi",
77+
"Fjernvarme, energiforbrug, data om kommunale bygninger (type, energikilde, alder osv.) m.m.": "Fjernvarme, energiforbrug, data om kommunale bygninger (type, energikilde, alder osv.) m.m.",
78+
"Access resource data via a web API with powerful query support.": "Tilgå ressourcens data via et web-API med kraftfuld query-support.",
79+
"Further information in the <a href=\"http://docs.ckan.org/en/latest/maintaining/datastore.html\" target=\"_blank\">main CKAN Data API and DataStore documentation.</a>": "Further information in the <a href=\"http://docs.ckan.org/en/latest/maintaining/datastore.html\" target=\"_blank\">main CKAN Data API and DataStore documentation.</a>",
80+
"Querying": "Interrogation",
81+
"Query example (first 5 results)": "Exemple de requête (5 premiers résultats)",
82+
"Query example (results containing \"jones\")": "Exemple de requête (résultats contenant \"jones\")",
83+
"Query example (via SQL statement)": "Exemple de requête (via une instruction SQL)",
84+
"data files": "fichiers de données",
85+
"Request data": "Demander des données",
86+
"Påvirk udviklingen af Open Data DK & vind en sensor": "Påvirk udviklingen af Open Data DK & vind en sensor",
87+
"Page found: favicon.ico": "Page found: favicon.ico",
88+
"Giv feedback": "Donnez votre avis",
89+
"til udviklingen af Open Data DK og vind en sensor": "til udviklingen af Open Data DK og vind en sensor",
90+
"Website navigation": "Navigation sur le site Web",
91+
"Blog posts": "Articles de blog",
92+
"Navigate to news": "Naviguer vers les actualités",
93+
"Featured groups": "Groupes en vedette",
94+
"Skip to main content": "Passer au contenu principal",
95+
"Page found: elements.css": "Page found: elements.css",
96+
"Submenu": "Sous-menu",
97+
"Search content": "Rechercher du contenu",
98+
"Breadcrumb": "Miette de pain",
99+
"Read": "Lire",
100+
"Search results": "Résultats de recherche",
101+
"Main content": "Contenu principal",
102+
"Uddannelse, kultur og sport": "Uddannelse, kultur og sport",
103+
"Arrangementer, lokalhistorie, biblioteksdata, idrætsanlæg, turisme, friluftsliv, fritidstilbud, uddannelsesinstitutioner, dagtilbud, skoler m.m.": "Arrangementer, lokalhistorie, biblioteksdata, idrætsanlæg, turisme, friluftsliv, fritidstilbud, uddannelsesinstitutioner, dagtilbud, skoler m.m.",
104+
"organization": "organisation",
105+
"tags": "mots clés",
106+
"groups": "grouper",
107+
"res_format": "format",
108+
"license_id": "licence",
109+
"View": "Vue",
110+
"Author": "Auteur",
111+
"E-mail": "E-mail",
112+
"Maintainer": "Mainteneur",
113+
"Resources": "Ressources",
114+
"or": "ou",
115+
"Visualisation": "Visualisation",
116+
"Application for": "Application pour",
117+
"Other": "Autre",
118+
"Navigate": "Naviguer",
119+
"Current page": "Page actuelle",
120+
"Navigate to": "Aller vers",
121+
"for": "pour",
122+
"Organisation datasets": "Ensembles de données d'organisation",
123+
"Befolkning og samfund": "Befolkning og samfund",
124+
"Socioøkonomi, demografi, befolkningsprognose, til- og fraflytninger, beskæftigelse, herkomst, m.m.": "Socioøkonomi, demografi, befolkningsprognose, til- og fraflytninger, beskæftigelse, herkomst, m.m.",
125+
"Andres data": "Andres data",
126+
"Monthly": "Mensuel",
127+
"Historical": "Historique",
128+
"Frequent": "Fréquent",
129+
"Yearly": "Annuel",
130+
"Update frequency": "Fréquence de mise à jour",
131+
"Update comments": "Mettre à jour les commentaires",
132+
"PAGE NOT FOUND: favicon.ico": "PAGE NOT FOUND: favicon.ico",
133+
"Formats": "Formats",
134+
"Licenses": "Licences",
135+
"Update frequencies": "Fréquences de mise à jour",
136+
"Author Email": "Courriel de l'auteur",
137+
"Group": "Grouper"
138+
}

index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
const moment = require('moment')
22

3-
// makes date formats Danish only
4-
// fix this if adding other languages
5-
moment.locale('da')
6-
73
module.exports = function (app) {
84
const utils = app.get('utils')
95
const dms = app.get('dms')
@@ -18,7 +14,9 @@ module.exports = function (app) {
1814
res.locals.PROMO_BANNER = process.env.PROMO_BANNER
1915
}
2016

21-
req.setLocale('da')
17+
moment.locale(req.locale || 'da')
18+
19+
req.setLocale(req.locale || 'da')
2220
next()
2321
})
2422

@@ -207,7 +205,8 @@ module.exports = function (app) {
207205
query: req.query,
208206
totalPages,
209207
pages,
210-
currentPage
208+
currentPage,
209+
locale: req.locale || 'da'
211210
})
212211
} catch (e) {
213212
next(e)

views/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
</div>
179179

180180
<script>
181-
document.cookie = 'defaultLocale=' + 'da';
181+
document.cookie = 'defaultLocale=' + '{{locale|safe}}';
182182

183183
// nav
184184
var navToggle = document.getElementById("nav-toggle");

views/partials/data-search-form.njk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
</div>
1010

1111
{% set facetNames = {
12-
organization: 'Organisationer',
13-
groups: 'Grupper',
14-
tags: 'Tag',
15-
res_format: 'Format',
16-
license_id: 'Licens',
17-
update_frequency: 'Opdatering frekvens'
12+
organization: __('Organizations'),
13+
groups: __('Groups'),
14+
tags: __('Tags'),
15+
res_format: __('Formats'),
16+
license_id: __('Licenses'),
17+
update_frequency: __('Update frequencies')
1818
} %}
1919

2020
{# Facets #}

views/partials/data-search-results.njk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<li class="mt-10">
44
<div>
55
<h3 class="text-2xl font-semibold">
6-
<a class="text-primary" href="/{{ package.organization.name or 'dataset' }}/{{ package.name }}">{{ package.title or package.name }}</a>
6+
<a class="text-primary" href="/{{ package.organization.name or 'dataset' }}/{{ package.name }}">{{ package.title_translated[locale] or package.title or package.name }}</a>
77
</h3>
88
<a href="/{{ package.organization.name or 'dataset' }}" class="text-gray-500 block mt-1">
99
{{ package.organization.title or package.organization.name or 'dataset' }}
@@ -20,9 +20,9 @@
2020
{% elif package.description %}
2121
<p>
2222
{% if package.description|length > 200 %}
23-
{{ package.description|truncate(200) }}
23+
{{ package.notes_translated[locale]|truncate(200) or package.description|truncate(200) }}
2424
{% else %}
25-
{{ package.description }}
25+
{{ package.notes_translated[locale] or package.description }}
2626
{% endif %}
2727
</p>
2828
{% endif %}

views/partials/search-filter.njk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{% set facetNames = {
2-
organization: 'Organisationer',
3-
groups: 'Grupper',
4-
tags: 'Tags',
5-
res_format: 'Format',
6-
license_id: 'Licens',
7-
update_frequency: 'Opdatering frekvens'
2+
organization: __('Organizations'),
3+
groups: __('Groups'),
4+
tags: __('Tags'),
5+
res_format: __('Formats'),
6+
license_id: __('Licenses'),
7+
update_frequency: __('Update frequencies')
88
} %}
99

1010
{% set regExp = r/\s/g %}

0 commit comments

Comments
 (0)