Titre adapté avec accord

This commit is contained in:
Jean-Marie Favreau 2023-10-29 22:25:05 +01:00
parent 8cdb578277
commit db7a8ca365
8 changed files with 277 additions and 15 deletions

View File

@ -0,0 +1,214 @@
# Traductions en français de agenda_culturel.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Jean-Marie Favreau <jeanmarie.favreau@free.fr>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: agenda_culturel\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-29 21:20+0000\n"
"PO-Revision-Date: 2023-10-29 14:16+0000\n"
"Last-Translator: Jean-Marie Favreau <jeanmarie.favreau@free.fr>\n"
"Language-Team: Jean-Marie Favreau <jeanmarie.favreau@free.fr>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: agenda_culturel/models.py:25
msgid "Name"
msgstr "Nom"
#: agenda_culturel/models.py:25
msgid "Category name"
msgstr "Nom de la catégorie"
#: agenda_culturel/models.py:26
msgid "Alternative Name"
msgstr "Nom alternatif"
#: agenda_culturel/models.py:26
msgid "Alternative name used with a time period"
msgstr "Nom alternatif utilisé avec une période de temps"
#: agenda_culturel/models.py:27
#, fuzzy
#| msgid "Short title"
msgid "Short name"
msgstr "Nom court"
#: agenda_culturel/models.py:27
msgid "Short name of the category"
msgstr "Nom court de la catégorie"
#: agenda_culturel/models.py:28
msgid "Color"
msgstr "Couleur"
#: agenda_culturel/models.py:28
msgid "Color used as background for the category"
msgstr "Couleur utilisée comme fond de la catégorie"
#: agenda_culturel/models.py:53 agenda_culturel/models.py:70
msgid "Category"
msgstr "Catégorie"
#: agenda_culturel/models.py:54
msgid "Categories"
msgstr "Catégories"
#: agenda_culturel/models.py:59
msgid "Published"
msgstr "Publié"
#: agenda_culturel/models.py:60
msgid "Trash"
msgstr "Corbeille"
#: agenda_culturel/models.py:61
msgid "Draft"
msgstr "Brouillon"
#: agenda_culturel/models.py:66
msgid "Title"
msgstr "Titre"
#: agenda_culturel/models.py:66
msgid "Short title"
msgstr "Titre court"
#: agenda_culturel/models.py:68
msgid "Status"
msgstr "Status"
#: agenda_culturel/models.py:70
#, fuzzy
#| msgid "Day of the event"
msgid "Category of the event"
msgstr "Date de l'événement"
#: agenda_culturel/models.py:72
msgid "Day of the event"
msgstr "Date de l'événement"
#: agenda_culturel/models.py:73
msgid "Starting time"
msgstr "Heure de début"
#: agenda_culturel/models.py:75
msgid "End day of the event"
msgstr "Fin de l'événement"
#: agenda_culturel/models.py:75
msgid "End day of the event, only required if different from the start day."
msgstr ""
"Date de fin de l'événement, uniquement nécessaire s'il est différent du "
"premier jour de l'événement"
#: agenda_culturel/models.py:76
msgid "Final time"
msgstr "Heure de fin"
#: agenda_culturel/models.py:78
msgid "Location"
msgstr "Localisation"
#: agenda_culturel/models.py:78
msgid "Address of the event"
msgstr "Adresse de l'événement"
#: agenda_culturel/models.py:80
msgid "Description"
msgstr "Description"
#: agenda_culturel/models.py:80
msgid "General description of the event"
msgstr "Description générale de l'événement"
#: agenda_culturel/models.py:82
msgid "Illustration"
msgstr "Illustration"
#: agenda_culturel/models.py:82
msgid "URL of the illustration image"
msgstr "URL de l'image illustrative"
#: agenda_culturel/models.py:83
msgid "Illustration description"
msgstr "Description de l'illustration"
#: agenda_culturel/models.py:83
msgid "Alternative text used by screen readers for the image"
msgstr "Texte alternatif utiliser par les lecteurs d'écrans pour l'image"
#: agenda_culturel/models.py:85
msgid "URLs"
msgstr "URLs"
#: agenda_culturel/models.py:85
msgid "List of all the urls where this event can be found."
msgstr "Liste de toutes les urls où l'événement peut être trouvé."
#: agenda_culturel/models.py:87
msgid "Tags"
msgstr "Étiquettes"
#: agenda_culturel/models.py:87
msgid "A list of tags that describe the event."
msgstr "Une liste d'étiquettes décrivant l'événement"
#: agenda_culturel/models.py:96
msgid "Event"
msgstr "Événement"
#: agenda_culturel/models.py:97
msgid "Events"
msgstr "Événements"
#: agenda_culturel/models.py:101
#, fuzzy
#| msgid "URLs"
msgid "URL"
msgstr "URLs"
#: agenda_culturel/models.py:101
#, fuzzy
#| msgid "List of all the urls where this event can be found."
msgid "URL where this event can be found."
msgstr "Liste de toutes les urls où l'événement peut être trouvé."
#: agenda_culturel/models.py:105
msgid "Event submission form"
msgstr "Formulaire de proposition d'événement"
#: agenda_culturel/models.py:106
msgid "Event submissions forms"
msgstr "Formulaires de proposition d'événement"
#: agenda_culturel/settings/base.py:122
msgid "English"
msgstr "anglais"
#: agenda_culturel/settings/base.py:123
msgid "French"
msgstr "français"
msgid "this week"
msgstr "cette semaine"
msgid "this weekend"
msgstr "ce week-end"
msgid "next week"
msgstr "la semaine prochaine"
msgid "next weekend"
msgstr "le week-end prochain"
msgid "this month"
msgstr "ce mois-ci"
msgid "next month"
msgstr "le mois prochain"

