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 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", 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