added translations

This commit is contained in:
Joren de Graaf
2026-10-01 22:43:45 +02:00
parent b676f35f0a
commit 13258e76c3
76 changed files with 1787 additions and 291 deletions
+9 -9
View File
@@ -1,22 +1,22 @@
{% load vite %}
{% load i18n vite %}
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<html lang="{{ request.LANGUAGE_CODE|default:'en' }}" data-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page not found · Sound Signal</title>
<title>{% trans "Page not found · Sound Signal" %}</title>
{% vite_asset "frontend/src/entries/not-found.js" %}
</head>
{% include "js_translations.html" %}</head>
<body>
<main class="card">
<div class="mark"><span>⌁</span></div>
<p class="code"><strong>404</strong> · Signal lost</p>
<h1 class="title">This page wandered off.</h1>
<p class="message">The address does not point to anything in this corner of Sound Signal. Try one of the routes below instead.</p>
<p class="code"><strong>404</strong> · {% trans "Signal lost" %}</p>
<h1 class="title">{% trans "This page wandered off." %}</h1>
<p class="message">{% trans "The address does not point to anything in this corner of Sound Signal. Try one of the routes below instead." %}</p>
{% if request_path %}<span class="path">{{ request_path }}</span>{% endif %}
<div class="actions">
<a class="button button-primary" href="/">Go home</a>
<a class="button" href="/fireworks/">Open Sound Signal</a>
<a class="button button-primary" href="/">{% trans "Go home" %}</a>
<a class="button" href="/fireworks/">{% trans "Open Sound Signal" %}</a>
</div>
</main>
</body>
+1 -1
View File
@@ -1 +1 @@
{% extends "admin/base.html" %}{% load static %}{% block extrastyle %}{{ block.super }}<link rel="stylesheet" href="{% static 'project_admin/admin.css' %}">{% endblock %}{% block branding %}<h1 id="site-name"><a href="{% url 'admin:index' %}">✦ Sound Signal <span>Administration</span></a></h1>{% endblock %}
{% extends "admin/base.html" %}{% load i18n static %}{% block extrastyle %}{{ block.super }}<link rel="stylesheet" href="{% static 'project_admin/admin.css' %}">{% endblock %}{% block branding %}<h1 id="site-name"><a href="{% url 'admin:index' %}">✦ Sound Signal <span>{% trans "Administration" %}</span></a></h1>{% endblock %}
@@ -1,9 +1,10 @@
{% extends "admin/fireworks_detect/classification_change_form.html" %}
{% load vite %}
{% load i18n vite %}
{% block extrahead %}
{{ block.super }}
{% vite_asset "frontend/src/entries/admin-audio-preview.js" %}
{% include "js_translations.html" %}
{% endblock %}
{% block after_field_sets %}
@@ -11,9 +12,9 @@
{% if original.audio_file %}
<section class="audio-preview">
<button class="audio-play" type="button" data-audio-url="{% url original.admin_audio_route original.pk %}">
<span class="audio-play__icon">▶</span><span class="audio-play__label">Play recording</span>
<span class="audio-play__icon">▶</span><span class="audio-play__label">{% trans "Play recording" %}</span>
</button>
<span class="audio-status" aria-live="polite">Loads only when played</span>
<span class="audio-status" aria-live="polite">{% trans "Loads only when played" %}</span>
<audio preload="none"></audio>
</section>
{% endif %}
@@ -1 +1,2 @@
{% extends "admin/change_form.html" %}{% block after_field_sets %}{{ block.super }}{% if original %}<section class="classification-preview"><h2>Classification preview</h2><p class="preview-meta">{{ original.duration }} seconds · {{ original.classifier_response.frames_analysed|default:"—" }} frames analysed</p><div class="preview-grid"><div><h3>Top sound classes</h3>{% for prediction in original.admin_predictions %}<div class="preview-row preview-row--{{ prediction.kind }}"><strong>{{ prediction.label }}</strong><span>{{ prediction.score_display }}</span></div>{% empty %}<p>No predictions returned.</p>{% endfor %}</div><div><h3>Notable moments</h3>{% for prediction in original.admin_peaks %}<div class="preview-row preview-row--{{ prediction.kind }}"><strong>{{ prediction.label }}</strong><span>{{ prediction.time_seconds|default:"—" }}s · {{ prediction.score_display }}</span></div>{% empty %}<p>No peak events returned.</p>{% endfor %}</div></div><details class="raw-json"><summary>Show raw classifier JSON</summary><pre>{{ original.classifier_response|pprint }}</pre></details></section>{% endif %}{% endblock %}
{% load i18n %}
{% extends "admin/change_form.html" %}{% block after_field_sets %}{{ block.super }}{% if original %}<section class="classification-preview"><h2>{% trans "Classification preview" %}</h2><p class="preview-meta">{{ original.duration }} seconds · {{ original.classifier_response.frames_analysed|default:"—" }} frames analysed</p><div class="preview-grid"><div><h3>{% trans "Top sound classes" %}</h3>{% for prediction in original.admin_predictions %}<div class="preview-row preview-row--{{ prediction.kind }}"><strong>{{ prediction.label }}</strong><span>{{ prediction.score_display }}</span></div>{% empty %}<p>{% trans "No predictions returned." %}</p>{% endfor %}</div><div><h3>{% trans "Notable moments" %}</h3>{% for prediction in original.admin_peaks %}<div class="preview-row preview-row--{{ prediction.kind }}"><strong>{{ prediction.label }}</strong><span>{{ prediction.time_seconds|default:"—" }}s · {{ prediction.score_display }}</span></div>{% empty %}<p>{% trans "No peak events returned." %}</p>{% endfor %}</div></div><details class="raw-json"><summary>{% trans "Show raw classifier JSON" %}</summary><pre>{{ original.classifier_response|pprint }}</pre></details></section>{% endif %}{% endblock %}
+1 -1
View File
@@ -1 +1 @@
{% load i18n vite %}<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{% translate 'Log in' %} · Sound Signal</title>{% vite_asset "frontend/src/entries/admin-login.js" %}</head><body><main class="card"><div class="brand"><span class="mark">✦</span> Sound Signal</div><p class="eyebrow">Secure access</p><h1>Welcome back.</h1><p class="intro">Sign in to review pending audio samples and manage approved events.</p>{% if form.errors %}<div class="error">{% translate 'Your username and password did not match. Please try again.' %}</div>{% endif %}{% if user.is_authenticated %}<div class="error">{% blocktranslate trimmed %}You are authenticated as {{ username }}, but are not authorized to access this page. Would you like to log in to a different account?{% endblocktranslate %}</div>{% endif %}<form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}<label for="{{ form.username.id_for_label }}">{% translate 'Username' %}</label>{{ form.username }}<label for="{{ form.password.id_for_label }}">{% translate 'Password' %}</label>{{ form.password }}{% if next %}<input type="hidden" name="next" value="{{ next }}">{% endif %}<button type="submit">{% translate 'Sign in' %} <span aria-hidden="true">→</span></button></form><p class="foot">Sound Signal administration</p></main></body></html>
{% load i18n vite %}<!doctype html><html lang="{{ request.LANGUAGE_CODE|default:'en' }}"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{% translate 'Log in' %} · Sound Signal</title>{% vite_asset "frontend/src/entries/admin-login.js" %}</head><body><main class="card"><div class="brand"><span class="mark">✦</span> Sound Signal</div><p class="eyebrow">{% trans "Secure access" %}</p><h1>{% trans "Welcome back." %}</h1><p class="intro">{% trans "Sign in to review pending audio samples and manage approved events." %}</p>{% if form.errors %}<div class="error">{% translate 'Your username and password did not match. Please try again.' %}</div>{% endif %}{% if user.is_authenticated %}<div class="error">{% blocktranslate trimmed %}You are authenticated as {{ username }}, but are not authorized to access this page. Would you like to log in to a different account?{% endblocktranslate %}</div>{% endif %}<form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}<label for="{{ form.username.id_for_label }}">{% translate 'Username' %}</label>{{ form.username }}<label for="{{ form.password.id_for_label }}">{% translate 'Password' %}</label>{{ form.password }}{% if next %}<input type="hidden" name="next" value="{{ next }}">{% endif %}<button type="submit">{% translate 'Sign in' %} <span aria-hidden="true">→</span></button></form><p class="foot">{% trans "Sound Signal administration" %}</p></main></body></html>
+44
View File
@@ -0,0 +1,44 @@
{% load i18n %}
<script>
window.BOOMCAST_I18N = {
noFile: "{% trans 'No file selected' as value %}{{ value|escapejs }}",
analysing: "{% trans 'Analysing your recording…' as value %}{{ value|escapejs }}",
analysisFailed: "{% trans 'Analysis could not be completed.' as value %}{{ value|escapejs }}",
accuracyUnavailable: "{% trans 'Accuracy unavailable' as value %}{{ value|escapejs }}",
accuracy: "{% trans 'Accuracy' as value %}{{ value|escapejs }}",
stopCapture: "{% trans 'Stop direction capture' as value %}{{ value|escapejs }}",
pointPhone: "{% trans 'Point the top of your phone toward the sound — direction will update live.' as value %}{{ value|escapejs }}",
captureDirection: "{% trans 'Capture direction' as value %}{{ value|escapejs }}",
captureAgain: "{% trans 'Capture again' as value %}{{ value|escapejs }}",
compassUnavailable: "{% trans 'Compass unavailable on this device.' as value %}{{ value|escapejs }}",
secureCompass: "{% trans 'Compass capture requires a secure HTTPS connection.' as value %}{{ value|escapejs }}",
compassPermission: "{% trans 'Requesting compass permission…' as value %}{{ value|escapejs }}",
compassDenied: "{% trans 'Compass permission denied.' as value %}{{ value|escapejs }}",
requestingLocation: "{% trans 'Requesting your optional location…' as value %}{{ value|escapejs }}",
mapCompass: "{% trans 'Map compass: north is up' as value %}{{ value|escapejs }}",
reports: "{% trans 'reports' as value %}{{ value|escapejs }}",
occurrences: "{% trans 'occurrences' as value %}{{ value|escapejs }}",
resolution: "{% trans 'resolution' as value %}{{ value|escapejs }}",
visuallyConfirmed: "{% trans 'Visually confirmed' as value %}{{ value|escapejs }}",
notVisuallyConfirmed: "{% trans 'Not visually confirmed' as value %}{{ value|escapejs }}",
reported: "{% trans 'Reported' as value %}{{ value|escapejs }}",
compassDirection: "{% trans 'Compass direction' as value %}{{ value|escapejs }}",
report: "{% trans 'report' as value %}{{ value|escapejs }}",
occurrence: "{% trans 'occurrence' as value %}{{ value|escapejs }}",
lightMode: "{% trans 'Light mode' as value %}{{ value|escapejs }}",
darkMode: "{% trans 'Dark mode' as value %}{{ value|escapejs }}",
switchToLight: "{% trans 'Switch to light mode' as value %}{{ value|escapejs }}",
switchToDark: "{% trans 'Switch to dark mode' as value %}{{ value|escapejs }}",
loadingRecording: "{% trans 'Loading recording…' as value %}{{ value|escapejs }}",
couldNotPlay: "{% trans 'Could not play this recording.' as value %}{{ value|escapejs }}",
pauseRecording: "{% trans 'Pause recording' as value %}{{ value|escapejs }}",
playingNow: "{% trans 'Playing now' as value %}{{ value|escapejs }}",
resumeRecording: "{% trans 'Resume recording' as value %}{{ value|escapejs }}",
paused: "{% trans 'Paused' as value %}{{ value|escapejs }}",
replayRecording: "{% trans 'Replay recording' as value %}{{ value|escapejs }}",
finished: "{% trans 'Finished' as value %}{{ value|escapejs }}",
buffering: "{% trans 'Buffering…' as value %}{{ value|escapejs }}",
couldNotLoad: "{% trans 'Could not load this recording.' as value %}{{ value|escapejs }}",
manualReport: "{% trans 'Manual report' as value %}{{ value|escapejs }}"
};
</script>