Arman Danesh Portfolio — Documentation - v2.0.0
    Preparing search index...

    Interface LanguageContextValue

    Public shape of the language context value.

    interface LanguageContextValue {
        locale: Locale;
        t: Translations;
        isRTL: boolean;
        isSwitching: boolean;
        toggleLanguage: () => void;
    }
    Index
    locale: Locale

    Active language code.

    Full translation object for locale.

    isRTL: boolean

    true when Persian is active (drives dir / lang on <html>).

    isSwitching: boolean

    true during the short opacity crossfade between languages.

    toggleLanguage: () => void

    Animated EN ↔ FA switch.

    1. Sets isSwitching so the page can dim.
    2. After ~180ms flips locale.
    3. After another ~280ms clears isSwitching.

    Double-taps while switching are ignored.