Skip to content

Commit

Permalink
mapo en Esperanta lingvo (closes tejoesperanto#137)
Browse files Browse the repository at this point in the history
(+ ĝusta montrado de arabskribaj kaj hebreskribaj nomoj)
  • Loading branch information
interDist committed Jun 12, 2018
1 parent b50cd8c commit f4bfe08
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 24 deletions.
2 changes: 2 additions & 0 deletions maps/static/maps/world-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

window.addEventListener("load", function() {

mapboxgl.setRTLTextPlugin('https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.1.2/mapbox-gl-rtl-text.js');

var map = new mapboxgl.Map({
container: 'map',
style: '/mapo/positron-gl-style.json',
Expand Down
12 changes: 1 addition & 11 deletions maps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.views.decorators.cache import cache_page
from django.views.decorators.vary import vary_on_headers

from accept_language import parse_accept_language
from djgeojson.views import GeoJSONLayerView

from hosting.models import Place
Expand All @@ -29,16 +28,7 @@ def get_template_names(self):
return ['maps/styles/{}-gl-style.json'.format(self.style)]

def get_language(self):
try:
language_string = self.request.META['HTTP_ACCEPT_LANGUAGE']
except KeyError:
return 'en'

languages = parse_accept_language(language_string)
for lang in languages:
if lang.language in settings.OPENMAPTILES_LANGUAGES:
return lang.language
return 'en'
return 'eo'

def get_context_data(self, **kwargs):
return {
Expand Down
13 changes: 1 addition & 12 deletions pasportaservo/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,9 @@ def user_first_name(user):

OPENCAGE_API_KEY = 'a27f7e361bdfe11881a987a6e86fb5fd'

MAPBOX_GL_BASE_STATIC = 'https://api.tiles.mapbox.com/mapbox-gl-js/v0.40.1/mapbox-gl.{ext}'
MAPBOX_GL_BASE_STATIC = 'https://api.tiles.mapbox.com/mapbox-gl-js/v0.45.0/mapbox-gl.{ext}'
MAPBOX_GL_CSS = MAPBOX_GL_BASE_STATIC.format(ext='css')
MAPBOX_GL_JS = MAPBOX_GL_BASE_STATIC.format(ext='js')

# https://openmaptiles.com/hosting/
OPENMAPTILES_API_KEY = 'iQbjILhp2gs0dgNfTlIV'

# https://github.com/openmaptiles/openmaptiles/openmaptiles.yaml
OPENMAPTILES_LANGUAGES = (
# 'eo',
'ar', 'az', 'be', 'bg', 'br', 'bs', 'ca', 'cs', 'cy', 'da', 'de', 'el',
'en', 'es', 'et', 'fi', 'fr', 'fy', 'ga', 'gd', 'he', 'hr', 'hu',
'hy', 'is', 'it', 'ja', 'ja_kana', 'ja_rm', 'ka', 'kk', 'kn', 'ko',
'ko_rm', 'la', 'lb', 'lt', 'lv', 'mk', 'mt', 'nl', 'no', 'pl', 'pt',
'rm', 'ro', 'ru', 'sk', 'sl', 'sq', 'sr', 'sr-Latn', 'sv', 'th', 'tr',
'uk', 'zh',
)
1 change: 0 additions & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ sendgrid-django==2.0.0
pyuca==1.2

wheel
parse-accept-language==0.1.2

0 comments on commit f4bfe08

Please sign in to comment.