Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

add proper i18n translations to Events tab in mobile and desktop views

Murtaza Nasir1f7487aaa0ea
diff --git a/static/locales/de.json b/static/locales/de.json
index 59c4c15e..06788159 100644
--- a/static/locales/de.json
+++ b/static/locales/de.json
@@ -853,6 +853,7 @@
},
"events": {
"title": "Ereignisse",
+ "add": "Hinzufügen",
"addToCalendar": "Zum Kalender Hinzufügen",
"noEvents": "Keine Ereignisse in dieser Aufnahme erkannt",
"start": "Beginn",
diff --git a/static/locales/en.json b/static/locales/en.json
index f295a133..82a32eaf 100644
--- a/static/locales/en.json
+++ b/static/locales/en.json
@@ -866,6 +866,7 @@
},
"events": {
"title": "Events",
+ "add": "Add",
"addToCalendar": "Add to Calendar",
"noEvents": "No events detected in this recording",
"start": "Start",
diff --git a/static/locales/es.json b/static/locales/es.json
index 3413457d..6730ae26 100644
--- a/static/locales/es.json
+++ b/static/locales/es.json
@@ -853,6 +853,7 @@
},
"events": {
"title": "Eventos",
+ "add": "Agregar",
"addToCalendar": "Agregar al Calendario",
"noEvents": "No se detectaron eventos en esta grabación",
"start": "Inicio",
diff --git a/static/locales/fr.json b/static/locales/fr.json
index 077a4391..ab54507c 100644
--- a/static/locales/fr.json
+++ b/static/locales/fr.json
@@ -853,6 +853,7 @@
},
"events": {
"title": "Événements",
+ "add": "Ajouter",
"addToCalendar": "Ajouter au Calendrier",
"noEvents": "Aucun événement détecté dans cet enregistrement",
"start": "Début",
diff --git a/static/locales/zh.json b/static/locales/zh.json
index 47e7c313..6ed4e334 100644
--- a/static/locales/zh.json
+++ b/static/locales/zh.json
@@ -1008,6 +1008,7 @@
},
"events": {
"title": "事件",
+ "add": "添加",
"addToCalendar": "添加到日历",
"noEvents": "此录音中未检测到事件",
"start": "开始",
diff --git a/templates/index.html b/templates/index.html
index fc153f5c..3d869c61 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -972,7 +972,7 @@
<button v-if="selectedRecording.events && selectedRecording.events.length > 0"
@click="mobileTab = 'events'"
:class="['flex-1 px-4 py-3 text-sm font-medium transition-colors whitespace-nowrap', mobileTab === 'events' ? 'bg-[var(--bg-secondary)] text-[var(--text-accent)] border-b-2 border-[var(--border-focus)]' : 'text-[var(--text-muted)] hover:text-[var(--text-secondary)]']">
- <i class="fas fa-calendar-alt mr-1"></i>${ selectedRecording.events.length }
+ <i class="fas fa-calendar-alt mr-1"></i>${ t('events.title') } (${ selectedRecording.events.length })
</button>
</div>
@@ -1165,7 +1165,7 @@
class="px-2 py-1 bg-[var(--bg-button)] text-[var(--text-button)] rounded-lg hover:bg-[var(--bg-button-hover)] transition-colors text-xs flex items-center gap-1"
:title="t('events.addToCalendar')">
<i class="fas fa-download text-xs"></i>
- <span>Add</span>
+ <span v-text="t('events.add')"></span>
</button>
</div>
<div class="grid grid-cols-1 gap-2 text-xs">
@@ -1512,7 +1512,7 @@
: 'text-[var(--text-muted)] hover:text-[var(--text-secondary)]'
]">
<i class="fas fa-calendar-alt mr-1"></i>
- Events (${ selectedRecording.events.length })
+ ${ t('events.title') } (${ selectedRecording.events.length })
</button>
</div>
@@ -1656,7 +1656,7 @@
class="px-3 py-1.5 bg-[var(--bg-button)] text-[var(--text-button)] rounded-lg hover:bg-[var(--bg-button-hover)] transition-colors text-sm flex items-center gap-1.5"
:title="t('events.addToCalendar')">
<i class="fas fa-download"></i>
- <span>Add to Calendar</span>
+ <span v-text="t('events.addToCalendar')"></span>
</button>
</div>
@@ -1664,25 +1664,25 @@
<div class="flex items-center gap-2" v-if="event.start_datetime">
<i class="fas fa-clock text-[var(--text-muted)] w-4"></i>
<span class="text-[var(--text-secondary)]">
- <strong>Start:</strong> ${ formatEventDateTime(event.start_datetime) }
+ <strong v-text="t('events.start') + ':'"></strong> ${ formatEventDateTime(event.start_datetime) }
</span>
</div>
<div class="flex items-center gap-2" v-if="event.end_datetime">
<i class="fas fa-clock text-[var(--text-muted)] w-4"></i>
<span class="text-[var(--text-secondary)]">
- <strong>End:</strong> ${ formatEventDateTime(event.end_datetime) }
+ <strong v-text="t('events.end') + ':'"></strong> ${ formatEventDateTime(event.end_datetime) }
</span>
</div>
<div class="flex items-center gap-2" v-if="event.location">
<i class="fas fa-map-marker-alt text-[var(--text-muted)] w-4"></i>
<span class="text-[var(--text-secondary)]">
- <strong>Location:</strong> ${ event.location }
+ <strong v-text="t('events.location') + ':'"></strong> ${ event.location }
</span>
</div>
<div class="flex items-start gap-2" v-if="event.attendees && event.attendees.length > 0">
<i class="fas fa-users text-[var(--text-muted)] w-4 mt-0.5"></i>
<div class="text-[var(--text-secondary)]">
- <strong>Attendees:</strong>
+ <strong v-text="t('events.attendees') + ':'"></strong>
<span class="ml-1">${ event.attendees.join(', ') }</span>
</div>
</div>
@@ -1691,7 +1691,7 @@
<div v-if="selectedRecording.events.length === 0" class="text-center py-8">
<i class="fas fa-calendar-times text-3xl text-[var(--text-muted)] mb-3"></i>
- <p class="text-[var(--text-muted)]">No events detected in this recording</p>
+ <p class="text-[var(--text-muted)]" v-text="t('events.noEvents')"></p>
</div>
</div>
</div>