> ## Documentation Index
> Fetch the complete documentation index at: https://docs.authsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Localization

> Configure the language and locale of the pre-built UI for your users.

The pre-built UI supports multiple languages out of the box. By default, the locale is automatically detected from the user's browser language settings, falling back to English if the detected language is not supported.

## Supported languages

| Language               | Locale code |
| ---------------------- | ----------- |
| English                | `en`        |
| French                 | `fr`        |
| French (Canadian)      | `fr-ca`     |
| German                 | `de`        |
| Spanish                | `es`        |
| Italian                | `it`        |
| Dutch                  | `nl`        |
| Polish                 | `pl`        |
| Portuguese (Brazilian) | `pt-br`     |

Need a language that isn't listed? [Get in touch](https://www.authsignal.com/contact) and we can work with you to add support for it.

## Overriding the locale

You can override the automatic locale detection by including the `locale` field in the [track action](/api-reference/server-api/track-action) request payload.
The `locale` value will be included in the pre-built UI URL automatically.

This is useful when:

* Your application already knows the user's preferred language
* You want to ensure a consistent language regardless of the user's browser settings

<CodeGroup>
  ```ts Node.js {6} theme={null}
  const response = await authsignal.track({
    userId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
    action: "signIn",
    attributes: {
      redirectUrl: "https://yourapp.com/callback",
      locale: "es",
    },
  });

  const url = response.url;
  ```

  ```csharp C# {5} theme={null}
  var response = await authsignal.Track(new TrackRequest(
      UserId: user.Id,
      Action: "signIn",
      Attributes: new TrackAttributes(
          RedirectUrl: "https://yourapp.com/callback",
          Locale: "es"
      )
  ));

  var url = response.Url;
  ```

  ```ruby Ruby {6} theme={null}
  response = Authsignal.track({
    user_id: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
    action: "signIn",
    attributes: {
      redirect_url: "https://yourapp.com/callback",
      locale: "es"
    }
  })

  url = response[:url]
  ```

  ```python Python {5} theme={null}
  response = authsignal.track(
      user_id="dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
      action="signIn",
      attributes={
          "redirectUrl": "https://yourapp.com/callback",
          "locale": "es"
      }
  )

  url = response["url"]
  ```

  ```php PHP {5} theme={null}
  $response = Authsignal::track([
      'userId' => "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
      'action' => "signIn",
      'attributes' => [
          'redirectUrl' => "https://yourapp.com/callback",
          'locale' => "es"
      ]
  ]);

  $url = $response["url"]
  ```

  ```go Go {7} theme={null}
  response, err := client.Track(
      TrackRequest{
          UserId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
          Action: "signIn",
          Attributes: &TrackAttributes{
              RedirectUrl: "https://yourapp.com/callback",
              Locale: "es",
          },
      },
  )

  url := response.Url
  ```
</CodeGroup>

<Info>
  The `locale` field only accepts values from the supported languages list above.
  If an unsupported value is provided, it will be ignored and the pre-built UI will fall back to browser-based detection.
</Info>
