Skip to content

Commit

Permalink
Add localization for map controls
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzschmid committed Nov 3, 2020
1 parent d0e0db7 commit 57ec858
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
jekyll-theme-conference (2.3.1)
jekyll-theme-conference (2.4.0)
jekyll (~> 4.0)

GEM
Expand Down
10 changes: 9 additions & 1 deletion _data/lang.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1
version: 2

en:
pronoun:
Expand All @@ -12,6 +12,8 @@ en:
directions: Directions
talks: Talks in this room
no_talks: no talks planned
focus_conf: Center map on conference location
focus_me: Show my current location
program:
title: Program
legend: Caption
Expand All @@ -34,6 +36,8 @@ de:
directions: Anfahrt
talks: Vorträge in diesem Raum
no_talks: keine Vorträge geplant
focus_conf: Karte auf den Konferenz-Ort zentrieren
focus_me: Meinen aktuellen Standort anzeigen
program:
title: Programm
legend: Legende
Expand All @@ -56,6 +60,8 @@ fr:
directions: Indications
talks: Présentations dans cette salle
no_talks: pas des présentations prévues
focus_conf: Centrer la carte sur le lieu de la conférence
focus_me: Afficher ma localisation actuelle
program:
title: Programme
legend: Légende
Expand All @@ -78,6 +84,8 @@ pt:
directions: Indicações
talks: Apresentações nesta sala
no_talks: não estão previstas apresentações
focus_conf: Centralizar o mapa para o local da conferência
focus_me: Mostrar minha localização atual
program:
title: Programa
legend: Legenda
Expand Down
9 changes: 7 additions & 2 deletions _includes/js/conference-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ var map;

L.easyButton('far fa-star', function(){
map.setView(home_coord, default_zoom);
}).addTo(map);
}, '{{ site.data.lang[site.conference.lang].location.focus_conf | default: "Center map on conference location" }}').addTo(map);

L.control.locate().addTo(map);
L.control.locate({
flyTo: true,
strings: {
title: '{{ site.data.lang[site.conference.lang].location.focus_me | default: "Show me where I am" }}'
}
}).addTo(map);
}
})();
2 changes: 1 addition & 1 deletion _includes/partials/checks.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% unless site.conference.lang == "en" %}
{% assign errors = errors | push : "The internationalization file containing different strings for this template seems to be missing. Have you copied the `_data/lang.yml` file from the [theme's repository](https://github.com/DigitaleGesellschaft/jekyll-theme-conference/blob/master/_data/lang.yml) to you local website folder?" %}
{% endunless %}
{% elsif site.data.lang.version < 1 %}
{% elsif site.data.lang.version < 2 %}
{% assign errors = errors | push : "The internationalization file in `_data/lang.yml` seems to be outdated and does not correspond to the current version of the theme. Grab the current version from the [theme's repository](https://github.com/DigitaleGesellschaft/jekyll-theme-conference/blob/master/_data/lang.yml)." %}
{% endunless %}
{% unless site.conference.lang == "en" or site.conference.lang == "de" or site.conference.lang == "fr" or site.conference.lang == "pt" %}
Expand Down
2 changes: 1 addition & 1 deletion jekyll-theme-conference.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "jekyll-theme-conference"
spec.version = "2.3.1"
spec.version = "2.4.0"
spec.authors = ["Lorenz Schmid"]
spec.email = ["lorenzschmid@users.noreply.github.com"]

Expand Down

0 comments on commit 57ec858

Please sign in to comment.