mirror of
https://github.com/zadam/trilium.git
synced 2025-12-13 03:39:54 +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_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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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} /> </>)}
|
||||
{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
|
||||
|
||||
Reference in New Issue
Block a user