Quill: How to localize the link tooltip in the Snow theme

Created on 14 Dec 2016  路  4Comments  路  Source: quilljs/quill

I'm trying to localize the English strings that show when you create or edit a link with the snow toolbar, but haven't gotten any traction.

This comment suggests that the entire template can be replaced, but I haven't found any documentation of that in the docs, nor do I know if the two year old comment is still applicable to v1.

Version: 1.0.0

Most helpful comment

@jhchen could you please show an example how to set custom link pop-up template so I can inject translations directly there?

Or at least show how to repro this:

image

and this with custom template:

image

I am having project, where editor should be displayed per language. The CSS content isn't the best choice in this case.

All 4 comments

The link tooltip string is defined here.
You can override it with css:

.ql-snow .ql-tooltip[data-mode="link"]::before {
    content: "Your custom string here:";
}

Is there no way to localize the tooltip with JS? Using CSS for localization seems a bit awkward.

The linked comment was made during v0.20 when exposing said template was still being considered but that idea did not survive to 1.0. There's a great difficulty with UI APIs since they are very error prone on different browser environments and everyone wants something slightly different. With React, Angular, etc the future of UI does not appear to be with runtime template strings so the suggestion would be either just use CSS or add your own tooltip.

@jhchen could you please show an example how to set custom link pop-up template so I can inject translations directly there?

Or at least show how to repro this:

image

and this with custom template:

image

I am having project, where editor should be displayed per language. The CSS content isn't the best choice in this case.

Was this page helpful?
0 / 5 - 0 ratings