Skip to content

Conversation

pabzm
Copy link

@pabzm pabzm commented Aug 26, 2025

This is a non-breaking change that allows to pass in translations and a wanted language as parameters to EasyMDE() in order to translate the toolbar buttons' titles that show up as tooltips. The code uses a simple replace() call, so the translation keys must exactly match the default english strings (including letter case, white spaces, etc.) to have the translations be applied.

Example:

const easymde = new EasyMDE({
    language: 'de',
    translations: {
        de: {
            'Create Link': 'Link einfügen',
        },
    },
});

If no language or translation was specified, or if no matching translation was found, then the original english string is used.

This is a non-breaking change that allows to pass in `translations` and a wanted `language` as parameters to
`EasyMDE()` in order to translate the toolbar buttons' titles that show up as tooltips.
The code uses a simple `replace()` call, so the translation keys must exactly match the default english strings
(including letter case, white spaces, etc.) to have the translations be applied.

Example:

const easymde = new EasyMDE({
    language: 'de',
    translations: {
        de: {
            'Create Link': 'Link einfügen',
        },
    },
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant