chore(i18n): translate geo map messages

This commit is contained in:
Elian Doran 2025-01-22 22:12:25 +02:00
parent 5a40d3f020
commit d814a4d49f
No known key found for this signature in database
6 changed files with 29 additions and 6 deletions

View File

@ -1,3 +1,4 @@
import { t } from "../../services/i18n.js";
import NoteContextAwareWidget from "../note_context_aware_widget.js"
const TPL = `\
@ -22,7 +23,7 @@ const TPL = `\
<button type="button"
class="geo-map-create-child-note floating-button btn bx bx-folder-plus"
title="Create new child note and add it to the map" />
title="${t("geo-map.create-child-note-title")}" />
</div>`;
export default class GeoMapButtons extends NoteContextAwareWidget {

View File

@ -128,7 +128,7 @@ export default class GeoMapTypeWidget extends TypeWidget {
this.L = L;
const map = this.geoMapWidget.map;
if (!map) {
throw new Error("Unable to load map.");
throw new Error(t("geo-map.unable-to-load-map"));
}
if (!this.note) {
@ -273,7 +273,7 @@ export default class GeoMapTypeWidget extends TypeWidget {
icon: "plus",
id: "geo-new-note",
title: "New note",
message: "Click on the map to create a new note at that location or press Escape to dismiss."
message: t("geo-map.create-child-note-instruction")
});
this.#changeState(State.NewNote);

View File

@ -2,6 +2,7 @@ import appContext from "../../components/app_context.js";
import type { ContextMenuEvent } from "../../menus/context_menu.js";
import contextMenu from "../../menus/context_menu.js";
import linkContextMenu from "../../menus/link_context_menu.js";
import { t } from "../../services/i18n.js";
export default function openContextMenu(noteId: string, e: ContextMenuEvent) {
contextMenu.show({
@ -9,9 +10,9 @@ export default function openContextMenu(noteId: string, e: ContextMenuEvent) {
y: e.pageY,
items: [
...linkContextMenu.getItems(),
{ title: "Open location", command: "openGeoLocation", uiIcon: "bx bx-map-alt" },
{ title: t("geo-map-context.open-location"), command: "openGeoLocation", uiIcon: "bx bx-map-alt" },
{ title: "----" },
{ title: "Remove from map", command: "deleteFromMap", uiIcon: "bx bx-trash" }
{ title: t("geo-map-context.remove-from-map"), command: "deleteFromMap", uiIcon: "bx bx-trash" }
],
selectMenuItemHandler: ({ command }, e) => {
if (command === "deleteFromMap") {

View File

@ -1630,5 +1630,14 @@
},
"note_tooltip": {
"note-has-been-deleted": "Note has been deleted."
},
"geo-map": {
"create-child-note-title": "Create a new child note and add it to the map",
"create-child-note-instruction": "Click on the map to create a new note at that location or press Escape to dismiss.",
"unable-to-load-map": "Unable to load map."
},
"geo-map-context": {
"open-location": "Open location",
"remove-from-map": "Remove from map"
}
}

View File

@ -1379,7 +1379,8 @@
"image": "Imagine",
"launcher": "Scurtătură",
"widget": "Widget",
"confirm-change": "Nu se recomandă schimbarea tipului notiței atunci când ea are un conținut. Procedați oricum?"
"confirm-change": "Nu se recomandă schimbarea tipului notiței atunci când ea are un conținut. Procedați oricum?",
"geo-map": "Hartă geografică (beta)"
},
"protect_note": {
"toggle-off": "Deprotejează notița",
@ -1633,5 +1634,13 @@
"notes": {
"duplicate-note-suffix": "(dupl.)",
"duplicate-note-title": "{{ noteTitle }} {{ duplicateNoteSuffix }}"
},
"geo-map-context": {
"open-location": "Deschide locația",
"remove-from-map": "Înlătură de pe hartă"
},
"geo-map": {
"create-child-note-title": "Crează o notiță nouă și adaug-o pe hartă",
"unable-to-load-map": "Nu s-a putut încărca harta."
}
}

View File

@ -248,5 +248,8 @@
"backend_log": {
"log-does-not-exist": "Fișierul de loguri de backend „{{ fileName }}” nu există (încă).",
"reading-log-failed": "Nu s-a putut citi fișierul de loguri de backend „{{fileName}}”."
},
"geo-map": {
"create-child-note-instruction": "Clic pe hartă pentru a crea o nouă notiță la acea poziție sau apăsați Escape pentru a renunța."
}
}