Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use force_text to allow translation of map attribution #92

Merged
merged 1 commit into from
Apr 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CHANGELOG
0.15.3dev (unreleased)
-------------------

*
* Map attribution can be translated using ugettext_lazy


0.15.2 (2014-12-22)
Expand Down
7 changes: 4 additions & 3 deletions leaflet/templatetags/leaflet_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django import template
from django.conf import settings
from django.utils import six
from django.utils.encoding import force_text

from leaflet import (app_settings, SPATIAL_EXTENT, SRID, PLUGINS, PLUGINS_DEFAULT,
PLUGIN_ALL, PLUGIN_FORMS)
Expand Down Expand Up @@ -68,9 +69,9 @@ def leaflet_map(name, callback=None, fitextent=True, creatediv=True, loadevent='
fitextent=fitextent,
center=app_settings['DEFAULT_CENTER'],
zoom=app_settings['DEFAULT_ZOOM'],
layers=[(six.text_type(label), url, attrs) for (label, url, attrs) in app_settings.get('TILES')],
overlays=[(six.text_type(label), url, attrs) for (label, url, attrs) in app_settings.get('OVERLAYS')],
attributionprefix=app_settings.get('ATTRIBUTION_PREFIX'),
layers=[(force_text(label), url, attrs) for (label, url, attrs) in app_settings.get('TILES')],
overlays=[(force_text(label), url, attrs) for (label, url, attrs) in app_settings.get('OVERLAYS')],
attributionprefix=force_text(app_settings.get('ATTRIBUTION_PREFIX'), strings_only=True),
scale=app_settings.get('SCALE'),
minimap=app_settings.get('MINIMAP'),
resetview=app_settings.get('RESET_VIEW'),
Expand Down