diff --git a/www/locale/fr/LC_MESSAGES/django.po b/www/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 0000000..172ecbd --- /dev/null +++ b/www/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,204 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2009 The ocitysmap/mapOSMatic authors +# This file is distributed under the same license as the PACKAGE package. +# ocitysmap/mapOSMatic authors , 2009. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: mapOSMatic 0.1\n" +"Report-Msgid-Bugs-To: address@hidden" +"POT-Creation-Date: 2009-09-01 09:53+0200\n" +"PO-Revision-Date: 2009-08-31 22:42+UTC\n" +"Last-Translator: David Decotigny \n" +"Language-Team: FR \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: maposmatic/models.py:109 +#, python-format +msgid "%(title)s %(format)s Map" +msgstr "Carte pour %(title)s (format %(format)s)" + +#: maposmatic/models.py:113 +#, python-format +msgid "%(title)s %(format)s Index" +msgstr "Index des rues pour %(title)s (format %(format)s)" + +#: maposmatic/views.py:63 +msgid "Administrative boundary" +msgstr "Limites administratives (nom de ville)" + +#: maposmatic/views.py:64 templates/maposmatic/index.html:151 +msgid "Bounding box" +msgstr "Zone géographique" + +#: maposmatic/views.py:75 +msgid "Administrative city required" +msgstr "Nom de ville obligatoire" + +#: maposmatic/views.py:79 +msgid "" +"No administrative boundaries found for this city. Try with proper casing." +msgstr "" +"Aucune limite administrative disponible pour cette ville. Essayez en " +"corrigeant la casse (majuscule sur la première lettre)" + +#: maposmatic/views.py:87 +msgid "Required" +msgstr "Obligatoire" + +#: maposmatic/templatetags/extratags.py:39 +msgid "Waiting rendering" +msgstr "Attente de début du rendu" + +#: maposmatic/templatetags/extratags.py:41 +msgid "Rendering in progress" +msgstr "Rendu en cours..." + +#: maposmatic/templatetags/extratags.py:21 +msgid "Rendering successfull" +msgstr "Rendu terminé avec succès" + +#: maposmatic/templatetags/extratags.py:46 +#, python-format +msgid "Rendering failed, reason: %(errmsg)s" +msgstr "Rendu échoué, raison : %(errmsg)s" + +#: templates/maposmatic/about.html:34 templates/maposmatic/base.html:49 +msgid "About" +msgstr "À propos..." + +#: templates/maposmatic/all_jobs.html:37 +msgid "Job list" +msgstr "Liste des rendus" + +#: templates/maposmatic/all_jobs.html:45 +msgid "Title" +msgstr "Titre" + +#: templates/maposmatic/all_jobs.html:46 +msgid "Location" +msgstr "Lieu" + +#: templates/maposmatic/all_jobs.html:47 +msgid "Job status" +msgstr "État du rendu" + +#: templates/maposmatic/all_jobs.html:48 +msgid "Submission at" +msgstr "Date de soumission" + +#: templates/maposmatic/all_jobs.html:49 +msgid "Rendering started at" +msgstr "Date de début du rendu" + +#: templates/maposmatic/all_jobs.html:50 +msgid "Rendering finished at" +msgstr "Date de fin du rendu" + +#: templates/maposmatic/all_jobs.html:51 +msgid "Position in queue" +msgstr "Position dans la file d'attente" + +#: templates/maposmatic/all_jobs.html:52 +msgid "ETA before rendering" +msgstr "Temps estimé avant rendu" + +#: templates/maposmatic/all_jobs.html:74 +msgid "not started" +msgstr "Rendu en attente" + +#: templates/maposmatic/all_jobs.html:83 +msgid "not finished" +msgstr "n/d" + +#: templates/maposmatic/all_maps.html:34 templates/maposmatic/base.html:48 +msgid "Maps" +msgstr "Cartes" + +#: templates/maposmatic/base.html:46 +msgid "Home" +msgstr "Accueil" + +#: templates/maposmatic/base.html:47 +msgid "Jobs" +msgstr "Rendus" + +#: templates/maposmatic/base.html:60 +msgid "Links:" +msgstr "Liens :" + +#: templates/maposmatic/base.html:67 +msgid "Design by" +msgstr "Style :" + +#: templates/maposmatic/index.html:135 +msgid "Title of the map" +msgstr "Titre de la carte" + +#: templates/maposmatic/index.html:140 +msgid "Area selection mode" +msgstr "Mode de sélection" + +#: templates/maposmatic/index.html:146 +msgid "City name" +msgstr "Nom de la ville" + +#: templates/maposmatic/index.html:161 +msgid "Generate" +msgstr "Générer..." + +#: templates/maposmatic/job.html:36 +#, python-format +msgid "Map %(job_t)s Status" +msgstr "État du rendu de la carte %(job_t)s" + +#: templates/maposmatic/job.html:40 +msgid "Map title" +msgstr "Titre de la carte" + +#: templates/maposmatic/job.html:45 +msgid "Administrative city" +msgstr "Limite administrative" + +#: templates/maposmatic/job.html:50 +msgid "Bounding-box coordinates" +msgstr "Coordonnées de la zone géographique (long/lat)" + +#: templates/maposmatic/job.html:60 +msgid "Status" +msgstr "État" + +#: templates/maposmatic/job.html:64 +msgid "Submission time" +msgstr "Date de soumission" + +#: templates/maposmatic/job.html:68 +msgid "Start of rendering time" +msgstr "Date de début du rendu" + +#: templates/maposmatic/job.html:71 +msgid "Rendering not started yet" +msgstr "Rendu en attente" + +#: templates/maposmatic/job.html:78 +msgid "End of rendering time" +msgstr "Date de fin du rendu" + +#: templates/maposmatic/job.html:83 +msgid "Rendering not finished yet" +msgstr "Rendu en cours..." + +#: templates/maposmatic/job.html:89 +msgid "Current position in queue" +msgstr "Position dans la file d'attente" + +#: templates/maposmatic/job.html:93 +msgid "Estimated rendering time completion" +msgstr "Temps estimé avant rendu" + +#: templates/maposmatic/job.html:99 +msgid "Result files" +msgstr "Fichiers générés" diff --git a/www/maposmatic/models.py b/www/maposmatic/models.py index cc2ca74..a885497 100644 --- a/www/maposmatic/models.py +++ b/www/maposmatic/models.py @@ -22,6 +22,8 @@ # along with this program. If not, see . from django.db import models +from django.utils.translation import ugettext_lazy as _ + from datetime import datetime import www.settings import re @@ -104,9 +106,13 @@ class MapRenderingJob(models.Model): for format in www.settings.RENDERING_RESULT_FORMATS: if format != 'csv': allfiles.append((www.settings.RENDERING_RESULT_URL + "/" + self.files_prefix() + "." + format, - self.maptitle + " %s Map" % format.upper())) + _("%(title)s %(format)s Map") \ + % { 'title' : self.maptitle, + 'format': format.upper() } )) allfiles.append((www.settings.RENDERING_RESULT_URL + "/" + self.files_prefix() + "_index." + format, - self.maptitle + " %s Index" % format.upper())) + _("%(title)s %(format)s Index") % \ + { 'title': self.maptitle, + 'format': format.upper() })) return allfiles def current_position_in_queue(self): diff --git a/www/maposmatic/templatetags/extratags.py b/www/maposmatic/templatetags/extratags.py index b498a2e..79d946e 100644 --- a/www/maposmatic/templatetags/extratags.py +++ b/www/maposmatic/templatetags/extratags.py @@ -24,6 +24,7 @@ from django import template from django.utils.html import conditional_escape from django.utils.safestring import mark_safe +from django.utils.translation import ugettext_lazy as _ register = template.Library() @@ -35,14 +36,15 @@ def job_status_to_str(value, arg, autoescape=None): esc = lambda x: x if value == 0: - result = "Waiting rendering" + result = _("Waiting rendering") elif value == 1: - result = "Rendering in progress" + result = _("Rendering in progress") elif value == 2: if arg == "ok": - result = "Rendering successfull" + result = _("Rendering successfull") else: - result = "Rendering failed, reason: %s" % esc(arg) + result = _("Rendering failed, reason: %(errmsg)s") \ + % dict(errmsg=esc(arg)) else: result = "" diff --git a/www/maposmatic/views.py b/www/maposmatic/views.py index 4ecc000..689c782 100644 --- a/www/maposmatic/views.py +++ b/www/maposmatic/views.py @@ -27,6 +27,8 @@ from django.forms.util import ErrorList from django.forms import ChoiceField, RadioSelect, ModelForm, ValidationError from django.shortcuts import get_object_or_404, render_to_response from django.http import HttpResponseRedirect +from django.utils.translation import ugettext_lazy as _ + from www.maposmatic.models import MapRenderingJob import datetime import psycopg2 @@ -55,11 +57,11 @@ def city_exists(city): class MapRenderingJobForm(ModelForm): class Meta: model = MapRenderingJob - fields = ('maptitle', 'administrative_city', 'lat_upper_left', 'lon_upper_left', - 'lat_bottom_right', 'lon_bottom_right') + fields = ('maptitle', 'administrative_city', 'lat_upper_left', + 'lon_upper_left', 'lat_bottom_right', 'lon_bottom_right') - modes = (('admin', 'Administrative boundary'), - ('bbox', 'Bounding box')) + modes = (('admin', _('Administrative boundary')), + ('bbox', _('Bounding box'))) mode = ChoiceField(choices=modes, initial='admin', widget=RadioSelect) def clean(self): @@ -70,11 +72,11 @@ class MapRenderingJobForm(ModelForm): if mode == 'admin': if city == "": - msg = u"Administrative city required" + msg = _(u"Administrative city required") self._errors["administrative_city"] = ErrorList([msg]) del cleaned_data["administrative_city"] elif not city_exists(city): - msg = u"No administrative boundaries found for this city. Try with proper casing." + msg = _(u"No administrative boundaries found for this city. Try with proper casing.") self._errors["administrative_city"] = ErrorList([msg]) del cleaned_data["administrative_city"] @@ -82,7 +84,7 @@ class MapRenderingJobForm(ModelForm): for f in [ "lat_upper_left", "lon_upper_left", "lat_bottom_right", "lon_bottom_right" ]: val = cleaned_data.get(f) - msg = u"Required" + msg = _(u"Required") self._errors[f] = ErrorList([msg]) del cleaned_data[f] diff --git a/www/settings.py b/www/settings.py index 197c50c..45c4cde 100644 --- a/www/settings.py +++ b/www/settings.py @@ -74,6 +74,7 @@ TEMPLATE_LOADERS = ( MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.locale.LocaleMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', ) diff --git a/www/templates/maposmatic/about.html b/www/templates/maposmatic/about.html index 1677044..917fed5 100644 --- a/www/templates/maposmatic/about.html +++ b/www/templates/maposmatic/about.html @@ -24,12 +24,13 @@ --> {% extends "maposmatic/base.html" %} +{% load i18n %} {% block menu-about %} class="activelink" {% endblock %} {% block page %} -

