Skip to content

Build your personal knowledge base with Trilium Notes

feat(mermaid): custom title for switch layout button

Elian Doranef9bec9dd4ed
diff --git a/src/public/app/widgets/floating_buttons/switch_layout_button.ts b/src/public/app/widgets/floating_buttons/switch_layout_button.ts
index 612c66d1fd..a018416a25 100644
--- a/src/public/app/widgets/floating_buttons/switch_layout_button.ts
+++ b/src/public/app/widgets/floating_buttons/switch_layout_button.ts
@@ -1,11 +1,11 @@
import type { EventData } from "../../components/app_context.js";
+import { t } from "../../services/i18n.js";
import options from "../../services/options.js";
import NoteContextAwareWidget from "../note_context_aware_widget.js";
const TPL = `
<button type="button"
- class="switch-layout-button"
- title="Switch layout">
+ class="switch-layout-button">
<span class="bx"></span>
</button>
`;
@@ -36,6 +36,12 @@ export default class SwitchSplitOrientationButton extends NoteContextAwareWidget
$icon
.toggleClass("bxs-dock-bottom", upcomingOrientation === "vertical")
.toggleClass("bxs-dock-left", upcomingOrientation === "horizontal");
+
+ if (upcomingOrientation === "vertical") {
+ this.$widget.attr("title", t("switch_layout_button.title_vertical"));
+ } else {
+ this.$widget.attr("title", t("switch_layout_button.title_horizontal"));
+ }
}
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json
index 2c19245109..99d9b48b12 100644
--- a/src/public/translations/en/translation.json
+++ b/src/public/translations/en/translation.json
@@ -1703,5 +1703,9 @@
"content_language": {
"title": "Content languages",
"description": "Select one or more languages that should appear in the language selection in the Basic Properties section of a read-only or editable text note. This will allow features such as spell-checking or right-to-left support."
+ },
+ "switch_layout_button": {
+ "title_vertical": "Move editing pane to the bottom",
+ "title_horizontal": "Move editing pane to the left"
}
}