mirror of
https://github.com/temetro/temetro.git
synced 2026-08-09 10:09:39 +00:00
d237504af9
Add three UI locales (so/ar/de) with full ~1,660-key translations alongside en/fr, selectable in Settings → Profile. Arabic gets full right-to-left support: - config.ts registers the locales and exports a `dirFor` helper; an inline <head> script in layout.tsx sets <html dir/lang> before first paint (no RTL flash), and i18n-provider keeps them in sync on language change. - ~160 physical direction utilities converted to logical (ms/me/ps/pe/ start/end/text-start/text-end); directional chevrons/arrows get rtl:rotate-180; chat-bubble align variants fixed to logical. - IBM Plex Sans Arabic appended to the sans/heading font stacks for per-character Arabic fallback. - Language persists to the backend user_settings and re-applies on sign-in so it roams across devices (localStorage stays the offline source of truth). - New scripts/check-locales.mjs (npm run check-locales) enforces key/placeholder parity and Arabic CLDR plural completeness. Bump to 0.3.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
"use client";
|
|
|
|
import { PanelLeft } from "lucide-react";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
import { useSidebar } from "@/components/ui/sidebar";
|
|
|
|
// A floating top-right button that opens the sidebar on phones. The in-sidebar
|
|
// SidebarTrigger is unreachable on mobile once the offcanvas sidebar is closed,
|
|
// so this gives a persistent way to bring it back. Hidden on md+ where the
|
|
// sidebar is always docked.
|
|
export function MobileSidebarTrigger() {
|
|
const { t } = useTranslation();
|
|
const { toggleSidebar, openMobile } = useSidebar();
|
|
|
|
// While the offcanvas Sheet is open it already covers the screen — no need to
|
|
// float a button over it.
|
|
if (openMobile) return null;
|
|
|
|
return (
|
|
<Button
|
|
aria-label={t("nav.openSidebar")}
|
|
className="fixed top-3 end-3 z-50 size-9 rounded-full bg-background/80 shadow-sm backdrop-blur md:hidden"
|
|
onClick={toggleSidebar}
|
|
size="icon"
|
|
variant="outline"
|
|
>
|
|
<PanelLeft className="size-4" />
|
|
</Button>
|
|
);
|
|
}
|