From 87b88f4b3401e02b42ae96d7aaf99ba016571c0b Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 28 May 2020 13:33:07 +0200 Subject: [PATCH] Add alert messages. --- src/archive/locale/pl/LC_MESSAGES/django.mo | Bin 3707 -> 4174 bytes src/archive/locale/pl/LC_MESSAGES/django.po | 126 +++++++++++------- .../templates/archive/file_managed.html | 4 + src/archive/views.py | 11 ++ 4 files changed, 94 insertions(+), 47 deletions(-) diff --git a/src/archive/locale/pl/LC_MESSAGES/django.mo b/src/archive/locale/pl/LC_MESSAGES/django.mo index 3156f354c1342f21f332d5013e40fef706e69836..20211dd2deb863e3f191cefc8ffa17e5c731a072 100644 GIT binary patch delta 1971 zcmZvcU1%It7>3WbO=8lG+N8DG#`aX3Hc6A!B(0_~rc|Q%M^j?_Nh^lg-65SMI}>+y z*(RVXLWzPmb}1z-^hOau!JieRP%lc83k4MvMHE{Qq^O|wsuwEyyt}hf!NYv#IcLt# z_kQ0wGk>&wW{VeF)|@bueOMc|ew8s3FusP0GFNBJ_3&BP0AGLu@Fln&o`;*@*Ki%Y z0_)*wD!p%lEwCNl0teuAa17pVOwk;s!5UM9JmwgcCcFZfU{1gr;8`dKAH&t~J1Ak7 zpd9=PH7|zBF1QYMz#(`5x={Om0C~(uR4w>7D>NE;@eNc&KfoqY5n!nROJPzPkl z^hfW9pib!lsEr?inwNyiXa@3_kV*ocgYxq-)IP7mq6SXU(1JIhHh3Ezj~VkJY^MJ( zleFL|xCc5=nK%h8d=Dx^UqG$@5#9`chsr=>yxQLk+0yKW77oYBzZ6aKLY#tf6u>Tc z6mEd8!Oie2RK#CFo%Od+4t|dMf5Kk+aa8L<55r0LJk-7yp#)rpI_fLUu{9*J5a*^hBv|usMY!%P{Qw{l8~_?4MqMm z)TK#7o&CvZ!Wk$BZ$b$xLq&2PDifbT9mVI-_)kzrc@^T@`~`VT92N4@2DN@Wl(1qC zwHyvd1NTFYzEU)y8@n6RCMx;kH2v6COh=<~ zr@nusZyT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2mZY~-IAB*N`1(mE;*JMPRyMTL?a<{a4<5Qh^w0Z Iv+R)TFO0~H_y7O^ diff --git a/src/archive/locale/pl/LC_MESSAGES/django.po b/src/archive/locale/pl/LC_MESSAGES/django.po index 7820153..6422547 100644 --- a/src/archive/locale/pl/LC_MESSAGES/django.po +++ b/src/archive/locale/pl/LC_MESSAGES/django.po @@ -7,16 +7,16 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 14:18+0200\n" -"PO-Revision-Date: 2020-04-01 14:19+0200\n" +"POT-Creation-Date: 2020-05-28 13:31+0200\n" +"PO-Revision-Date: 2020-05-28 13:32+0200\n" "Last-Translator: Radek Czajka \n" +"Language-Team: \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" -"Language-Team: \n" "X-Generator: Poedit 2.2.4\n" #: constants.py:10 @@ -35,67 +35,71 @@ msgstr "Opisywanie" msgid "Sending" msgstr "Wysyłanie" -#: models.py:20 models.py:46 +#: models.py:31 models.py:75 msgid "project" msgstr "projekt" -#: models.py:21 +#: models.py:32 msgid "projects" msgstr "projekty" -#: models.py:34 +#: models.py:63 msgid "source file" msgstr "plik źródłowy" -#: models.py:37 +#: models.py:66 msgid "title" msgstr "tytuł" -#: models.py:38 +#: models.py:67 msgid "part name" msgstr "nazwa części" -#: models.py:38 +#: models.py:67 msgid "eg. chapter in a novel" msgstr "np. rozdział w powieści" -#: models.py:40 +#: models.py:69 msgid "index" msgstr "numer" -#: models.py:41 +#: models.py:70 msgid "parts count" msgstr "liczba części" -#: models.py:42 +#: models.py:71 msgid "artist" msgstr "lektor" -#: models.py:43 +#: models.py:72 msgid "conductor" msgstr "reżyser" -#: models.py:44 +#: models.py:73 msgid "encoded by" msgstr "przyg. techn." -#: models.py:45 +#: models.py:74 msgid "date" msgstr "data" -#: models.py:47 +#: models.py:76 msgid "book url" msgstr "URL książki" -#: models.py:48 +#: models.py:77 msgid "translator" msgstr "tłumacz" -#: models.py:74 +#: models.py:79 +msgid "license" +msgstr "" + +#: models.py:104 msgid "audiobook" msgstr "audiobook" -#: models.py:75 +#: models.py:105 msgid "audiobooks" msgstr "audiobooki" @@ -107,7 +111,7 @@ msgstr "Nowe" msgid "Unpublished" msgstr "Nie opublikowane" -#: templates/archive/base.html:8 templates/archive/file_managed.html:12 +#: templates/archive/base.html:8 templates/archive/file_managed.html:16 msgid "Publishing" msgstr "Publikacja" @@ -135,88 +139,95 @@ msgstr "Zaloguj" msgid "Administration" msgstr "Administracja" -#: templates/archive/file_managed.html:16 +#: templates/archive/file_managed.html:20 msgid "Publishing pending" msgstr "Czeka na publikację" -#: templates/archive/file_managed.html:19 +#: templates/archive/file_managed.html:23 msgid "Cancel publishing" msgstr "Anuluj publikację" -#: templates/archive/file_managed.html:58 +#: templates/archive/file_managed.html:62 msgid "Publish" msgstr "Opublikuj" -#: templates/archive/file_managed.html:67 -#: templates/archive/file_managed.html:79 +#: templates/archive/file_managed.html:71 msgid "Convert without publishing" msgstr "Konwertuj bez publikacji" -#: templates/archive/file_managed.html:74 +#: templates/archive/file_managed.html:78 +msgid "Preview YouTube metadata" +msgstr "" + +#: templates/archive/file_managed.html:83 msgid "Publish on YouTube" msgstr "Opublikuj na YouTube" -#: templates/archive/file_managed.html:95 +#: templates/archive/file_managed.html:89 +msgid "Update YouTube metadata" +msgstr "" + +#: templates/archive/file_managed.html:106 msgid "MP3 file" msgstr "Plik MP3" -#: templates/archive/file_managed.html:99 +#: templates/archive/file_managed.html:110 msgid "Download MP3 file." msgstr "Pobierz plik MP3." -#: templates/archive/file_managed.html:101 -#: templates/archive/file_managed.html:124 -#: templates/archive/file_managed.html:147 +#: templates/archive/file_managed.html:112 +#: templates/archive/file_managed.html:135 +#: templates/archive/file_managed.html:162 msgid "Published:" msgstr "Opublikowano:" -#: templates/archive/file_managed.html:106 -#: templates/archive/file_managed.html:129 -#: templates/archive/file_managed.html:152 +#: templates/archive/file_managed.html:117 +#: templates/archive/file_managed.html:140 +#: templates/archive/file_managed.html:167 msgid "Not published yet." msgstr "Nie opublikowane." -#: templates/archive/file_managed.html:109 +#: templates/archive/file_managed.html:120 msgid "MP3 file hasn't been generated yet." msgstr "Plik MP3 nie został jeszcze wygenerowany." -#: templates/archive/file_managed.html:118 +#: templates/archive/file_managed.html:129 msgid "Ogg Vorbis file" msgstr "Plik Ogg Vorbis" -#: templates/archive/file_managed.html:122 +#: templates/archive/file_managed.html:133 msgid "Download Ogg Vorbis file." msgstr "Pobierz plik Ogg Vorbis." -#: templates/archive/file_managed.html:132 +#: templates/archive/file_managed.html:143 msgid "Ogg Vorbis file hasn't been generated yet." msgstr "Plik Ogg Vorbis nie został jeszcze wygenerowany." -#: templates/archive/file_managed.html:141 +#: templates/archive/file_managed.html:152 msgid "YouTube" msgstr "YouTube" -#: templates/archive/file_managed.html:145 -msgid "Download YouTube file." -msgstr "Pobierz plik dla YouTube." +#: templates/archive/file_managed.html:158 +msgid "See on YouTube" +msgstr "Zobacz na YouTube" -#: templates/archive/file_managed.html:155 +#: templates/archive/file_managed.html:170 msgid "YouTube file hasn't been generated yet." msgstr "Plik dla YouTube nie został jeszcze wygenerowany." -#: templates/archive/file_managed.html:174 +#: templates/archive/file_managed.html:189 msgid "Are you sure you want to move this audiobook to archive?" msgstr "Czy na pewno chcesz przenieść ten plik to archiwum?" -#: templates/archive/file_managed.html:176 +#: templates/archive/file_managed.html:191 msgid "Remove to archive" msgstr "Usuń do archiwum" -#: templates/archive/file_managed.html:186 +#: templates/archive/file_managed.html:201 msgid "Update tags" msgstr "Uaktualnij tagi" -#: templates/archive/file_managed.html:193 templates/archive/file_new.html:25 +#: templates/archive/file_managed.html:208 templates/archive/file_new.html:25 msgid "Commit" msgstr "Zatwierdź" @@ -260,6 +271,27 @@ msgstr "Nie opublikowane audiobooki" msgid "Audiobook repository" msgstr "Repozytorium audiobooków" +#: views.py:275 +#, python-format +msgid "" +"Parts number inconsitent. Declared number: %(declared)d. Real number: " +"%(real)d" +msgstr "" +"Niespójność w liczbie części. Zadeklarowana liczba: %(declared)d. Realna " +"liczba: %(real)d." + +#: views.py:278 +msgid "There is more than one part, but index is not set." +msgstr "Utwór ma więcej niż jedną część, ale indeks części nie jest ustawiony." + +#: views.py:280 +#, python-format +msgid "Part indexes are not 1..%(parts_count)d." +msgstr "Indeksy części utworu nie tworzą zakresu 1..%(parts_count)d." + +#~ msgid "Download YouTube file." +#~ msgstr "Pobierz plik dla YouTube." + #~ msgid "arranger" #~ msgstr "aranżer" diff --git a/src/archive/templates/archive/file_managed.html b/src/archive/templates/archive/file_managed.html index adb42c7..61eaca4 100644 --- a/src/archive/templates/archive/file_managed.html +++ b/src/archive/templates/archive/file_managed.html @@ -7,6 +7,10 @@ +{% for alert in alerts %} +
{{ alert }}
+{% endfor %} +

{% trans "Publishing" %}

diff --git a/src/archive/views.py b/src/archive/views.py index 62a1216..4ea199a 100644 --- a/src/archive/views.py +++ b/src/archive/views.py @@ -268,6 +268,17 @@ def file_managed(request, id): request.user.is_authenticated and request.user.oauthconnection_set.filter(access=True).exists()) + alerts = [] + series = models.Audiobook.objects.filter(url=audiobook.url) + real = series.count() + if real != audiobook.parts_count: + alerts.append(_('Parts number inconsitent. Declared number: %(declared)d. Real number: %(real)d') % {"declared": audiobook.parts_count, "real": real}) + if audiobook.parts_count > 1: + if not audiobook.index: + alerts.append(_('There is more than one part, but index is not set.')) + if set(series.values_list('index', flat=True)) != set(range(1, audiobook.parts_count + 1)): + alerts.append(_('Part indexes are not 1..%(parts_count)d.') % {"parts_count": audiobook.parts_count}) + return render(request, "archive/file_managed.html", locals()) -- 2.20.1