diff --git a/files/forms.py b/files/forms.py index 510f64cf..cb23e645 100644 --- a/files/forms.py +++ b/files/forms.py @@ -222,12 +222,12 @@ class WhisperSubtitlesForm(forms.ModelForm): "allow_whisper_transcribe_and_translate", ) labels = { - "allow_whisper_transcribe": "automatic transcription", - "allow_whisper_transcribe_and_translate": "automatic transcription and translation", + "allow_whisper_transcribe": "Transcription", + "allow_whisper_transcribe_and_translate": "English Translation", } help_texts = { - "allow_whisper_transcribe": "Request automatic transcription for this media.", - "allow_whisper_transcribe_and_translate": "Request automatic transcription and translation for this media.", + "allow_whisper_transcribe": "", + "allow_whisper_transcribe_and_translate": "", } def __init__(self, user, *args, **kwargs): @@ -281,7 +281,7 @@ class SubtitleForm(forms.ModelForm): fields = ["language", "subtitle_file"] labels = { - "subtitle_file": "Subtitle or Closed Caption File", + "subtitle_file": "Upload Caption File", } help_texts = { "subtitle_file": "SubRip (.srt) and WebVTT (.vtt) are supported file formats.", diff --git a/files/frontend_translations/ar.py b/files/frontend_translations/ar.py index 709d6f64..0728549b 100644 --- a/files/frontend_translations/ar.py +++ b/files/frontend_translations/ar.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "ترجمات", "Tags": "العلامات", "Terms": "الشروط", + "This works in Chrome, Safari and Edge browsers.": "هذا يعمل في متصفحات Chrome و Safari و Edge.", "Trim": "قص", "UPLOAD": "رفع", "Up next": "التالي", diff --git a/files/frontend_translations/bn.py b/files/frontend_translations/bn.py index e2b7355d..c7f7a75d 100644 --- a/files/frontend_translations/bn.py +++ b/files/frontend_translations/bn.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "সাবটাইটেল", "Tags": "ট্যাগ", "Terms": "শর্তাবলী", + "This works in Chrome, Safari and Edge browsers.": "এটি ক্রোম, সাফারি এবং এজ ব্রাউজারে কাজ করে।", "Trim": "ছাঁটাই", "UPLOAD": "আপলোড করুন", "Up next": "পরবর্তী", diff --git a/files/frontend_translations/da.py b/files/frontend_translations/da.py index 4481597e..25ca2554 100644 --- a/files/frontend_translations/da.py +++ b/files/frontend_translations/da.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "Undertekster", "Tags": "Tags", "Terms": "Vilkår", + "This works in Chrome, Safari and Edge browsers.": "Dette virker i Chrome, Safari og Edge browsere.", "Trim": "Beskær", "UPLOAD": "UPLOAD", "Up next": "Næste", diff --git a/files/frontend_translations/de.py b/files/frontend_translations/de.py index e2e70e26..b1e33c61 100644 --- a/files/frontend_translations/de.py +++ b/files/frontend_translations/de.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "Untertitel", "Tags": "Tags", "Terms": "Bedingungen", + "This works in Chrome, Safari and Edge browsers.": "Dies funktioniert in den Browsern Chrome, Safari und Edge.", "Trim": "Trimmen", "UPLOAD": "HOCHLADEN", "Up next": "Als nächstes", diff --git a/files/frontend_translations/el.py b/files/frontend_translations/el.py index ae5b428c..cc9122bb 100644 --- a/files/frontend_translations/el.py +++ b/files/frontend_translations/el.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "Υπότιτλοι", "Tags": "Ετικέτες", "Terms": "Όροι", + "This works in Chrome, Safari and Edge browsers.": "Αυτό λειτουργεί σε προγράμματα περιήγησης Chrome, Safari και Edge.", "Trim": "Περικοπή", "UPLOAD": "ΑΝΕΒΑΣΜΑ", "Up next": "Επόμενο", diff --git a/files/frontend_translations/en.py b/files/frontend_translations/en.py index eb3637fb..a277e210 100644 --- a/files/frontend_translations/en.py +++ b/files/frontend_translations/en.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitle was added": "", "Tags": "", "Terms": "", + "This works in Chrome, Safari and Edge browsers.": "", "Trim": "", "UPLOAD": "", "Up next": "", diff --git a/files/frontend_translations/es.py b/files/frontend_translations/es.py index 68151aeb..208b001a 100644 --- a/files/frontend_translations/es.py +++ b/files/frontend_translations/es.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "Subtítulos", "Tags": "Etiquetas", "Terms": "Términos", + "This works in Chrome, Safari and Edge browsers.": "Esto funciona en los navegadores Chrome, Safari y Edge.", "Trim": "Recortar", "UPLOAD": "SUBIR", "Up next": "A continuación", diff --git a/files/frontend_translations/fr.py b/files/frontend_translations/fr.py index e2e9a13f..71230abe 100644 --- a/files/frontend_translations/fr.py +++ b/files/frontend_translations/fr.py @@ -66,6 +66,7 @@ translation_strings = { "Subtitles": "Sous-titres", "Tags": "Tags", "Terms": "Conditions", + "This works in Chrome, Safari and Edge browsers.": "Cela fonctionne dans les navigateurs Chrome, Safari et Edge.", "Trim": "Couper", "UPLOAD": "TÉLÉCHARGER", "Up next": "À suivre", diff --git a/files/frontend_translations/he.py b/files/frontend_translations/he.py index 28b11df4..71be04a8 100644 --- a/files/frontend_translations/he.py +++ b/files/frontend_translations/he.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "כתוביות", "Tags": "תגיות", "Terms": "תנאים", + "This works in Chrome, Safari and Edge browsers.": "זה עובד בדפדפני Chrome, Safari ו-Edge.", "Trim": "גזירה", "UPLOAD": "העלה", "Up next": "הבא בתור", diff --git a/files/frontend_translations/hi.py b/files/frontend_translations/hi.py index ef9bb509..3bb8176e 100644 --- a/files/frontend_translations/hi.py +++ b/files/frontend_translations/hi.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "उपशीर्षक", "Tags": "टैग", "Terms": "शर्तें", + "This works in Chrome, Safari and Edge browsers.": "यह क्रोम, सफारी और एज ब्राउज़र में काम करता है।", "Trim": "छांटें", "UPLOAD": "अपलोड करें", "Up next": "अगला", diff --git a/files/frontend_translations/id.py b/files/frontend_translations/id.py index a13ceed8..3655a969 100644 --- a/files/frontend_translations/id.py +++ b/files/frontend_translations/id.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "Subtitel", "Tags": "Tag", "Terms": "Ketentuan", + "This works in Chrome, Safari and Edge browsers.": "Ini berfungsi di browser Chrome, Safari, dan Edge.", "Trim": "Potong", "UPLOAD": "UNGGAH", "Up next": "Selanjutnya", diff --git a/files/frontend_translations/it.py b/files/frontend_translations/it.py index 4da118b1..9d374ca1 100644 --- a/files/frontend_translations/it.py +++ b/files/frontend_translations/it.py @@ -66,6 +66,7 @@ translation_strings = { "Subtitles": "Sottotitoli", "Tags": "Tag", "Terms": "Termini e condizioni", + "This works in Chrome, Safari and Edge browsers.": "Questo funziona nei browser Chrome, Safari e Edge.", "Trim": "Taglia", "UPLOAD": "CARICA", "Up next": "A seguire", diff --git a/files/frontend_translations/ja.py b/files/frontend_translations/ja.py index 33ab5088..082f96fd 100644 --- a/files/frontend_translations/ja.py +++ b/files/frontend_translations/ja.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "字幕", "Tags": "タグ", "Terms": "利用規約", + "This works in Chrome, Safari and Edge browsers.": "これはChrome、Safari、Edgeブラウザで動作します。", "Trim": "トリム", "UPLOAD": "アップロード", "Up next": "次に再生", diff --git a/files/frontend_translations/ko.py b/files/frontend_translations/ko.py index d9791a3b..8958d48a 100644 --- a/files/frontend_translations/ko.py +++ b/files/frontend_translations/ko.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "자막", "Tags": "태그", "Terms": "약관", + "This works in Chrome, Safari and Edge browsers.": "이 기능은 Chrome, Safari 및 Edge 브라우저에서 작동합니다.", "Trim": "자르기", "UPLOAD": "업로드", "Up next": "다음", diff --git a/files/frontend_translations/nl.py b/files/frontend_translations/nl.py index 9c642767..733e28a8 100644 --- a/files/frontend_translations/nl.py +++ b/files/frontend_translations/nl.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "Ondertitels", "Tags": "Tags", "Terms": "Voorwaarden", + "This works in Chrome, Safari and Edge browsers.": "Dit werkt in Chrome, Safari en Edge browsers.", "Trim": "Bijsnijden", "UPLOAD": "UPLOADEN", "Up next": "Hierna", diff --git a/files/frontend_translations/pt.py b/files/frontend_translations/pt.py index a5f09d47..457fb4e1 100644 --- a/files/frontend_translations/pt.py +++ b/files/frontend_translations/pt.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "Legendas", "Tags": "Tags", "Terms": "Termos", + "This works in Chrome, Safari and Edge browsers.": "Isso funciona nos navegadores Chrome, Safari e Edge.", "Trim": "Cortar", "UPLOAD": "CARREGAR", "Up next": "A seguir", diff --git a/files/frontend_translations/ru.py b/files/frontend_translations/ru.py index 64fb663c..b8a939be 100644 --- a/files/frontend_translations/ru.py +++ b/files/frontend_translations/ru.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "Субтитры", "Tags": "Теги", "Terms": "Условия", + "This works in Chrome, Safari and Edge browsers.": "Это работает в браузерах Chrome, Safari и Edge.", "Trim": "Обрезать", "UPLOAD": "ЗАГРУЗИТЬ", "Up next": "Далее", diff --git a/files/frontend_translations/sl.py b/files/frontend_translations/sl.py index a123a77f..ac7a3745 100644 --- a/files/frontend_translations/sl.py +++ b/files/frontend_translations/sl.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "Podnapisi", "Tags": "Oznake", "Terms": "Pogoji", + "This works in Chrome, Safari and Edge browsers.": "To deluje v brskalnikih Chrome, Safari in Edge.", "Trim": "Obreži", "UPLOAD": "NALOŽI", "Up next": "Naslednji", diff --git a/files/frontend_translations/tr.py b/files/frontend_translations/tr.py index 18031989..886af430 100644 --- a/files/frontend_translations/tr.py +++ b/files/frontend_translations/tr.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "Altyazılar", "Tags": "Etiketler", "Terms": "Şartlar", + "This works in Chrome, Safari and Edge browsers.": "Bu, Chrome, Safari ve Edge tarayıcılarında çalışır.", "Trim": "Kırp", "UPLOAD": "YÜKLE", "Up next": "Sıradaki", diff --git a/files/frontend_translations/ur.py b/files/frontend_translations/ur.py index f2071790..0019912c 100644 --- a/files/frontend_translations/ur.py +++ b/files/frontend_translations/ur.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "سب ٹائٹلز", "Tags": "ٹیگز", "Terms": "شرائط", + "This works in Chrome, Safari and Edge browsers.": "یہ کروم، سفاری اور ایج براؤزرز میں کام کرتا ہے۔", "Trim": "تراشیں", "UPLOAD": "اپ لوڈ کریں", "Up next": "اگلا", diff --git a/files/frontend_translations/zh_hans.py b/files/frontend_translations/zh_hans.py index 1c8bd535..0bd5ebf2 100644 --- a/files/frontend_translations/zh_hans.py +++ b/files/frontend_translations/zh_hans.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "字幕", "Tags": "标签", "Terms": "条款", + "This works in Chrome, Safari and Edge browsers.": "此功能适用于 Chrome、Safari 和 Edge 浏览器。", "Trim": "修剪", "UPLOAD": "上传", "Up next": "接下来", diff --git a/files/frontend_translations/zh_hant.py b/files/frontend_translations/zh_hant.py index 4dbf8cfc..e0241cd4 100644 --- a/files/frontend_translations/zh_hant.py +++ b/files/frontend_translations/zh_hant.py @@ -65,6 +65,7 @@ translation_strings = { "Subtitles": "字幕", "Tags": "標籤", "Terms": "使用條款", + "This works in Chrome, Safari and Edge browsers.": "此功能適用於 Chrome、Safari 和 Edge 瀏覽器。", "Trim": "修剪", "UPLOAD": "上傳", "Up next": "即將播放", diff --git a/files/tasks.py b/files/tasks.py index b5577672..5d6eca12 100644 --- a/files/tasks.py +++ b/files/tasks.py @@ -484,11 +484,11 @@ def whisper_transcribe(friendly_token, translate_to_english=False): if translate_to_english: language = Language.objects.filter(code="whisper-translation").first() if not language: - language = Language.objects.create(code="whisper-translation", title="Automatic Transcription and Translation") + language = Language.objects.create(code="whisper-translation", title="English Translation") else: language = Language.objects.filter(code="whisper").first() if not language: - language = Language.objects.create(code="whisper", title="Automatic Transcription") + language = Language.objects.create(code="whisper", title="Transcription") cwd = os.path.dirname(os.path.realpath(media.media_file.path)) request.status = "running" diff --git a/files/views/pages.py b/files/views/pages.py index cce67227..2f9886c4 100644 --- a/files/views/pages.py +++ b/files/views/pages.py @@ -88,7 +88,7 @@ def add_subtitle(request): subtitle = form.save() try: subtitle.convert_to_srt() - messages.add_message(request, messages.INFO, "Subtitle was added!") + messages.add_message(request, messages.INFO, "Caption was added!") return HttpResponseRedirect(subtitle.media.get_absolute_url()) except Exception as e: # noqa subtitle.delete() @@ -147,7 +147,7 @@ def edit_subtitle(request): elif request.method == "POST": confirm = request.GET.get("confirm", "").strip() if confirm == "true": - messages.add_message(request, messages.INFO, "Subtitle was deleted") + messages.add_message(request, messages.INFO, "Caption was deleted") redirect_url = subtitle.media.get_absolute_url() subtitle.delete() return HttpResponseRedirect(redirect_url) @@ -156,7 +156,7 @@ def edit_subtitle(request): with open(subtitle.subtitle_file.path, "w") as ff: ff.write(subtitle_text) - messages.add_message(request, messages.INFO, "Subtitle was edited") + messages.add_message(request, messages.INFO, "Caption was edited") return HttpResponseRedirect(subtitle.media.get_absolute_url()) return render(request, "cms/edit_subtitle.html", context) diff --git a/templates/cms/add_subtitle.html b/templates/cms/add_subtitle.html index 404d79f1..8480f51d 100644 --- a/templates/cms/add_subtitle.html +++ b/templates/cms/add_subtitle.html @@ -7,6 +7,23 @@ {% block innercontent %} {% include "cms/media_nav.html" with active_tab="subtitles" %} + + {% if whisper_form %} +
+
+

Request Automatic Transcription and Translation + + info_outline + +

+
+ {% csrf_token %} + {% crispy whisper_form %} +
+
+
+ {% endif %} +
@@ -20,7 +37,7 @@ {% if subtitles %}
-

Existing Subtitles

+

Edit existing Captions

{% endif %} - {% if whisper_form %} -
-
-

Request Automatic Tranascription - - info_outline - -

- - {% csrf_token %} - {% crispy whisper_form %} - -
-
- {% endif %} {% endblock innercontent %} diff --git a/templates/cms/crispy_custom_field.html b/templates/cms/crispy_custom_field.html index 4bd87ec2..a68b18ae 100644 --- a/templates/cms/crispy_custom_field.html +++ b/templates/cms/crispy_custom_field.html @@ -59,24 +59,43 @@
-
- {% if field.label %} -
\ No newline at end of file + {% if field.errors %} +
+ {% for error in field.errors %} +

{{ error }}

+ {% endfor %} +
+ {% endif %} +
+ {% else %} +
+ {% if field.label %} + + {% endif %} +
+
+ {% crispy_field field %} + {% if field.errors %} +
+ {% for error in field.errors %} +

{{ error }}

+ {% endfor %} +
+ {% endif %} +
+ {% endif %} +
diff --git a/templates/cms/edit_subtitle.html b/templates/cms/edit_subtitle.html index bc43b6c5..3b61e0b8 100644 --- a/templates/cms/edit_subtitle.html +++ b/templates/cms/edit_subtitle.html @@ -28,7 +28,7 @@ {% else %}
-

Edit {{subtitle.language.title}} subtitle

+

{{subtitle.language.title}}

Media: {{subtitle.media.title}}
diff --git a/templates/cms/media_nav.html b/templates/cms/media_nav.html index ac91c643..4d278a5c 100644 --- a/templates/cms/media_nav.html +++ b/templates/cms/media_nav.html @@ -15,7 +15,7 @@
  • - {{ "Subtitles" | custom_translate:LANGUAGE_CODE}} + {{ "Captions" | custom_translate:LANGUAGE_CODE}}
  • diff --git a/templates/cms/record_screen.html b/templates/cms/record_screen.html index eef9079a..904bf58e 100644 --- a/templates/cms/record_screen.html +++ b/templates/cms/record_screen.html @@ -16,6 +16,7 @@

    {{ "Click 'Start Recording' and select the screen or tab to record. Once recording is finished, click 'Stop Recording,' and the recording will be uploaded." | custom_translate:LANGUAGE_CODE}}

    +

    {{ "This works in Chrome, Safari and Edge browsers." | custom_translate:LANGUAGE_CODE}}