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

# Localisation

Localize all static strings visible in the SDK Components.

<Warning>
  If you notice any missing strings, please reach out to us.
</Warning>

## Steps

<Steps>
  <Step title="Download the list of static strings">
    Get the complete list of strings that can be localized [here](https://firebasestorage.googleapis.com/v0/b/snippyly.appspot.com/o/external%2Flocalization-strings-map.json?alt=media\&token=0cdd2b52-10ed-4033-a08a-5c2b622ce7df).
  </Step>

  <Step title="Translate the strings and create the translations object">
    * Translate the strings in the languages you want to support.
    * Create an object with the translations for the languages you want to support in the following format:

    ```json theme={null}
    {
      "language-code-1": {
        "original string 1": "translated string 1",
        "original string 2": "translated string 2",
        ...
      },
      "language-code-2": {
        "original string 1": "translated string 1",
        "original string 2": "translated string 2",
        ...
      },
      ...
    }
    ```
  </Step>

  <Step title="Provide the translations object to the SDK">
    Call the `setTranslations` method with the translations object you created in the previous step.

    ```js theme={null}
    client.setTranslations(translationsObject);
    ```
  </Step>

  <Step title="Set the language">
    Set the language you want to use for the SDK. The language code should be the same as the language code you used in the translations object.

    ```js theme={null}
    client.setLanguage('en');
    ```
  </Step>
</Steps>

## Example

<Tabs>
  <Tab title="React / Next.js">
    ```jsx theme={null}
    // Provide the localization object for the languages you want to support.
    client.setTranslations({
      'en': {
        'All comments': 'All comments',
      },
      'fr': {
        'All comments': 'Tous les commentaires',
      },
      // Add more languages as needed.
    });

    // Set one of the languages you've provided the translations for.
    client.setLanguage('en');
    ```
  </Tab>

  <Tab title="Other Frameworks">
    ```js theme={null}
    // Provide the localization object for the languages you want to support.
    Velt.setTranslations({
      'en': {
        'All comments': 'All comments',
      },
      'fr': {
        'All comments': 'Tous les commentaires',
      },
      // Add more languages as needed.
    });

    // Set one of the languages you've provided the translations for.
    Velt.setLanguage('en');
    ```
  </Tab>
</Tabs>
