konstantinmuenster / strapi-plugin-rich-text

A WYSIWYG editor for your rich text fields
MIT License
9 stars 4 forks source link

chore: #2 adding localization to the editor #15

Open SalahAdDin opened 4 months ago

SalahAdDin commented 4 months ago

What does it do?

It implements string literals for localization.

Why is it needed?

Content managers can speak any language other than English.

How to test it?

Change the preferred adding language on the profile screen, go to the rich text content screen and check the toolbar tooltips. image

Notes

I was unable to make the Revert/Insert Link button work properly: image

I defined the literal properly following the documentation: "editor.dialog.button.link-confirm": "{action, select, Remove {Eliminar Enlace} Insert {Insertar Enlace}}", Here is the function using it, following the documentation:

          <Button
            onClick={() => onInsertLink()}
            variant={shouldRemove ? "danger-light" : "success-light"}
          >
            {formatMessage(
              {
                id: "editor.dialog.button.link-confirm",
                defaultMessage: "{action} Link",
              },
              {
                action: shouldRemove ? "Remove" : "Insert",
              }
            )}
          </Button>

But, as you can see, it does not work.

SalahAdDin commented 2 months ago

Closes: https://github.com/konstantinmuenster/strapi-plugin-rich-text/issues/10