Quill: Localisation

Created on 3 Oct 2018  路  3Comments  路  Source: quilljs/quill

First, I would like to thank you for editor! It is great!

Steps for Reproduction

  1. Use editor
  2. Try to insert link
  3. If you are non-English speaker you see English text and this is what is defined by content via CSS

Expected behavior:

Ability to localize "Edit", "Remove", "Enter link:", etc.

I am not English speaker, project view varies on language which should change editors language as well. What you have now, is that I have to dynamically generate CSS to change content dynamically or generate custom templates for image, formulas, etc. And as I understand this is not the best practice based on this comment.

And anyways, why would I generate my custom templates if I like what you provide by default?

Is it possible to add documentation for how to generate the same logic for default link insertion via pop-ups as here?

As what I can find now is this, which is just prompt and very basic implementation from how it is in the editor itself.

I would like to see how it is handled in snow theme.

Actual behavior:
Limited ability to translate

Platforms: Ubuntu

Version: I use react-quill

Most helpful comment

I have to admit that it is a quite disappointing solution... It looks more like a hack than a real solution, plus I didn't find how to translate the toolbar this way using quill only. Indeed there is not a quill.toolbar.classList.add function. And omg, who wants to use a .css file to translate a library?

All 3 comments

Create localized strings for each lang:

.fr.ql-snow .ql-tooltip[data-mode="link"]::before {
    content: "Entrer le lien:";
}

Add CSS class in javascript when you want to change the lang:
quill.container.classList.add('fr');

https://codepen.io/anon/pen/KGzdxB

@benbro interesting approach. Is this really the way it is?

I have to admit that it is a quite disappointing solution... It looks more like a hack than a real solution, plus I didn't find how to translate the toolbar this way using quill only. Indeed there is not a quill.toolbar.classList.add function. And omg, who wants to use a .css file to translate a library?

Was this page helpful?
0 / 5 - 0 ratings