Skip to content

Commit

Permalink
Translate history-dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
cdauth committed Apr 5, 2024
1 parent 0e9398b commit 1de9134
Show file tree
Hide file tree
Showing 6 changed files with 265 additions and 39 deletions.
73 changes: 73 additions & 0 deletions frontend/src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,79 @@
"option-reorder": "Umordnen",
"option-add": "Erstellen"
},
"history-dialog": {
"loading-error": "Fehler beim Laden der Versionsgeschichte",
"revert-error": "Fehler beim Rückgängigmachen der Änderung",
"title": "Versionsgeschichte",
"introduction": "Hier können Sie die letzten 50 Änderungen der Karte inspizieren und rückgängig machen.",
"date": "Zeit",
"action": "Änderung",
"restore": "Wiederherstellen",
"diff-field": "Attribut",
"diff-before": "Vorher",
"diff-after": "Nachher"
},
"history-utils": {
"description-create-marker": "Marker {{id}} {{quotedName}} erstellt",
"description-create-line": "Linie {{id}} {{quotedName}} erstellt",
"description-create-view": "Ansicht {{id}} {{quotedName}} erstellt",
"description-create-type": "Objekttyp {{id}} {{quotedName}} erstellt",
"description-update-map": "Karteneinstellungen geändert",
"description-update-marker": "Marker {{id}} {{quotedName}} geändert",
"description-update-line": "Linie {{id}} {{quotedName}} geändert",
"description-update-view": "Ansicht {{id}} {{quotedName}} geändert",
"description-update-type": "Objekttyp {{id}} {{quotedName}} geändert",
"description-delete-marker": "Marker {{id}} {{quotedName}} gelöscht",
"description-delete-line": "Linie {{id}} {{quotedName}} gelöscht",
"description-delete-view": "Ansicht {{id}} {{quotedName}} gelöscht",
"description-delete-type": "Objekttyp {{id}} {{quotedName}} gelöscht",
"description-interpolation-quotedName": "„{{name}}“",
"description-interpolation-quotedName-renamed": "{{quotedBefore}} (neu: {{quotedAfter}})",
"revert-create": "Löschen",
"revert-create-marker-title": "Marker löschen",
"revert-create-line-title": "Linie löschen",
"revert-create-view-title": "Ansicht löschen",
"revert-create-type-title": "Typ löschen",
"revert-create-marker-message-named": "Wollen Sie den Marker {{quotedName}} wirklich löschen?",
"revert-create-marker-message-unnamed": "Wollen Sie diesen Marker wirklich löschen?",
"revert-create-line-message-named": "Wollen Sie die Linie {{quotedName}} wirklich löschen?",
"revert-create-line-message-unnamed": "Wollen Sie diese Linie wirklich löschen?",
"revert-create-view-message-named": "Wollen Sie die Ansicht {{quotedName}} wirklich löschen?",
"revert-create-view-message-unnamed": "Wollen Sie diese Ansicht wirklich löschen?",
"revert-create-type-message-named": "Wollen Sie den Objekttyp {{quotedName}} wirklich löschen?",
"revert-create-type-message-unnamed": "Wollen Sie diesen Objekttyp wirklich löschen?",
"revert-create-button": "Löschen",
"revert-update": "Wiederherstellen",
"revert-update-map-title": "Karteneinstellungen wiederherstellen",
"revert-update-marker-title": "Marker wiederherstellen",
"revert-update-line-title": "Linie wiederherstellen",
"revert-update-view-title": "Ansicht wiederherstellen",
"revert-update-type-title": "Objekttyp wiederherstellen",
"revert-update-map-message": "Wollen Sie die alte Version der Karteneinstellungen wirklich wiederherstellen?",
"revert-update-marker-message-named": "Wollen Sie die alte Version des Markers {{quotedName}} wirklich wiederherstellen?",
"revert-update-marker-message-unnamed": "Wollen Sie die alte Version dieses Markers wirklich wiederherstellen?",
"revert-update-line-message-named": "Wollen Sie die alte Version der Linie {{quotedName}} wirklich wiederherstellen?",
"revert-update-line-message-unnamed": "Wollen Sie die alte Version dieser Linie wirklich wiederherstellen?",
"revert-update-view-message-named": "Wollen Sie die alte Version der Ansicht {{quotedName}} wirklich wiederherstellen?",
"revert-update-view-message-unnamed": "Wollen Sie die alte Version dieser Ansicht wirklich wiederherstellen?",
"revert-update-type-message-named": "Wollen Sie die alte Version des Objekttyps {{quotedName}} wirklich wiederherstellen?",
"revert-update-type-message-unnamed": "Wollen Sie die alte Version dieses Objekttyps wirklich wiederherstellen?",
"revert-update-button": "Wiederherstellen",
"revert-delete": "Wiederherstellen",
"revert-delete-marker-title": "Marker wiederherstellen",
"revert-delete-line-title": "Linie wiederherstellen",
"revert-delete-view-title": "Ansicht wiederherstellen",
"revert-delete-type-title": "Objekttype wiederherstellen",
"revert-delete-marker-message-named": "Wollen Sie die alte Version des Markers {{quotedName}} wirklich wiederherstellen?",
"revert-delete-marker-message-unnamed": "Wollen Sie die alte Version dieses Markers wirklich wiederherstellen?",
"revert-delete-line-message-named": "Wollen Sie die alte Version der Linie {{quotedName}} wirklich wiederherstellen?",
"revert-delete-line-message-unnamed": "Wollen Sie die alte Version dieser Linie wirklich wiederherstellen?",
"revert-delete-view-message-named": "Wollen Sie die alte Version der Ansicht {{quotedName}} wirklich wiederherstellen?",
"revert-delete-view-message-unnamed": "Wollen Sie die alte Version dieser Ansicht wirklich wiederherstellen?",
"revert-delete-type-message-named": "Wollen Sie die alte Version des Objekttyps {{quotedName}} wirklich wiederherstellen?",
"revert-delete-type-message-unnamed": "Wollen Sie die alte Version dieses Objekttyps wirklich wiederherstellen?",
"revert-delete-button": "Wiederherstellen"
},
"modal-dialog": {
"close": "Schließen",
"cancel": "Abbrechen",
Expand Down
73 changes: 73 additions & 0 deletions frontend/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,79 @@
"option-reorder": "Reorder",
"option-add": "Add"
},
"history-dialog": {
"loading-error": "Error loading history",
"revert-error": "Error reverting history entry",
"title": "History",
"introduction": "Here you can inspect and revert the last 50 changes to the map.",
"date": "Date",
"action": "Action",
"restore": "Restore",
"diff-field": "Field",
"diff-before": "Before",
"diff-after": "After"
},
"history-utils": {
"description-create-marker": "Created marker {{id}} {{quotedName}}",
"description-create-line": "Created line {{id}} {{quotedName}}",
"description-create-view": "Created view {{id}} {{quotedName}}",
"description-create-type": "Created type {{id}} {{quotedName}}",
"description-update-map": "Changed map settings",
"description-update-marker": "Changed marker {{id}} {{quotedName}}",
"description-update-line": "Changed line {{id}} {{quotedName}}",
"description-update-view": "Changed view {{id}} {{quotedName}}",
"description-update-type": "Changed type {{id}} {{quotedName}}",
"description-delete-marker": "Deleted marker {{id}} {{quotedName}}",
"description-delete-line": "Deleted line {{id}} {{quotedName}}",
"description-delete-view": "Deleted view {{id}} {{quotedName}}",
"description-delete-type": "Deleted type {{id}} {{quotedName}}",
"description-interpolation-quotedName": "“{{name}}”",
"description-interpolation-quotedName-renamed": "{{quotedBefore}} (new name: {{quotedAfter}})",
"revert-create": "Revert (delete)",
"revert-create-marker-title": "Delete marker",
"revert-create-line-title": "Delete line",
"revert-create-view-title": "Delete view",
"revert-create-type-title": "Delete type",
"revert-create-marker-message-named": "Do you really want to delete the marker {{quotedName}}?",
"revert-create-marker-message-unnamed": "Do you really want to delete this marker?",
"revert-create-line-message-named": "Do you really want to delete the line {{quotedName}}?",
"revert-create-line-message-unnamed": "Do you really want to delete this line?",
"revert-create-view-message-named": "Do you really want to delete the view {{quotedName}}?",
"revert-create-view-message-unnamed": "Do you really want to delete this view?",
"revert-create-type-message-named": "Do you really want to delete the type {{quotedName}}?",
"revert-create-type-message-unnamed": "Do you really want to delete this type?",
"revert-create-button": "Delete",
"revert-update": "Revert",
"revert-update-map-title": "Revert map settings",
"revert-update-marker-title": "Revert marker",
"revert-update-line-title": "Revert line",
"revert-update-view-title": "Revert view",
"revert-update-type-title": "Revert type",
"revert-update-map-message": "Do you really want to restore the old version of the map settings?",
"revert-update-marker-message-named": "Do you really want to restore the old version of the marker {{quotedName}}?",
"revert-update-marker-message-unnamed": "Do you really want to restore the old version of this marker?",
"revert-update-line-message-named": "Do you really want to restore the old version of the line {{quotedName}}?",
"revert-update-line-message-unnamed": "Do you really want to restore the old version of this line?",
"revert-update-view-message-named": "Do you really want to restore the old version of the view {{quotedName}}?",
"revert-update-view-message-unnamed": "Do you really want to restore the old version of this view?",
"revert-update-type-message-named": "Do you really want to restore the old version of the type {{quotedName}}?",
"revert-update-type-message-unnamed": "Do you really want to restore the old version of this type?",
"revert-update-button": "Revert",
"revert-delete": "Restore",
"revert-delete-marker-title": "Restore marker",
"revert-delete-line-title": "Restore line",
"revert-delete-view-title": "Restore view",
"revert-delete-type-title": "Restore type",
"revert-delete-marker-message-named": "Do you really want to restore the marker {{quotedName}}?",
"revert-delete-marker-message-unnamed": "Do you really want to restore this marker?",
"revert-delete-line-message-named": "Do you really want to restore the line {{quotedName}}?",
"revert-delete-line-message-unnamed": "Do you really want to restore this line?",
"revert-delete-view-message-named": "Do you really want to restore the view {{quotedName}}?",
"revert-delete-view-message-unnamed": "Do you really want to restore this view?",
"revert-delete-type-message-named": "Do you really want to restore the type {{quotedName}}?",
"revert-delete-type-message-unnamed": "Do you really want to restore this type?",
"revert-delete-button": "Restore"
},
"modal-dialog": {
"close": "Close",
"cancel": "Cancel",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
function provideComponent<K extends keyof FacilMapComponents>(key: K, componentRef: Readonly<Ref<FacilMapComponents[K]>>) {
if (key in components) {
throw new Error(`Component "${key}"" is already provided.`);
throw new Error(`Component "${key}" is already provided.`);
}
watch(componentRef, (component) => {
Expand Down
24 changes: 13 additions & 11 deletions frontend/src/lib/components/history-dialog/history-dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import Popover from "../ui/popover.vue";
import ModalDialog from "../ui/modal-dialog.vue";
import { injectContextRequired, requireClientContext } from "../facil-map-context-provider/facil-map-context-provider.vue";
import { useI18n } from "../../utils/i18n";
type HistoryEntryWithLabels = HistoryEntry & {
labels: HistoryEntryLabels;
Expand All @@ -20,6 +21,7 @@
const client = requireClientContext(context);
const toasts = useToasts();
const i18n = useI18n();
const emit = defineEmits<{
hidden: [];
Expand All @@ -37,7 +39,7 @@
try {
await client.value.listenToHistory();
} catch (err) {
toasts.showErrorToast(`${id}-listen-error`, "Error loading history", err);
toasts.showErrorToast(`${id}-listen-error`, i18n.t("history-dialog.loading-error"), err);
} finally {
isLoading.value = false;
}
Expand All @@ -55,7 +57,7 @@
toasts.hideToast(`${id}-revert-error`);
if (!await showConfirm({
title: entry.labels.revert!.button,
title: entry.labels.revert!.title,
message: entry.labels.revert!.message,
variant: "warning",
okLabel: entry.labels.revert!.okLabel
Expand All @@ -67,7 +69,7 @@
try {
await client.value.revertHistoryEntry({ id: entry.id });
} catch (err) {
toasts.showErrorToast(`${id}-revert-error`, "Error loading history", err);
toasts.showErrorToast(`${id}-revert-error`, i18n.t("history-dialog.revert-error"), err);
} finally {
isReverting.value = undefined;
}
Expand Down Expand Up @@ -96,23 +98,23 @@

<template>
<ModalDialog
title="History"
:title="i18n.t('history-dialog.title')"
size="xl"
class="fm-history"
@hidden="emit('hidden')"
:isBusy="!!isReverting"
>
<p><em>Here you can inspect and revert the last 50 changes to the map.</em></p>
<p><em>{{i18n.t("history-dialog.introduction")}}</em></p>
<div v-if="isLoading" class="d-flex justify-content-center">
<div class="spinner-border"></div>
</div>
<table v-else class="table table-striped table-hover history-entries">
<thead>
<tr>
<th style="min-width: 12rem">Date</th>
<th style="min-width: 15rem">Action</th>
<th style="min-width: 12rem">{{i18n.t("history-dialog.date")}}</th>
<th style="min-width: 15rem">{{i18n.t("history-dialog.action")}}</th>
<th></th>
<th>Restore</th>
<th>{{i18n.t("history-dialog.restore")}}</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -141,9 +143,9 @@
<table class="table table-hover table-sm">
<thead>
<tr>
<th>Field</th>
<th>Before</th>
<th>After</th>
<th>{{i18n.t("history-dialog.diff-field")}}</th>
<th>{{i18n.t("history-dialog.diff-before")}}</th>
<th>{{i18n.t("history-dialog.diff-after")}}</th>
</tr>
</thead>
<tbody>
Expand Down
Loading

0 comments on commit 1de9134

Please sign in to comment.