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 May 10, 2024
1 parent a947b85 commit d81fa07
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?**

By default, Topper will use the locale set on the user's browser. If that locale is not supported it will default to English.

To set a specific locale, you can set it as query parameter such as: `https://app.topperpay.com/?bt=<bootstrap token>&locale=en` or `https://app.topperpay.com/?bt=<bootstrap token>&lang=en`. The supported values are `en`, `en-US`, `pt` and `pt-BR`.

When the user user authenticates in 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 d81fa07

Please sign in to comment.