feat(status_bar/language): add tooltip

This commit is contained in:
Elian Doran
2025-12-12 18:58:54 +02:00
parent 24ed97f65d
commit 2638963171
2 changed files with 18 additions and 2 deletions

View File

@@ -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"
} }
} }

View File

@@ -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} />&nbsp;</>)} {icon && (<><Icon icon={icon} />&nbsp;</>)}
{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