From da9b6af23a8cdf23b4fcb70f20a0c5a1a96e90de Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Thu, 27 Feb 2025 18:37:58 +0300 Subject: [PATCH 1/3] imp(example): add example of localisation --- playground/index.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/playground/index.html b/playground/index.html index c33e7015..799a9f09 100644 --- a/playground/index.html +++ b/playground/index.html @@ -104,6 +104,25 @@ } }, }, + /** + * Example of the lacalisation dictionary + */ + i18n: { + messages: { + "toolNames": { + "Ordered List": "Nummerierte Liste", + "Unordered List": "Unnummeriert Liste", + "Checklist": "Checkliste", + }, + "tools": { + "List": { + 'Unordered': 'Unnummeriert', + 'Ordered': 'Nummerierte', + 'Checklist': 'Checkliste', + } + }, + }, + }, /** * This Tool will be used as default From ae98f8fed4e8c2339700144fff2f4f2893e66f79 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Thu, 27 Feb 2025 18:38:13 +0300 Subject: [PATCH 2/3] imp(readme): add example of localisation --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 15e58564..ca744ff9 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,35 @@ Object `ItemMeta` for Ordered list Object `ItemMeta` for Unordered list would be empty. +## Localisation +If you want to use your language for toolbox items, you can pass i18n dictionary to the editorjs instance below the tools `block`: +```javascript +i18n: { + messages: { + "toolNames": { + "Ordered List": "Nummerierte Liste", + "Unordered List": "Unnummeriert Liste", + "Checklist": "Checkliste", + }, + "tools": { + "List": { + 'Unordered': 'Unnummeriert', + 'Ordered': 'Nummerierte', + 'Checklist': 'Checkliste', + } + }, + }, +}, +``` + +### Other supported keys for `tools.List` +- `Start with` +- `Counter type` +- `Numeric` +- `Lower Roman` +- `Upper Roman` +- `Lower Alpha` +- `Upper Alpha` ## Example of the content for `Unordered List` ```json From 2efbc18e49b74a9c7702657a1a7f4779dae68a6e Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Thu, 27 Feb 2025 18:59:52 +0300 Subject: [PATCH 3/3] chore(): bump package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6bcb7eee..aa5ca2a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@editorjs/list", - "version": "2.0.4", + "version": "2.0.5", "keywords": [ "codex editor", "list",