Skip to main content
Glama
northernvariables

FedMCP - Federal Parliamentary Information

LanguageSwitcher.tsx1.44 kB
'use client'; import { useLocale, useTranslations } from 'next-intl'; import { usePathname, useRouter } from '@/i18n/navigation'; import { locales } from '@/i18n/config'; import { useTransition } from 'react'; export function LanguageSwitcher() { const t = useTranslations('common'); const locale = useLocale(); const router = useRouter(); const pathname = usePathname(); const [isPending, startTransition] = useTransition(); const handleLanguageChange = (newLocale: string) => { startTransition(() => { router.replace(pathname, { locale: newLocale }); }); }; return ( <div className="flex items-center gap-0.5 rounded-md border border-border-subtle bg-bg-secondary p-0.5"> {locales.map((loc) => ( <button key={loc} onClick={() => handleLanguageChange(loc)} disabled={isPending} className={` px-2 py-1 text-xs font-medium rounded transition-colors ${ locale === loc ? 'bg-accent-red text-white' : 'text-text-secondary hover:text-text-primary hover:bg-bg-elevated' } ${isPending ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'} `} aria-label={loc === 'en' ? t('english') : t('french')} aria-current={locale === loc ? 'true' : 'false'} > {loc.toUpperCase()} </button> ))} </div> ); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/northernvariables/FedMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server