[**@wocart/storefront v3.1.0**](../../README)

***

[@wocart/storefront](../../README) / [index](../README) / localizeHref

# Function: localizeHref()

> **localizeHref**(`href`, `locale`, `routing`): `string`

An internal link in `locale`: `/products/x` → `/fr/products/x`, `/` → `/fr`.
Left unchanged: the primary language, external and protocol-relative URLs,
fragments, `mailto:`/`tel:`, endpoints and files, a page that exists in the
primary language only (a landing page), and a link that already carries a
language prefix. Query strings and fragments are kept.

## Parameters

### href

`string`

### locale

`string`

### routing

[`LocaleRouting`](../interfaces/LocaleRouting)

## Returns

`string`
