Skip to content

Commit

Permalink
Translate toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
cdauth committed Apr 4, 2024
1 parent 6ec952c commit 45e4171
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 30 deletions.
49 changes: 49 additions & 0 deletions frontend/src/i18n/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,55 @@ const messagesDe = {
"units": `Einheiten`,
"units-metric": `Metrisch`,
"units-us": `US customary (Meilen und Füße)`
},

"toolbox-add-dropdown": {
"label": `Erstellen`,
"manage-types": `Objekttypen verwalten`
},

"toolbox-collab-maps-dropdown": {
"label": `Kollaborative Karten`,
"bookmark": `Karte „{{padName}}“ als Favoriten hinzufügen`,
"manage-bookmarks": `Favoriten verwalten`,
"create-map": `Neue Karte erstellen`,
"open-map": `Existierende Karte öffnen`,
"open-other-map": `Andere Karte öffnen`,
"close-map": `Karte „{{padName}}“ schließen`
},

"toolbox-help-dropdown": {
"label": `Hilfe`,
"documentation": `Benutzerhandbuch`,
"matrix-chat": `Matrix-Chat`,
"bugtracker": `Fehler melden`,
"forum": `Frage stellen`,
"about": `Über {{appName}}`
},

"toolbox-map-style-dropdown": {
"label": `Kartenstil`,
"openstreetmap": `OpenStreetMap`,
"google-maps": `Google Maps`,
"google-maps-satellite": `Google Maps (Satellit)`,
"bing-maps": `Bing Maps`
},

"toolbox-tools-dropdown": {
"label": `Werkzeuge`,
"share": `Teilen`,
"open-file": `Datei öffnen`,
"export": `Exportieren`,
"filter": `Filter`,
"settings": `Eigenschaften`,
"history": `Versionsgeschichte`,
"user-preferences": `Benutzereinstellungen`
},

"toolbox-views-dropdown": {
"label": `Ansichten`,
"save-current-view": `Ansicht speichern`,
"manage-views": `Ansichten verwalten`
}
};

Expand Down
49 changes: 49 additions & 0 deletions frontend/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,55 @@ const messagesEn = {
"units": `Units`,
"units-metric": `Metric`,
"units-us": `US customary (miles, feet)`
},

"toolbox-add-dropdown": {
"label": `Add`,
"manage-types": `Manage types`
},

"toolbox-collab-maps-dropdown": {
"label": `Collaborative maps`,
"bookmark": `Bookmark map “{{padName}}”`,
"manage-bookmarks": `Manage bookmarks`,
"create-map": `Create a new map`,
"open-map": `Open an existing map`,
"open-other-map": `Open another map`,
"close-map": `Close map “{{padName}}”`
},

"toolbox-help-dropdown": {
"label": `Help`,
"documentation": `Documentation`,
"matrix-chat": `Matrix chat room`,
"bugtracker": `Report a problem`,
"forum": `Ask a question`,
"about": `About {{appName}}`
},

"toolbox-map-style-dropdown": {
"label": `Map style`,
"openstreetmap": `OpenStreetMap`,
"google-maps": `Google Maps`,
"google-maps-satellite": `Google Maps (Satellite)`,
"bing-maps": `Bing Maps`
},

"toolbox-tools-dropdown": {
"label": `Tools`,
"share": `Share`,
"open-file": `Open file`,
"export": `Export`,
"filter": `Filter`,
"settings": `Settings`,
"history": `History`,
"user-preferences": `User preferences`
},

"toolbox-views-dropdown": {
"label": `Views`,
"save-current-view": `Save current view`,
"manage-views": `Manage views`
}
};