About

+

{% trans "About" %}

{% endblock %} diff --git a/www/templates/maposmatic/all_jobs.html b/www/templates/maposmatic/all_jobs.html index 8645c23..8cb92ef 100644 --- a/www/templates/maposmatic/all_jobs.html +++ b/www/templates/maposmatic/all_jobs.html @@ -24,6 +24,7 @@ --> {% extends "maposmatic/base.html" %} +{% load i18n %} {% load extratags %} @@ -33,7 +34,7 @@ class="activelink" {% block page %} -

Job list

+

{% trans "Job list" %}

This page gives the status of all the rendering requests received during the last 24 hours, starting from the most recent one.

@@ -41,14 +42,14 @@ during the last 24 hours, starting from the most recent one.

- - - - - - - - + + + + + + + + {% for job in jobs %} @@ -67,10 +68,10 @@ during the last 24 hours, starting from the most recent one.

- +
TitleLocationStatusSubmission atRendering started atRendering finished atPosition in queueETA before rendering{% trans "Title" %}{% trans "Location" %}{% trans "Job status" %}{% trans "Submission at" %}{% trans "Rendering started at" %}{% trans "Rendering finished at" %}{% trans "Position in queue" %}{% trans "ETA before rendering" %}
{{ job.status|job_status_to_str:job.resultmsg }} {{ job.submission_time|date:"Y-m-d H:i:s" }}{{ job.submission_time|date:"Y-m-d H:i:s"}} {% if job.is_waiting %} - not started + {%trans "not started" %} {% else %} {{ job.startofrendering_time|date:"Y-m-d H:i:s" }} {% endif %} @@ -79,7 +80,7 @@ during the last 24 hours, starting from the most recent one.

