Skip to content

Commit aafae6b

Browse files
[update] the setLocale() methods (SVAR-2325)
1 parent b92b5ac commit aafae6b

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

docs/api/methods/js_kanban_setedit_method.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ setEdit({ cardId: string | number } | null): void;
1818

1919
### Parameters
2020

21-
The method can take a *null* value or an object with the fallowing parameter:
21+
The method can take a *null* value or an object with the following parameter:
2222

2323
- `cardId` - (required) the ID of the card to be edited
2424

2525
:::note
2626
To close an editor, call the **setEdit()** method with the ***null*** value
2727
:::
2828

29-
3029
### Example
3130

3231
~~~jsx {7}
@@ -39,4 +38,4 @@ const board = new kanban.Kanban("#root", {
3938
board.setEdit({ cardId: 1 });
4039
~~~
4140

42-
**Change log:** The method was added in v1.2
41+
**Change log:** The method was added in v1.2

docs/api/methods/js_kanban_setlocale_method.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ setLocale(null | locale?: object): void;
2222
- `locale` - (optional) the object of data of the new locale to be applied
2323

2424
:::info
25-
Using this method, you can apply a new locale to Kanban. To reset Kanban to the default locale, call the method without arguments (or with a *null* value)
25+
Use the `setLocale()` method to apply a new locale to Kanban only. To reset Kanban to the default locale, call the `setLocale()` method without arguments (or with a *null* value). Use the [`toolbar.setLocale()`](api/methods/toolbar_setlocale_method.md) method to apply a new locale to Toolbar only.
2626
:::
2727

2828
### Example
@@ -39,6 +39,6 @@ board.setLocale(de);
3939
board.setLocale(); // or board.setLocale(null);
4040
~~~
4141

42-
**Chande log:** The method was updated in v1.2
42+
**Change log:** The method was updated in v1.2
4343

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

docs/api/methods/toolbar_setlocale_method.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ description: You can learn about the setLocale method of Toolbar in the document
1313
### Usage
1414

1515
~~~jsx {}
16-
setLocale(locale?: object, api?: object): void;
16+
setLocale(null | locale?: object): void;
1717
~~~
1818

1919
### Parameters
2020

21-
- `locale` - (optional) an object of the locale to be applied to the Toolbar of Kanban
22-
- `api` - (optional) an object with the internal API of Kanban
21+
- `null` - (optional) resets Toolbar to the default locale (*English*)
22+
- `locale` - (optional) the object of new locale data to be applied to the Toolbar
2323

2424
:::info
25-
The **Toolbar** of Kanban is a separate component. Before changing its locale, be sure that you have already applied the [`setLocale()`](api/methods/toolbar_setlocale_method.md) method to the **Kanban** component
25+
The **Toolbar** of Kanban is a separate component. Use the `toolbar.setLocale()` method to apply a new locale to Toolbar only. To reset Toolbar to the default locale, call the `toolbar.setLocale()` method without arguments (or with a *null* value). Use the [`kanban.setLocale()`](api/methods/js_kanban_setlocale_method.md) method to apply a new locale to Kanban only.
2626
:::
2727

2828
### Example
@@ -35,9 +35,9 @@ const toolbar = new kanban.Toolbar("#toolbar", { api: board.api });
3535
// apply the "de" locale to Kanban
3636
board.setLocale(de);
3737
// apply the "de" locale to the Toolbar
38-
toolbar.setLocale(de, board.api);
38+
toolbar.setLocale(de);
3939
~~~
4040

41-
**Chande log:** The **api** parameter was added in v1.5.7
41+
**Change log:** The **api** parameter was deprecated in v1.6
4242

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

docs/guides/localization.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const en = {
3232
"Add new row": "Add new row",
3333
"Add new column": "Add new column",
3434
"Add new card": "Add new card",
35+
"Add new card...": "Add new card...",
3536
"Edit card": "Edit card",
3637
Edit: "Edit",
3738

@@ -76,7 +77,7 @@ const en = {
7677
"Would you like to delete this comment?":
7778
"Would you like to delete this comment?",
7879
"Would you like to delete this card?":
79-
"Would you like to delete this card?",
80+
"Would you like to delete this card?"
8081
},
8182
calendar: { // translations and settings of the calendar
8283
monthFull: [

docs/news/whats_new.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ Released on November 13, 2024
5454
- The method doesn't change themes (use the new [`setTheme()`](../../api/methods/js_kanban_settheme_method) method instead)
5555
- The method doesn't destroy Kanban datastore. You don't need to recreate event listeners and reattach Toolbar to Kanban
5656

57+
- The [`setLocale()`](../../api/methods/js_kanban_setlocale_method) method doesn't destroy Kanban datastore. You don't need to recreate event listeners and reattach Toolbar to Kanban
58+
- The `api` parameter of the Toolbar [`setLocale()`](../../api/methods/toolbar_setlocale_method) method was deprecated
59+
5760
### Fixes
5861

5962
- A comment in progress of editing can be removed and text area for new comments disappears

0 commit comments

Comments
 (0)