> For the complete documentation index, see [llms.txt](https://doc.ozforensics.com/oz-knowledge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/sdk/oz-liveness-websdk/web-plugin/localization-adding-a-custom-language-pack.md).

# Localization: Adding a Custom Language Pack

The `add_lang(lang_id, lang_obj)` method allows adding a new or customized language pack.

Parameters:

* `lang_id`: a string value that can be subsequently used as `lang` parameter for the `open()` method;
* `lang_obj`: an object that includes identifiers of translation strings as keys and translation strings themselves as values.

A list of language identifiers:

| lang\_id   | Language               |
| ---------- | ---------------------- |
| en         | English                |
| es         | Spanish                |
| pt-br[^1]  | Portuguese (Brazilian) |
| kz, kk[^2] | Kazakh                 |

An example of usage:

`OzLiveness.add_lang('en', enTranslation)`, where `enTranslation` is a JSON object.

```javascript
// Editing the button text
OzLiveness.add_lang('en', {
  action_photo_button: 'Take a photo'
});
```

To set the SDK language, when you launch the plugin, specify the language identifier in `lang`:

```javascript
OzLiveness.open({
    lang: 'es', // the identifier of the needed language
    ...
});
```

You can check which locales are installed in Web SDK: use the `ozLiveness.get_langs()` method. If you have added a locale manually, it will also be shown.

A list of all language identifiers:

{% file src="/files/eMc27nmP9cm6spykmbnA" %}

The keys `oz_action_*_go` refer to the appropriate gestures. `oz_tutorial_camera_*` – to the hints on how to enable camera in different browsers. Others refer to the hints for any gesture, info messages, or errors.

Since 1.5.0, if your language pack doesn't include a key, the message for this key will be shown in English.

<details>

<summary>Before 1.5.0</summary>

If your language pack doesn't include a key, the translation for this key won't be shown.

</details>

[^1]: Formerly `pt`, changed in 1.3.1

[^2]: is supported since 1.9.2


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/sdk/oz-liveness-websdk/web-plugin/localization-adding-a-custom-language-pack.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