{% if job.is_done %} {{ job.endofrendering_time|date:"Y-m-d H:i:s" }} {% else %} - not finished + {% trans "not finished" %} {% endif %}
diff --git a/www/templates/maposmatic/all_maps.html b/www/templates/maposmatic/all_maps.html index 46c7f4c..f53fed8 100644 --- a/www/templates/maposmatic/all_maps.html +++ b/www/templates/maposmatic/all_maps.html @@ -24,12 +24,13 @@ --> {% extends "maposmatic/base.html" %} +{% load i18n %} {% block menu-maps %} class="activelink" {% endblock %} {% block page %} -

Maps

+

{% trans "Maps" %}

{% endblock %} diff --git a/www/templates/maposmatic/base.html b/www/templates/maposmatic/base.html index a74f734..554fbed 100644 --- a/www/templates/maposmatic/base.html +++ b/www/templates/maposmatic/base.html @@ -22,7 +22,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> - +{% load i18n %} @@ -43,10 +43,10 @@

Your free city maps !

@@ -57,14 +57,14 @@
-

Links :

+

{% trans "Links:" %}

- +
{% trans "Design by" %} Minimalistic Design
diff --git a/www/templates/maposmatic/index.html b/www/templates/maposmatic/index.html index bbd8d7d..9cda698 100644 --- a/www/templates/maposmatic/index.html +++ b/www/templates/maposmatic/index.html @@ -24,6 +24,7 @@ --> {% extends "maposmatic/base.html" %} +{% load i18n %} {% block extrajs %} function area_selection_mode_switch(mode) @@ -131,23 +132,23 @@ this page will contain links to the generated map.

