mirror of
https://github.com/zadam/trilium.git
synced 2025-12-15 12:49:53 +01:00
feat(status_bar/language): add tooltip
This commit is contained in:
@@ -2156,5 +2156,8 @@
|
|||||||
"execute_script_description": "This note is a script note. Click to execute the script.",
|
"execute_script_description": "This note is a script note. Click to execute the script.",
|
||||||
"execute_sql": "Run SQL",
|
"execute_sql": "Run SQL",
|
||||||
"execute_sql_description": "This note is a SQL note. Click to execute the SQL query."
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
icon?: string;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
buttonClassName={clsx("status-bar-dropdown-button", buttonClassName)}
|
buttonClassName={clsx("status-bar-dropdown-button", buttonClassName)}
|
||||||
|
titlePosition="top"
|
||||||
|
titleOptions={{
|
||||||
|
...titleOptions,
|
||||||
|
popperConfig: {
|
||||||
|
...titleOptions?.popperConfig,
|
||||||
|
strategy: "fixed"
|
||||||
|
}
|
||||||
|
}}
|
||||||
text={<>
|
text={<>
|
||||||
{icon && (<><Icon icon={icon} /> </>)}
|
{icon && (<><Icon icon={icon} /> </>)}
|
||||||
{text}
|
{text}
|
||||||
@@ -62,7 +71,11 @@ function LanguageSwitcher({ note }: StatusBarContext) {
|
|||||||
|
|
||||||
return (
|
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 => {
|
{processedLocales.map(locale => {
|
||||||
if (typeof locale === "object") {
|
if (typeof locale === "object") {
|
||||||
return <FormListItem
|
return <FormListItem
|
||||||
|
|||||||
Reference in New Issue
Block a user