Projet

Général

Profil

0001-general-add-javascript-catalog-to-translate-map-tool.patch

Frédéric Péters, 13 septembre 2018 09:45

Télécharger (3,63 ko)

Voir les différences:

Subject: [PATCH] general: add javascript catalog to translate map tooltips
 (#26266)

 combo/apps/maps/models.py               |  3 ++-
 combo/apps/maps/static/js/combo.map.js  |  6 +++++-
 combo/locale/fr/LC_MESSAGES/djangojs.po | 25 +++++++++++++++++++++++++
 combo/urls.py                           |  2 ++
 4 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 combo/locale/fr/LC_MESSAGES/djangojs.po
combo/apps/maps/models.py
260 260
        verbose_name = _('Map')
261 261

  
262 262
    class Media:
263
        js = ('xstatic/leaflet.js', 'js/leaflet-gps.js', 'js/combo.map.js',
263
        js = ('/jsi18n',
264
              'xstatic/leaflet.js', 'js/leaflet-gps.js', 'js/combo.map.js',
264 265
              'xstatic/leaflet.markercluster.js')
265 266
        css = {'all': ('xstatic/leaflet.css', 'css/combo.map.css')}
266 267

  
combo/apps/maps/static/js/combo.map.js
137 137
        }
138 138
        var map_controls_position = $('body').data('map-controls-position') || 'topleft';
139 139
        if (map_options.maxZoom != map_options.minZoom) {
140
          new L.Control.Zoom({position: map_controls_position}).addTo(map);
140
          new L.Control.Zoom({
141
            position: map_controls_position,
142
            zoomInTitle: gettext('Zoom in'),
143
            zoomOutTitle: gettext('Zoom out')
144
          }).addTo(map);
141 145
        }
142 146
        if (L.Control.Gps && $map_widget.data('include-geoloc-button')) {
143 147
          var gps_control = new L.Control.Gps({position: map_controls_position});
combo/locale/fr/LC_MESSAGES/djangojs.po
1
# Combo French Translation.
2
# Copyright (C) 2018 Entr'ouvert
3
# This file is distributed under the same license as the Combo package.
4
# Frederic Peters <fpeters@entrouvert.com>, 2018.
5
#
6
msgid ""
7
msgstr ""
8
"Project-Id-Version: combo(js) 0\n"
9
"Report-Msgid-Bugs-To: \n"
10
"POT-Creation-Date: 2018-09-13 07:22+0000\n"
11
"PO-Revision-Date: 2018-09-13 09:29+0200\n"
12
"Last-Translator: Frederic Peters <<fpeters@entrouvert.com>\n"
13
"Language: French\n"
14
"MIME-Version: 1.0\n"
15
"Content-Type: text/plain; charset=UTF-8\n"
16
"Content-Transfer-Encoding: 8bit\n"
17
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
18

  
19
#: apps/maps/static/js/combo.map.js:142
20
msgid "Zoom in"
21
msgstr "Zoomer"
22

  
23
#: apps/maps/static/js/combo.map.js:143
24
msgid "Zoom out"
25
msgstr "Dézoomer"
combo/urls.py
19 19
from django.conf.urls.static import static
20 20
from django.contrib import admin
21 21
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
22
from django.views.i18n import javascript_catalog
22 23

  
23 24
from .urls_utils import decorated_includes, manager_required
24 25

  
......
34 35
    url(r'^logout/$', logout, name='auth_logout'),
35 36
    url(r'^login/$', login, name='auth_login'),
36 37
    url(r'^404$', error404),
38
    url(r'^jsi18n$', javascript_catalog, name='javascript-catalog'),
37 39
]
38 40

  
39 41
handler404 = error404
40
-