Expand Down
6 changes: 4 additions & 2 deletions frontend/src/lib/components/toolbox/toolbox-add-dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import DropdownMenu from "../ui/dropdown-menu.vue";
import { injectContextRequired, requireClientContext, requireMapContext } from "../facil-map-context-provider/facil-map-context-provider.vue";
import { getOrderedTypes, sleep } from "facilmap-utils";
import { useI18n } from "../../utils/i18n";
const emit = defineEmits<{
"hide-sidebar": [];
Expand All @@ -17,6 +18,7 @@
const client = requireClientContext(context);
const mapContext = requireMapContext(context);
const toasts = useToasts();
const i18n = useI18n();
const dialog = ref<
| "manage-types"
Expand All @@ -42,7 +44,7 @@
:isDisabled="mapContext.interaction"
buttonClass="nav-link"
menuClass="dropdown-menu-end"
label="Add"
:label="i18n.t('toolbox-add-dropdown.label')"
>
<li v-for="type in orderedTypes" :key="type.id">
<a
Expand All @@ -65,7 +67,7 @@
href="javascript:"
@click="dialog = 'manage-types'; emit('hide-sidebar')"
draggable="false"
>Manage types</a>
>{{i18n.t("toolbox-add-dropdown.manage-types")}}</a>
</li>
</DropdownMenu>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
import DropdownMenu from "../ui/dropdown-menu.vue";
import { injectContextRequired, requireClientContext, requireMapContext } from "../facil-map-context-provider/facil-map-context-provider.vue";
import { normalizePadName } from "facilmap-utils";
import { useI18n } from "../../utils/i18n";
const context = injectContextRequired();
const client = requireClientContext(context);
const mapContext = requireMapContext(context);
const i18n = useI18n();
const emit = defineEmits<{
"hide-sidebar": [];
Expand Down Expand Up @@ -44,7 +46,7 @@
:isDisabled="mapContext.interaction"
buttonClass="nav-link"
menuClass="dropdown-menu-end"
label="Collaborative maps"
:label="i18n.t('toolbox-collab-maps-dropdown.label')"
>
<li v-for="bookmark in storage.bookmarks" :key="bookmark.id">
<a
Expand All @@ -66,7 +68,7 @@
href="javascript:"
@click="addBookmark()"
draggable="false"
>Bookmark {{normalizePadName(client.padData.name)}}</a>
>{{i18n.t('toolbox-collab-maps-dropdown.bookmark', { padName: normalizePadName(client.padData.name) })}}</a>
</li>

<li v-if="storage.bookmarks.length > 0">
Expand All @@ -75,7 +77,7 @@
href="javascript:"
@click="dialog = 'manage-bookmarks'; emit('hide-sidebar')"
draggable="false"
>Manage bookmarks</a>
>{{i18n.t('toolbox-collab-maps-dropdown.manage-bookmarks')}}</a>
</li>

<li v-if="(client.padData && !isBookmarked) || storage.bookmarks.length > 0">
Expand All @@ -88,7 +90,7 @@
href="javascript:"
@click="dialog = 'create-pad'; emit('hide-sidebar')"
draggable="false"
>Create a new map</a>
>{{i18n.t('toolbox-collab-maps-dropdown.create-map')}}</a>
</li>

<li>
Expand All @@ -97,7 +99,7 @@
href="javascript:"
@click="dialog = 'open-map'; emit('hide-sidebar')"
draggable="false"
>Open {{client.padId ? "another" : "an existing"}} map</a>
>{{client.padId ? i18n.t("toolbox-collab-maps-dropdown.open-other-map") : i18n.t("toolbox-collab-maps-dropdown.open-map")}}</a>
</li>

<li v-if="client.padData">
Expand All @@ -106,7 +108,7 @@
:href="`${context.baseUrl}#${hash}`"
@click.exact.prevent="client.openPad(undefined)"
draggable="false"
>Close {{client.padData.name}}</a>
>{{i18n.t("toolbox-collab-maps-dropdown.close-map", { padName: client.padData.name })}}</a>
</li>
</DropdownMenu>

Expand Down
14 changes: 8 additions & 6 deletions frontend/src/lib/components/toolbox/toolbox-help-dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import DropdownMenu from "../ui/dropdown-menu.vue";
import { injectContextRequired } from "../facil-map-context-provider/facil-map-context-provider.vue";
import Icon from "../ui/icon.vue";
import { useI18n } from "../../utils/i18n";
const context = injectContextRequired();
const i18n = useI18n();
const emit = defineEmits<{
"hide-sidebar": [];
Expand All @@ -23,7 +25,7 @@
isLink
buttonClass="nav-link"
menuClass="dropdown-menu-end"
label="Help"
:label="i18n.t('toolbox-help-dropdown.label')"
>
<li>
<a
Expand All @@ -32,7 +34,7 @@
target="_blank"
draggable="false"
>
<span>Documentation</span>
<span>{{i18n.t("toolbox-help-dropdown.documentation")}}</span>
<Icon icon="new-window"></Icon>
</a>
</li>
Expand All @@ -44,7 +46,7 @@
target="_blank"
draggable="false"
>
<span>Matrix chat room</span>
<span>{{i18n.t("toolbox-help-dropdown.matrix-chat")}}</span>
<Icon icon="new-window"></Icon>
</a>
</li>
Expand All @@ -56,7 +58,7 @@
target="_blank"
draggable="false"
>
<span>Report a problem</span>
<span>{{i18n.t("toolbox-help-dropdown.bugtracker")}}</span>
<Icon icon="new-window"></Icon>
</a>
</li>
Expand All @@ -68,7 +70,7 @@
target="_blank"
draggable="false"
>
<span>Ask a question</span>
<span>{{i18n.t("toolbox-help-dropdown.forum")}}</span>
<Icon icon="new-window"></Icon>
</a>
</li>
Expand All @@ -79,7 +81,7 @@
@click="dialog = 'about'; emit('hide-sidebar')"
href="javascript:"
draggable="false"
>About {{context.appName}}</a>
>{{i18n.t("toolbox-help-dropdown.about", { appName: context.appName })}}</a>
</li>
</DropdownMenu>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import DropdownMenu from "../ui/dropdown-menu.vue";
import { injectContextRequired, requireMapContext } from "../facil-map-context-provider/facil-map-context-provider.vue";
import Icon from "../ui/icon.vue";
import { useI18n } from "../../utils/i18n";
const context = injectContextRequired();
const mapContext = requireMapContext(context);
const i18n = useI18n();
const links = computed(() => {
const v = mapContext.value;
Expand Down Expand Up @@ -52,7 +54,7 @@
isLink
buttonClass="nav-link"
menuClass="dropdown-menu-end"
label="Map style"
:label="i18n.t('toolbox-map-style-dropdown.label')"
>
<li v-for="layerInfo in baseLayers" :key="layerInfo.key">
<a
Expand Down Expand Up @@ -89,7 +91,7 @@
target="_blank"
draggable="false"
>
<span>OpenStreetMap</span>
<span>{{i18n.t("toolbox-map-style-dropdown.openstreetmap")}}</span>
<Icon icon="new-window"></Icon>
</a>
</li>
Expand All @@ -101,7 +103,7 @@
target="_blank"
draggable="false"
>
<span>Google Maps</span>
<span>{{i18n.t("toolbox-map-style-dropdown.google-maps")}}</span>
<Icon icon="new-window"></Icon>
</a>
</li>
Expand All @@ -113,7 +115,7 @@
target="_blank"
draggable="false"
>
<span>Google Maps (Satellite)</span>
<span>{{i18n.t("toolbox-map-style-dropdown.google-maps-satellite")}}</span>
<Icon icon="new-window"></Icon>
</a>
</li>
Expand All @@ -125,7 +127,7 @@
target="_blank"
draggable="false"
>
<span>Bing Maps</span>
<span>{{i18n.t("toolbox-map-style-dropdown.bing-maps")}}</span>
<Icon icon="new-window"></Icon>
</a>
</li>
Expand Down
Loading

0 comments on commit 45e4171

Please sign in to comment.