- + - + - + - + - +
Title of the map{% trans "Title of the map" %} {{ form.maptitle }} {{ form.maptitle.errors }}
Area selection mode{% trans "Area selection mode" %} {{ form.mode }}
City name{% trans "City name" %} {{ form.administrative_city }} {{ form.administrative_city.errors }}
diff --git a/www/templates/maposmatic/job.html b/www/templates/maposmatic/job.html index 2604105..8f7da7e 100644 --- a/www/templates/maposmatic/job.html +++ b/www/templates/maposmatic/job.html @@ -24,6 +24,7 @@ --> {% extends "maposmatic/base.html" %} +{% load i18n %} {% load extratags %} @@ -32,21 +33,21 @@ class="activelink" {% endblock %} {% block page %} -

Map {{ job.maptitle }} Status

+

{% blocktrans with job.maptitle as job_t %}Map {{ job_t }} Status{% endblocktrans %}

- + {% if job.administrative_city %} - + {% else %} - + {% endif %} - + - - + + - + - + {% if job.is_waiting %} - + - + {% endif %} {% if job.is_done_ok %} - +
Map title{% trans "Map title" %} {{ job.maptitle }}
Administrative city{% trans "Administrative city" %} {{ job.administrative_city }}
Bounding-box coordinates{% trans "Bounding-box coordinates" %} (lat={{ job.lat_upper_left }}, lon={{ job.lon_upper_left }}), @@ -56,46 +57,46 @@ class="activelink"
Status{% trans "Status" %} {{ job.status|job_status_to_str:job.resultmsg }}
Submission time{{ job.submission_time|date:"l d M Y \a\t H:i:s" }}{% trans "Submission time" %}{{ job.submission_time|date:"l d M Y\, H:i:s"}}
Start of rendering time{% trans "Start of rendering time" %} {% if job.is_waiting %} - Rendering not started yet + {% trans "Rendering not started yet" %} {% else %} - {{ job.startofrendering_time|date:"l d M Y \a\t H:i:s" }} + {{ job.startofrendering_time|date:"l d M Y\, H:i:s" }} {% endif %}
End of rendering time{% trans "End of rendering time" %} {% if job.is_done %} - {{ job.endofrendering_time|date:"l d M Y \a\t H:i:s" }} + {{ job.endofrendering_time|date:"l d M Y\, H:i:s" }} {% else %} - Rendering not finished yet + {% trans "Rendering not finished yet" %} {% endif %}
Current position in queue{% trans "Current position in queue" %} {{ job.current_position_in_queue }}
Estimated rendering time completion{% trans "Estimated rendering time completion" %} {{ job.rendering_estimated_start_time|timeuntil }}
Result files{% trans "Result files" %}
    {% for file in job.output_files %}