# setLanguage

## Description

Allows users to set a default language for the app from the pre-defined languages in language settings.

## Input / Parameter

| Name | Description                                    | Input Type  | Default | Options | Required |
| ---- | ---------------------------------------------- | ----------- | ------- | ------- | -------- |
| lang | The name of the language to be set as default. | String/Text | -       | -       | Yes      |

## Output

N/A

Note: The component will be updated to show the translated text in the language specified by the user.

## Callback

N/A

## Video

Coming Soon.

## Example

The user override the default language (English) of their App.

### Step

1. Go to language setting tab add language "chinese", add label "Language" and assign chinese word for the label as below:

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-02c599072fbaf0dcce1994c386925cc93b6cda3f%2FsetLanguage-step-1.png?alt=media)
2. Draw a Label with "Language" Caption, a button "setLanguage"

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-f11483c46e2cea8521fe9d7d877cc7bae3e975af%2FsetLanguage-step-2.png?alt=media)
3. Call the function

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-9c04d79d02843ce76f78eb669106d4d84d3c93d3%2FsetLanguage-step-3.png?alt=media)
4. Reload

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-e626a685de32b454f30340c21d453060f24023cf%2FsetLanguage-step-4.png?alt=media)

### Result

The word "Language" will be changed to "语言选择".<br>

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-2e4b933355679b19547234a879ab69de53670b01%2FsetLanguage-result-1.png?alt=media)

### Notes

* In the language setting, the word used for mapping is case sensitive.

## Links
