Skip to content

Commit

Permalink
Add locale documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-geraldes committed Mar 25, 2024
1 parent b18c996 commit 5624d68
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions docs/locale.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
sidebar_position: 9
---

# Locale

**What are the languages supported by Topper?**

Topper supports English and Brazilian Portuguese.

**How to set a specific locale?**

Without any param passed, the widget will try to infer the user locale from the browser and if the browser locale is not supported it will default to English.

You can override that behavior by adding `&locale=en` to the URL and force a specific locale from the supported ones, such as `https://app.topperpay.com/?bt=<bootstrap token>&locale=pt`. The supported values are `en` and `pt`.

After the user authenticates within Topper, the locale will be set accordingly with the user preferences.

**Using the [Web SDK](./web-sdk.md):**

```js
const topper = new TopperWebSdk({ locale: TOPPER_LOCALES.PT });

topper.initialize({ bootstrapToken: <bootstrap token> });
```
2 changes: 1 addition & 1 deletion docs/theming.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 9
sidebar_position: 10
---

# Theming
Expand Down
2 changes: 1 addition & 1 deletion docs/web-sdk.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 10
sidebar_position: 11
---

# Web SDK
Expand Down

0 comments on commit 5624d68

Please sign in to comment.