# General Translation React SDKs (gt-react, gt-next, gt-react-native): useLocalizeHref
URL: https://generaltranslation.com/it/docs/react/nextjs/reference/hooks/use-localize-href.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Localizza i percorsi dell'App Router per la navigazione che non esegue il rendering di un link. Riferimento API per useLocalizeHref.

L&#39;hook `useLocalizeHref` restituisce una funzione che localizza un percorso applicando le stesse regole di [`<Link>`](/docs/react/nextjs/link). Usalo per la navigazione che non esegue il rendering di un `<Link>`, ad esempio con `router.push()` o con la prop `href` di un componente.

Importalo da `gt-next/link` nei componenti client oppure da `gt-next` nei componenti server e client. Nel codice server async, usa [`getLocalizeHref`](/docs/react/nextjs/reference/functions/get-localize-href).

## Panoramica [#overview]

```tsx title="components/CheckoutButton.tsx"
'use client';

import { useRouter } from 'next/navigation';
import { useLocalizeHref } from 'gt-next/link';

export function CheckoutButton() {
  const router = useRouter();
  const localizeHref = useLocalizeHref();

  return (
    <button onClick={() => router.push(localizeHref('/checkout'))}>
      Checkout
    </button>
  );
}
```

## Returns [#returns]

**Tipo** `(href: string, locale?: string | false) => string`

Una funzione che localizza `href` per l&#39;impostazione regionale attuale oppure, se specificato, per `locale`. Passa `false` per restituire `href` invariato.

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
