Skip to content

Commit

Permalink
[update] the setLocale() method
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiipylypchuk1991 committed Sep 8, 2023
1 parent fd6f9f2 commit 21f65d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/api/methods/setlocale_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ setLocale(
~~~

### Parameters

- `locale` - (required) an object of the locale

:::important
The `setLocale()` method destroys the current component and initialize a new one. If you use the component with **Toolbar**, you need to call the [`setLocale()`](api/toolbar_api/methods/setlocale_method.md) method of **Toolbar**, to change its locale. See the example below!
:::

### Example

~~~js {97-98}
~~~js {97-98,100-102}
const { ToDo, Toolbar } = todo;
const { tasks, users, projects, tags } = getData();

Expand Down Expand Up @@ -128,8 +132,4 @@ list.setLocale(de);
toolbar.setLocale(de, list.api);
~~~

:::info
The Toolbar of To Do List is a separate component. To change its locale, you must apply its own [`setLocale()`](api/toolbar_api/methods/setlocale_method.md) method
:::

**Related article:** [Localization](guides/localization.md)

0 comments on commit 21f65d8

Please sign in to comment.