arikchakma / maily.to

Craft beautiful emails effortlessly with Maily, the powerful email editor that ensures impeccable communication across all major clients.
https://maily.to
MIT License
1.44k stars 74 forks source link

Support for i18n #33

Closed BigDog1400 closed 3 months ago

BigDog1400 commented 8 months ago

The current version of this library only supports English text. I can think of different application that might need to change the text to different langs (es,en,pt, etc). What do you think about providing the library with translation? It could be a prop to the editor instance and then internally get the translations from a JSON file. What are your thoughts on this proposed enhancement?

arikchakma commented 8 months ago

Like support for different languages? or for slash command text and everything else?

arikchakma commented 8 months ago

I think first we need to add RTL support I think, it's really important. What do you think?

BigDog1400 commented 8 months ago

I think that those are different things, both valid. My initial issue was raised considering the built-in components of the library (translating elements like slash command options, placeholders, popovers, etc.). Implementing this would mainly involve modifying the existing editor components.

On the other hand, adding RTL support would need updates to both the editor and the render package.

I am more than willing to assist with the first part, which is adding support for translations. Let me know if you want me to make a proposal for this feature

arikchakma commented 8 months ago

Yeah, we can do that. Let's go for it. I'll think about the RTL whenever I get some time.

BigDog1400 commented 7 months ago

Here is my first proposal to handle the i18n in this package https://github.com/arikchakma/maily.to/pull/34 . I usually use react-intl to handle translations in others projects, but that package relies on context and hooks, and we can't use that in a lot of places in this case. so i went with react-intl-universal which is a fork of react-intl mantained by alibaba and has the flexibility of using translations outside of react. Let me know what you think, right now there is only two langs translated, english and spanish. Also we could add a lang selector in the demo app to see how the editor changes the translations.