i18n: translate 6 HTML Jinja2 templates with _() calls

Replace all hardcoded English visible text with {{ _("key") }} calls in:
- queue_dashboard.html: headings, stat cards, table headers, empty states
- api_tokens.html: form labels, table headers, status badges, aria-labels
- similarity_dashboard.html: headings, stat labels, controls, empty states
- backup.html: buttons, config labels, table, retention section, confirm dialog
- shared_links.html: form labels/options, table headers, status badges
- duplicates.html: tabs, role tags, near-dup form, explanation bullets

Follows i18n rules: placeholder/aria-label/title attrs translated,
JS strings in <script> left as-is, Alpine.js bindings use Jinja2
server-side evaluation pattern for dynamic translated strings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-11 12:22:46 +00:00
parent fdff970e59
commit 64577f2d92
8 changed files with 260 additions and 280 deletions
+20 -20
View File
@@ -1,28 +1,28 @@
{% extends "base.html" %}
{% block title %}Upload Document{% endblock %}
{% block title %}{{ _("upload.page_title") }}{% endblock %}
{% block content %}
<div class="flex flex-col items-center justify-center p-4 sm:p-8">
<h1 class="text-2xl sm:text-3xl font-bold mb-6 sm:mb-8">Upload Files</h1>
<h1 class="text-2xl sm:text-3xl font-bold mb-6 sm:mb-8">{{ _("upload.page_title") }}</h1>
<!-- File Upload Section -->
<div class="w-full max-w-2xl mb-6 sm:mb-8">
<h2 class="text-xl font-semibold mb-4">Upload from Device</h2>
<h2 class="text-xl font-semibold mb-4">{{ _("upload.section_device") }}</h2>
<form action="/api/ui-upload" method="POST" enctype="multipart/form-data">
<div
id="dropZone"
class="border-4 border-dashed border-gray-300 rounded-lg p-6 sm:p-8 bg-white text-center w-full"
role="button"
tabindex="0"
aria-label="File upload area. Drag and drop files here, or press Enter to browse files."
aria-label="{{ _('upload.drop_zone_aria') }}"
ondragover="handleDragOver(event)"
ondragleave="handleDragLeave(event)"
>
<p class="text-gray-500 mb-4 hidden sm:block">
Drag &amp; drop files or folders here, or click to select files.
{{ _("upload.drop_hint_desktop") }}
</p>
<p class="text-gray-500 mb-4 sm:hidden">
Tap to select files or use the camera button below.
{{ _("upload.drop_hint_mobile") }}
</p>
<input
id="fileInput"
@@ -31,7 +31,7 @@
onchange="handleFileSelect(event)"
name="files"
multiple
aria-label="Select files to upload"
aria-label="{{ _('upload.select_file') }}"
accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,image/*"
/>
<!-- Browse Files button (all devices) -->
@@ -41,11 +41,11 @@
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-3 px-6 rounded-lg transition duration-200 mb-4"
style="min-height:44px;"
>
<i class="fas fa-folder-open mr-2" aria-hidden="true"></i> Browse Files
<i class="fas fa-folder-open mr-2" aria-hidden="true"></i> {{ _("upload.browse_button") }}
</button>
<div class="text-sm text-gray-500 mt-2">
<p>Allowed types: PDF, Office documents (Word, Excel, PowerPoint, etc.), Images</p>
<p>Maximum size: 500MB per file &bull; Directories are uploaded recursively</p>
<p>{{ _("upload.file_types") }}</p>
<p>{{ _("upload.file_size_hint") }}</p>
</div>
</div>
@@ -55,7 +55,7 @@
class="w-full flex items-center justify-center gap-2 bg-green-500 hover:bg-green-700 text-white font-bold py-3 px-6 rounded-lg transition duration-200 cursor-pointer"
style="min-height:44px;"
>
<i class="fas fa-camera" aria-hidden="true"></i> Take Photo / Scan Document
<i class="fas fa-camera" aria-hidden="true"></i> {{ _("upload.camera_button") }}
<input
id="cameraInput"
type="file"
@@ -63,7 +63,7 @@
onchange="handleFileSelect(event)"
accept="image/*"
capture="environment"
aria-label="Take photo or scan document"
aria-label="{{ _('upload.camera_button') }}"
/>
</label>
</div>
@@ -72,40 +72,40 @@
<!-- URL Upload Section -->
<div class="w-full max-w-2xl mb-6 sm:mb-8">
<h2 class="text-xl font-semibold mb-4">Upload from URL</h2>
<h2 class="text-xl font-semibold mb-4">{{ _("upload.section_url") }}</h2>
<div class="bg-white border border-gray-300 rounded-lg p-4 sm:p-6">
<form id="urlUploadForm" class="space-y-4">
<div>
<label for="urlInput" class="block text-sm font-medium text-gray-700 mb-2">
File URL
{{ _("upload.url_label") }}
</label>
<input
type="url"
id="urlInput"
name="url"
placeholder="https://example.com/document.pdf"
placeholder="{{ _('upload.url_placeholder') }}"
class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
style="min-height:44px;"
required
/>
<p class="text-sm text-gray-500 mt-1">
Enter a direct link to a file (PDF, Office documents, or images)
{{ _("upload.url_description") }}
</p>
</div>
<div>
<label for="urlFilename" class="block text-sm font-medium text-gray-700 mb-2">
Filename (optional)
{{ _("upload.filename_label") }}
</label>
<input
type="text"
id="urlFilename"
name="filename"
placeholder="my-document.pdf"
placeholder="{{ _('upload.filename_placeholder') }}"
class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
style="min-height:44px;"
/>
<p class="text-sm text-gray-500 mt-1">
Leave empty to use filename from URL
{{ _("upload.filename_description") }}
</p>
</div>
<button
@@ -113,7 +113,7 @@
class="w-full bg-blue-500 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded-lg transition duration-200"
style="min-height:44px;"
>
Download and Process
{{ _("upload.download_button") }}
</button>
</form>
<div id="urlStatusMessage" class="mt-4" aria-live="polite"></div>