Skip to content

Commit

Permalink
Übersetzung für Karten und Verläufe
Browse files Browse the repository at this point in the history
  • Loading branch information
julia221501 committed Mar 2, 2024
1 parent 49dd7c2 commit b6e5fd7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
32 changes: 20 additions & 12 deletions src/components/ComparisonOptionsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@click.stop="isOpen = !isOpen"
@click="newVersion = false"
>
<span>Karten und Verlauf</span>
<span>{{ t("versiontitle") }}</span>
<span class="icon is-medium clickAble right">
<font-awesome-icon v-if="isOpen" icon="chevron-up" />
<font-awesome-icon v-else icon="chevron-down" size="1x" />
Expand All @@ -17,10 +17,10 @@
<div id="record-settings" class="field" v-if="isOpen">
<div class="control">
<div class="field is-horizontal">
Aktuelle Karte:&nbsp;
{{ t("currentversion") }}
<span v-if="versions.length && currentVersion >= 0">
{{ visibleNWKVersion?.title || "" }}
vom
{{ t("versionfrom") }}
<!-- TODO use internationalizable date formater -->
{{
visibleNWKVersion?.date?.substring(8, 10) +
Expand Down Expand Up @@ -54,7 +54,7 @@
<span class="icon">
<font-awesome-icon icon="plus-circle" />
</span>
<span>Neue leere Karte</span>
<span>{{ t("newemptyversion") }}</span>
<span></span>
</button>

Expand All @@ -67,14 +67,14 @@
<span class="icon">
<font-awesome-icon icon="copy" />
</span>
<span>Karte duplizieren</span>
<span>{{ t("duplicateversion") }}</span>
</button>

<button class="button" @click.stop="toggleChange">
<span class="icon">
<font-awesome-icon icon="exchange-alt" />
</span>
<span>Karte wechseln</span>
<span>{{ t("changeversion") }}</span>
</button>

<!-- TODO hide comparison button in the production code in main branch
Expand All @@ -90,15 +90,15 @@
<div v-if="newVersion">
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Titel</label>
<label class="label">{{ t("title") }}</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<input
class="input"
type="text"
placeholder="Titel der aktuellen Version"
:placeholder="t('titleplaceholder')"
v-model="newVersionTitle"
/>
</div>
Expand All @@ -110,7 +110,7 @@

<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Datum</label>
<label class="label">{{ t("date") }}</label>
</div>
<div class="field-body">
<div class="field">
Expand All @@ -133,7 +133,7 @@
@click="addNewVersion()"
@click.stop="(newVersion = false), (firstCreation = false)"
>
<span>Speichern</span>
<span>{{ t("save") }}</span>
</button>

<button
Expand All @@ -143,7 +143,7 @@
@click.stop="(newVersion = false), (firstCreation = false)"
>
<!-- TODO Abbrechen does not clear the refs used in the text fields -->
<span>Abbrechen</span>
<span>{{ t("cancel") }}</span>
</button>

<!-- TODO move state updates into handler functions? -->
Expand All @@ -154,7 +154,7 @@
@click.stop="newVersion = false"
:disabled="versions.length <= 1"
>
<span>Karte Löschen</span>
<span>{{ t("deleteversion") }}</span>
</button>
</div>
</div>
Expand All @@ -170,6 +170,8 @@
import { defineComponent, ref, computed, watch } from "vue";
import { useStore } from "@/store";
import { NWKVersion } from "@/data/NWKVersion";
import de from "@/de";
import en from "@/en";

//type InputType = HTMLInputElement | HTMLTextAreaElement;

Expand All @@ -182,6 +184,12 @@ export default defineComponent({
},
},
*/
mixins: [de, en],
methods: {
t(prop: string) {
return this[document.documentElement.lang][prop];
},
},
setup() {
const store = useStore();

Expand Down
11 changes: 11 additions & 0 deletions src/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,17 @@ export default {
network_without_professional_help: "Netzwerk ohne prof. Hilfe",
entire_network: "gesamtes Netzwerk",
lang: "de",
//Karten und Verläufe:
versiontitle: "Karten und Verläufe",
currentversion: "Aktuelle Karte: ",
versionfrom: " vom ",
newemptyversion: "Neue leere Karte",
duplicateversion: "Karte duplizieren",
changeversion: "Karte wechseln",
title: "Titel",
date: "Datum",
deleteversion: "Karte löschen",
titleplaceholder: "Titel der aktuellen Version",
},
};
},
Expand Down
11 changes: 11 additions & 0 deletions src/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,17 @@ export default {
network_without_professional_help: "Network without Professional Help",
entire_network: "Entire Network",
lang: "en",
//Karten und Verläufe:
versiontitle: "Maps and versions",
currentversion: "Current map: ",
versionfrom: " from ",
newemptyversion: "New empty map",
duplicateversion: "Duplicate map",
changeversion: "Change map",
title: "Title",
date: "Date",
deleteversion: "Delete map",
titleplaceholder: "Title of the current version",
},
};
},
Expand Down

0 comments on commit b6e5fd7

Please sign in to comment.