Skip to content

Build your personal knowledge base with Trilium Notes

feat(status_bar/language): add tooltip

Elian Doran26389631716c
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 136513ef8f..e8ff99aab5 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -2156,5 +2156,8 @@
"execute_script_description": "This note is a script note. Click to execute the script.",
"execute_sql": "Run SQL",
"execute_sql_description": "This note is a SQL note. Click to execute the SQL query."
+ },
+ "status_bar": {
+ "language_title": "Change the language of the entire content"
}
}
diff --git a/apps/client/src/widgets/layout/StatusBar.tsx b/apps/client/src/widgets/layout/StatusBar.tsx
index 0dc13df192..b941606706 100644
--- a/apps/client/src/widgets/layout/StatusBar.tsx
+++ b/apps/client/src/widgets/layout/StatusBar.tsx
@@ -38,12 +38,21 @@ export default function StatusBar() {
);
}
-function StatusBarDropdown({ children, icon, text, buttonClassName, ...dropdownProps }: Omit<DropdownProps, "hideToggleArrow"> & {
+function StatusBarDropdown({ children, icon, text, buttonClassName, titleOptions, ...dropdownProps }: Omit<DropdownProps, "hideToggleArrow" | "title" | "titlePosition"> & {
+ title: string;
icon?: string;
}) {
return (
<Dropdown
buttonClassName={clsx("status-bar-dropdown-button", buttonClassName)}
+ titlePosition="top"
+ titleOptions={{
+ ...titleOptions,
+ popperConfig: {
+ ...titleOptions?.popperConfig,
+ strategy: "fixed"
+ }
+ }}
text={<>
{icon && (<><Icon icon={icon} />&nbsp;</>)}
{text}
@@ -62,7 +71,11 @@ function LanguageSwitcher({ note }: StatusBarContext) {
return (
<>
- <StatusBarDropdown icon="bx bx-globe" text={<span dir={activeLocale?.rtl ? "rtl" : "ltr"}>{getLocaleName(activeLocale)}</span>}>
+ <StatusBarDropdown
+ icon="bx bx-globe"
+ title={t("status_bar.language_title")}
+ text={<span dir={activeLocale?.rtl ? "rtl" : "ltr"}>{getLocaleName(activeLocale)}</span>}
+ >
{processedLocales.map(locale => {
if (typeof locale === "object") {
return <FormListItem