Verified Commit 52ecd59b authored by ynerant's avatar ynerant
Browse files

Translate models in english

parent 2a17a32d
Pipeline #9502 failed with stages
in 1 minute and 14 seconds
......@@ -13,16 +13,16 @@ from .admin import admin_site
# API router
router = routers.DefaultRouter()
router.register(r'authors', media.views.AuteurViewSet)
router.register(r'media/bd', media.views.BDViewSet)
router.register(r'authors', media.views.AuthorViewSet)
router.register(r'media/bd', media.views.ComicViewSet)
router.register(r'media/manga', media.views.MangaViewSet)
router.register(r'media/cd', media.views.CDViewSet)
router.register(r'media/vinyle', media.views.VinyleViewSet)
router.register(r'media/roman', media.views.RomanViewSet)
router.register(r'media/revue', media.views.RevueViewSet)
router.register(r'media/future', media.views.FutureMediaViewSet)
router.register(r'media/vinyle', media.views.VinylViewSet)
router.register(r'media/novel', media.views.NovelViewSet)
router.register(r'media/revue', media.views.ReviewViewSet)
router.register(r'media/future', media.views.FutureMediumViewSet)
router.register(r'borrowed_items', media.views.EmpruntViewSet)
router.register(r'games', media.views.JeuViewSet)
router.register(r'games', media.views.GameViewSet)
router.register(r'users', users.views.UserViewSet)
router.register(r'groups', users.views.GroupViewSet)
......
......@@ -9,8 +9,8 @@ from med.admin import admin_site
from reversion.admin import VersionAdmin
from .forms import MediaAdminForm
from .models import Auteur, BD, CD, Emprunt, FutureMedia, Jeu, Manga,\
Revue, Roman, Vinyle
from .models import Author, CD, Comic, Emprunt, FutureMedium, Game, Manga,\
Novel, Review, Vinyl
class AuteurAdmin(VersionAdmin):
......@@ -147,13 +147,13 @@ class JeuAdmin(VersionAdmin):
autocomplete_fields = ('proprietaire',)
admin_site.register(Auteur, AuteurAdmin)
admin_site.register(BD, MediaAdmin)
admin_site.register(Author, AuteurAdmin)
admin_site.register(Comic, MediaAdmin)
admin_site.register(Manga, MediaAdmin)
admin_site.register(Roman, MediaAdmin)
admin_site.register(Novel, MediaAdmin)
admin_site.register(CD, CDAdmin)
admin_site.register(Vinyle, VinyleAdmin)
admin_site.register(Revue, RevueAdmin)
admin_site.register(FutureMedia, FutureMediaAdmin)
admin_site.register(Vinyl, VinyleAdmin)
admin_site.register(Review, RevueAdmin)
admin_site.register(FutureMedium, FutureMediaAdmin)
admin_site.register(Emprunt, EmpruntAdmin)
admin_site.register(Jeu, JeuAdmin)
admin_site.register(Game, JeuAdmin)
......@@ -13,7 +13,7 @@ from django.db.models import QuerySet
from django.forms import ModelForm
from django.utils.translation import gettext_lazy as _
from .models import Auteur, BD
from .models import Author, Comic
from .scraper import BedetequeScraper
......@@ -123,7 +123,7 @@ class MediaAdminForm(ModelForm):
self.cleaned_data["publish_date"] += "-01"
self.cleaned_data["number_of_pages"] = data["pages"]
self.cleaned_data["authors"] = \
list(Auteur.objects.get_or_create(name=author_name)[0]
list(Author.objects.get_or_create(name=author_name)[0]
for author_name in data["authors"])
self.cleaned_data["external_url"] = data["image"]
return True
......@@ -195,7 +195,7 @@ class MediaAdminForm(ModelForm):
if 'authors' in info:
for author in info['authors']:
author_obj = Auteur.objects.get_or_create(
author_obj = Author.objects.get_or_create(
name=author)[0]
self.cleaned_data['authors'].append(author_obj)
......@@ -269,7 +269,7 @@ class MediaAdminForm(ModelForm):
if 'authors' in data:
for author in data['authors']:
author_obj = Auteur.objects.get_or_create(
author_obj = Author.objects.get_or_create(
name=author['name'])[0]
self.cleaned_data['authors'].append(author_obj)
......@@ -343,7 +343,7 @@ class MediaAdminForm(ModelForm):
self.add_error(name, e)
class Meta:
model = BD
model = Comic
fields = ('isbn', 'title', 'subtitle', 'external_url',
'side_identifier', 'authors', 'number_of_pages',
'publish_date', 'present', )
......@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-02 13:02+0200\n"
"POT-Creation-Date: 2021-10-23 18:27+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -13,20 +13,20 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: admin.py:34 admin.py:89 admin.py:100 models.py:29 models.py:65 models.py:130
#: admin.py:33 admin.py:88 admin.py:99 models.py:29 models.py:65 models.py:130
#: models.py:192 models.py:243 models.py:274
msgid "authors"
msgstr "auteurs"
#: admin.py:44
#: admin.py:43
msgid "external url"
msgstr "URL externe"
#: admin.py:127
#: admin.py:126
msgid "Turn back"
msgstr "Rendre"
#: admin.py:130 models.py:407
#: admin.py:129 models.py:407
msgid "given back to"
msgstr "rendu à"
......@@ -34,7 +34,7 @@ msgstr "rendu à"
msgid "ISBN-10 or ISBN-13"
msgstr "ISBN-10 ou ISBN-13"
#: forms.py:244
#: forms.py:301
msgid "This ISBN is not found."
msgstr "L'ISBN n'a pas été trouvé."
......@@ -94,11 +94,11 @@ msgid "Tell that the medium is present in the Mediatek."
msgstr "Indique que le medium est présent à la Mediatek."
#: models.py:93 models.py:355
msgid "BD"
msgid "Comic"
msgstr "BD"
#: models.py:94
msgid "BDs"
msgid "Comics"
msgstr "BDs"
#: models.py:155
......@@ -110,11 +110,11 @@ msgid "mangas"
msgstr "mangas"
#: models.py:217
msgid "roman"
msgid "novel"
msgstr "roman"
#: models.py:218
msgid "romans"
msgid "novels"
msgstr "romans"
#: models.py:234
......@@ -130,12 +130,12 @@ msgid "45 RPM"
msgstr "45 TPM"
#: models.py:256
msgid "vinyle"
msgid "vinyl"
msgstr "vinyle"
#: models.py:257
msgid "vinyles"
msgstr "vinyle"
msgid "vinyls"
msgstr "vinyles"
#: models.py:287
msgid "CD"
......@@ -166,11 +166,11 @@ msgid "double"
msgstr "double"
#: models.py:338
msgid "revue"
msgid "review"
msgstr "revue"
#: models.py:339
msgid "revues"
msgid "reviews"
msgstr "revues"
#: models.py:353
......@@ -277,12 +277,6 @@ msgstr "ISBN invalide : mauvaise longueur"
msgid "Invalid ISBN: Only upper case allowed"
msgstr "ISBN invalide : seulement les majuscules sont autorisées"
#: views.py:50
#: views.py:51
msgid "Welcome to the Mediatek database"
msgstr "Bienvenue sur la base de données de la Mediatek"
#~ msgid "medium"
#~ msgstr "medium"
#~ msgid "media"
#~ msgstr "media"
from django.core.management import BaseCommand
from media.models import BD, CD, Manga, Revue, Roman, Vinyle, Jeu
from media.models import Comic, CD, Manga, Review, Novel, Vinyl, Game
class Command(BaseCommand):
......@@ -18,9 +18,9 @@ class Command(BaseCommand):
f.write("Ce site répertorie l'intégralité des media présents "
"à la Mediatek de l'ENS Paris-Saclay.\n")
for model_class, file_name in [(BD, "bd.md"), (Manga, "mangas.md"),
(Roman, "romans.md"),
(CD, "cd.md"), (Vinyle, "vinyles.md")]:
for model_class, file_name in [(Comic, "bd.md"), (Manga, "mangas.md"),
(Novel, "romans.md"),
(CD, "cd.md"), (Vinyl, "vinyles.md")]:
self.process_model_class(model_class, file_name, f, directory)
# Traitement différent pour les revues
......@@ -28,13 +28,13 @@ class Command(BaseCommand):
f.write("# Revues\n\n\n")
titles = list(set(obj["title"] for obj in
Revue.objects.values("title").distinct().all()))
Review.objects.values("title").distinct().all()))
titles.sort()
for title in titles:
f.write(f"## {title}\n\n\n")
for medium in Revue.objects.filter(title=title)\
for medium in Review.objects.filter(title=title)\
.order_by("number").all():
f.write(f"### Numéro {medium.number}\n\n\n")
if medium.double:
......@@ -51,7 +51,7 @@ class Command(BaseCommand):
with open(directory + "/docs/jeux.md", "w") as f:
f.write("# Jeux\n\n\n")
for game in Jeu.objects.order_by("name").all():
for game in Game.objects.order_by("name").all():
f.write(f"## {game.name}\n\n\n")
f.write(f"Durée : {game.duree}\n\n")
f.write(f"Nombre de joueurs : {game.nombre_joueurs_min} "
......
......@@ -2,7 +2,7 @@ from argparse import FileType
from sys import stdin
from django.core.management import BaseCommand
from media.models import Auteur, CD
from media.models import Author, CD
class Command(BaseCommand):
......@@ -29,7 +29,7 @@ class Command(BaseCommand):
title = cd[0]
side = cd[1]
authors_str = cd[2].split('|')
authors = [Auteur.objects.get_or_create(name=author)[0]
authors = [Author.objects.get_or_create(name=author)[0]
for author in authors_str]
cd, created = CD.objects.get_or_create(
title=title,
......
......@@ -3,20 +3,20 @@ from time import sleep
from django.core.management import BaseCommand
from media.forms import MediaAdminForm
from media.models import BD, FutureMedia, Manga, Roman
from media.models import Comic, FutureMedium, Manga, Novel
class Command(BaseCommand):
def handle(self, *args, **options):
for future_medium in FutureMedia.objects.all():
for future_medium in FutureMedium.objects.all():
isbn = future_medium.isbn
type_str = future_medium.type
if type_str == 'bd':
cl = BD
cl = Comic
elif type_str == 'manga':
cl = Manga
elif type_str == 'roman':
cl = Roman
cl = Novel
else:
self.stderr.write(self.style.WARNING(
"Unknown medium type: {type}. Ignoring..."
......
......@@ -3,7 +3,7 @@ from sys import stdin
from django.core.exceptions import ValidationError
from django.core.management import BaseCommand
from media.models import BD, FutureMedia, Manga, Roman
from media.models import Comic, FutureMedium, Manga, Novel
from media.validators import isbn_validator
......@@ -27,7 +27,7 @@ class Command(BaseCommand):
def handle(self, *args, **options):
type_str = options["media_type"]
media_classes = [BD, Manga, Roman, FutureMedia]
media_classes = [Comic, Manga, Novel, FutureMedium]
file = options["input"]
isbns = []
......@@ -70,7 +70,7 @@ class Command(BaseCommand):
if isbn_exists:
continue
FutureMedia.objects.create(isbn=isbn, type=type_str)
FutureMedium.objects.create(isbn=isbn, type=type_str)
self.stdout.write(self.style.SUCCESS("ISBN {isbn} imported"
.format(isbn=isbn)))
imported += 1
......
......@@ -2,7 +2,7 @@ from argparse import FileType
from sys import stdin
from django.core.management import BaseCommand
from media.models import Auteur, BD
from media.models import Author, Comic
class Command(BaseCommand):
......@@ -28,9 +28,9 @@ class Command(BaseCommand):
title = revue[0]
number = revue[1]
authors = [Auteur.objects.get_or_create(name=n)[0]
authors = [Author.objects.get_or_create(name=n)[0]
for n in revue[2].split('|')]
bd = BD.objects.create(
bd = Comic.objects.create(
title=title,
subtitle=number,
side_identifier="{:.3} {:.3} {:0>2}"
......
......@@ -3,7 +3,7 @@ from sys import stdin
from django.core.management import BaseCommand
from media.forms import generate_side_identifier
from media.models import Roman, Auteur
from media.models import Novel, Author
class Command(BaseCommand):
......@@ -28,10 +28,10 @@ class Command(BaseCommand):
continue
title = book[1]
authors = [Auteur.objects.get_or_create(name=n)[0]
authors = [Author.objects.get_or_create(name=n)[0]
for n in book[0].split(';')]
side_identifier = generate_side_identifier(title, authors)
roman = Roman.objects.create(
roman = Novel.objects.create(
title=title,
side_identifier=side_identifier,
)
......
......@@ -2,7 +2,7 @@ from argparse import FileType
from sys import stdin
from django.core.management import BaseCommand
from media.models import Revue
from media.models import Review
class Command(BaseCommand):
......@@ -37,7 +37,7 @@ class Command(BaseCommand):
year = revue[4]
if not year:
year = None
revue, created = Revue.objects.get_or_create(
revue, created = Review.objects.get_or_create(
title=title,
number=number.replace('*', ''),
year=year,
......
......@@ -2,7 +2,7 @@ from argparse import FileType
from sys import stdin
from django.core.management import BaseCommand
from media.models import Auteur, Vinyle
from media.models import Author, Vinyl
class Command(BaseCommand):
......@@ -36,9 +36,9 @@ class Command(BaseCommand):
title = vinyle[1 if rpm == 33 else 2]
authors_str = vinyle[2 if rpm == 33 else 1]\
.split('|' if rpm == 33 else ';')
authors = [Auteur.objects.get_or_create(name=author)[0]
authors = [Author.objects.get_or_create(name=author)[0]
for author in authors_str]
vinyle, created = Vinyle.objects.get_or_create(
vinyle, created = Vinyl.objects.get_or_create(
title=title,
side_identifier=side,
rpm=rpm,
......
from django.core.management import BaseCommand
from django.db import transaction
from media.forms import generate_side_identifier
from media.models import BD, Manga, Roman
from media.models import Comic, Manga, Novel
class Command(BaseCommand):
......@@ -24,11 +24,11 @@ class Command(BaseCommand):
t = options["type"]
medium_class = None
if t == "bd":
medium_class = BD
medium_class = Comic
elif t == "manga":
medium_class = Manga
elif t == "roman":
medium_class = Roman
medium_class = Novel
interactive_mode = not options["noninteractivemode"]
......
......@@ -2,7 +2,7 @@ from time import sleep
from django.core.management import BaseCommand
from media.forms import MediaAdminForm
from media.models import BD, Manga
from media.models import Comic, Manga
class Command(BaseCommand):
......@@ -14,7 +14,7 @@ class Command(BaseCommand):
def handle(self, *args, **options):
converted = 0
for media in BD.objects.all():
for media in Comic.objects.all():
if media.pk < 3400:
continue
# We sleep 5 seconds to avoid a ban from Bedetheque
......
# Generated by Django 2.2.17 on 2021-10-23 16:30
from django.conf import settings
from django.db import migrations, models
import media.fields
import media.validators
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('media', '0039_mark_media_present'),
]
operations = [
migrations.RenameModel(
old_name='Auteur',
new_name='Author',
),
migrations.RenameModel(
old_name='Roman',
new_name='Comic',
),
migrations.RenameModel(
old_name='Jeu',
new_name='Game',
),
migrations.RenameModel(
old_name='BD',
new_name='Novel',
),
migrations.RenameModel(
old_name='Revue',
new_name='Review',
),
migrations.RenameModel(
old_name='Vinyle',
new_name='Vinyl',
),
migrations.RenameModel(
old_name='FutureMedia',
new_name='FutureMedium',
),
migrations.AlterModelOptions(
name='comic',
options={'ordering': ['title', 'subtitle'], 'verbose_name': 'comic', 'verbose_name_plural': 'comics'},
),
migrations.AlterModelOptions(
name='novel',
options={'ordering': ['title', 'subtitle'], 'verbose_name': 'novel', 'verbose_name_plural': 'novels'},
),
migrations.AlterModelOptions(
name='review',
options={'ordering': ['title', 'number'], 'verbose_name': 'review', 'verbose_name_plural': 'reviews'},
),
migrations.AlterModelOptions(
name='vinyl',
options={'ordering': ['title'], 'verbose_name': 'vinyl', 'verbose_name_plural': 'vinyls'},
),
]
......@@ -9,7 +9,7 @@ from django.utils.translation import gettext_lazy as _
from .fields import ISBNField
class Auteur(models.Model):
class Author(models.Model):
name = models.CharField(
max_length=255,
unique=True,
......@@ -30,7 +30,7 @@ class Auteur(models.Model):
ordering = ['name']
class BD(models.Model):
class Comic(models.Model):
isbn = ISBNField(
_('ISBN'),
help_text=_('You may be able to scan it from a bar code.'),
......@@ -61,7 +61,7 @@ class BD(models.Model):
)
authors = models.ManyToManyField(
'Auteur',
'Author',
verbose_name=_('authors'),
)
......@@ -90,8 +90,8 @@ class BD(models.Model):
return self.title
class Meta:
verbose_name = _("BD")
verbose_name_plural = _("BDs")
verbose_name = _("comic")
verbose_name_plural = _("comics")
ordering = ['title', 'subtitle']
......@@ -126,7 +126,7 @@ class Manga(models.Model):
)
authors = models.ManyToManyField(
'Auteur',
'Author',
verbose_name=_('authors'),
)
......@@ -157,7 +157,7 @@ class Manga(models.Model):
ordering = ['title']
class Roman(models.Model):
class Novel(models.Model):
isbn = ISBNField(
_('ISBN'),
help_text=_('You may be able to scan it from a bar code.'),
......@@ -188,7 +188,7 @@ class Roman(models.Model):
)
authors = models.ManyToManyField(
'Auteur',
'Author',
verbose_name=_('authors'),
)
......@@ -214,12 +214,12 @@ class Roman(models.Model):
return self.title
class Meta:
verbose_name = _("roman")
verbose_name_plural = _("romans")
verbose_name = _("novel")
verbose_name_plural = _("novels")
ordering = ['title', 'subtitle']
class Vinyle(models.Model):
class Vinyl(models.Model):
title = models.CharField(
verbose_name=_('title'),
max_length=255,
......@@ -239,7 +239,7 @@ class Vinyle(models.Model):
)
authors = models.ManyToManyField(
'Auteur',
'Author',
verbose_name=_('authors'),
)
......@@ -253,8 +253,8 @@ class Vinyle(models.Model):
return self.title
class Meta:
verbose_name = _("vinyle")
verbose_name_plural = _("vinyles")
verbose_name = _("vinyl")
verbose_name_plural = _("vinyls")
ordering = ['title']
......@@ -270,7 +270,7 @@ class CD(models.Model):