View File

@ -0,0 +1,19 @@
# Generated by Django 4.2.1 on 2023-10-29 21:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agenda_culturel', '0008_alter_event_reference_urls_alter_event_tags'),
]
operations = [
migrations.AddField(
model_name='category',
name='plural',
field=models.CharField(default='1', help_text='Category name (plural)', max_length=512, verbose_name='Plural nName'),
preserve_default=False,
),
]

View File

@ -0,0 +1,23 @@
# Generated by Django 4.2.1 on 2023-10-29 21:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agenda_culturel', '0009_category_plural'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='plural',
),
migrations.AddField(
model_name='category',
name='alt_name',
field=models.CharField(default='1', help_text='Alternative name used with a time period', max_length=512, verbose_name='Alternative Name'),
preserve_default=False,
),
]

View File

@ -23,6 +23,7 @@ class Category(models.Model):
("#b33dc6", "color 9")] ("#b33dc6", "color 9")]
name = models.CharField(verbose_name=_('Name'), help_text=_('Category name'), max_length=512) name = models.CharField(verbose_name=_('Name'), help_text=_('Category name'), max_length=512)
alt_name = models.CharField(verbose_name=_('Alternative Name'), help_text=_('Alternative name used with a time period'), max_length=512)
codename = models.CharField(verbose_name=_('Short name'), help_text=_('Short name of the category'), max_length=3) codename = models.CharField(verbose_name=_('Short name'), help_text=_('Short name of the category'), max_length=3)
color = ColorField(verbose_name=_('Color'), help_text=_('Color used as background for the category'), blank=True, null=True) color = ColorField(verbose_name=_('Color'), help_text=_('Color used as background for the category'), blank=True, null=True)

View File

@ -37,7 +37,12 @@
</header> </header>
<section> <section>
{% block events %} {% block events %}
<h2>{{ selected_mode | capfirst }}</h2> <h2> {% if category %}
{{ category.alt_name | capfirst }}
{{ selected_mode }}
{% else %}
{{ selected_mode | capfirst }}
{% endif %}</h2>
{% endblock %} {% endblock %}
</section> </section>
<footer id="tags"> <footer id="tags">

View File

@ -7,12 +7,12 @@ from django.urls import path, include, re_path
from .views import * from .views import *
modes = '|'.join([dm.name for dm in DisplayMode]) + ")" modes = '|'.join([dm.name for dm in DisplayMode])
urlpatterns = [ urlpatterns = [
path("", home, name="home"), path("", home, name="home"),
re_path(r'^(?P<mode>' + modes + '/$', view_mode, name='view_mode'), re_path(r'^(?P<mode>' + modes + ')/$', view_mode, name='view_mode'),
re_path(r'^(?P<mode>' + modes + '/(?P<cat_id>\d+)/$', view_mode_cat, name='view_mode_cat'), re_path(r'^(?P<mode>' + modes + ')/(?P<cat_id>\d+)/$', view_mode_cat, name='view_mode_cat'),
path("event/<int:pk>-<extra>", EventDetailView.as_view(), name="view_event"), path("event/<int:pk>-<extra>", EventDetailView.as_view(), name="view_event"),
path("proposer", EventSubmissionFormView.as_view(), name="event_submission_form"), path("proposer", EventSubmissionFormView.as_view(), name="event_submission_form"),
path("admin/", admin.site.urls), path("admin/", admin.site.urls),

View File

@ -70,7 +70,7 @@ def view_mode_cat(request, mode, cat_id):
category = get_object_or_404(Category, pk=cat_id) category = get_object_or_404(Category, pk=cat_id)
categories = Category.objects.all() categories = Category.objects.all()
# TODO: select matching events # TODO: select matching events
context = {"modes": list(DisplayMode), "selected_mode": mode, "category": category, "categories": categories} context = {"modes": list(DisplayMode), "selected_mode": DisplayMode[mode], "category": category, "categories": categories}
return render(request, 'agenda_culturel/page-events.html', context) return render(request, 'agenda_culturel/page-events.html', context)

View File

@ -6,20 +6,20 @@ def run():
# divers # divers
categories = [ categories = [
("Théâtre", "THÉ"), ("Théâtre", "Au théâtre", "THÉ"),
("Concert", "CCR"), ("Concert", "Concerts", "CCR"),
("Danse", "DSE"), ("Danse", "En danse", "DSE"),
("Arts du spectacle", "SPE"), ("Arts du spectacle", None, "SPE"),
("Jeune public", "JEP"), ("Jeune public", "Pour le jeune public", "JEP"),
("Exposition", "EXP"), ("Exposition", "Expositions", "EXP"),
("Conférence", "CNF"), ("Conférence", "Conférences", "CNF"),
("Nature", "NTR"), ("Nature", "Événements nature", "NTR"),
("Divers", "DIV") ("Autre", "Autres événements", "ATR")
] ]
if len(Category.objects.all()) == 0: if len(Category.objects.all()) == 0:
print("On créée des catégories") print("On créée des catégories")
for c in categories: for c in categories:
cat = Category(name=c[0], codename=c[1]) cat = Category(name=c[0], alt_name = c[1] if c[1] is not None else c[0], codename=c[2])
cat.save() cat.save()