Internationalization
Since version 2.18 Editor.js provides an API for Internationalization that allows localizing all UI texts of editor's core and plugins.
To enable your own localization you should pass a messages
dictionary with the i18n
option of Editor Config. This dictionary should contain four sections:
- ui
— translations of internal UI texts
- toolNames
— translations of names for tools you use.
- tools
— translations of UI texts for tools you use.
- blockTunes
— translations of Block Tunes you use.
At the ui
section there are translations for the internal editor.js UI elements. You can create or find/download a dictionary for your language.
As long as tools list is a user-specific thing (we do not know which tools you use and under which names), so we can't provide a ready-to-use tool names dictionary. There is a toolNames
section for that reason. Put translations for the names of your tools there.
Also, the UI of the tools you use is also invisible to editor.js core. To pass translations for specific tools (which supports I18n API), there are tools
and blockTunes
section. Pass dictionaries for specific plugins through them.
Editor.js also provides a support of right-to-left mode. It could be enabled by passing the direction
rule to the i18n
config.
In this mode all Texts will be directed with RTL and all the UI elements orders will be mirrored as well as arrow navigation rules.