Medium-editor: Translation function

Created on 30 Sep 2015  路  6Comments  路  Source: yabwe/medium-editor

Hi, I am working for an digital rights NGO in S.Korea and currently working on timeline maker 'Taogi' which uses your medium-editor. Thank you for this beautiful editor, by the way :)

As a non-English speaker, I need a translation function so that Korean users can read instructions like "Paste or type a link" in our own language

Would you kindly consider to add some translation function like creating po and mo files?

enhancement question

All 6 comments

This could definitively be a great addition. It isn't planned at the moment.

@j0k3r Are you looking for something like this http://ckeditor.com/demo#localization .

If you check demo, you will see there is a option to select language above editor. May be medium-editor needs to set language in code instead of giving option to user for changing language.

@anilmaurya I've checked anything at the moment. But it could be an option yes

@j0k3r by option did you meant https://github.com/yabwe/medium-editor#mediumeditor-options ?

No, I mean it could be an idea to look at :)

@taiji202 as far as I can see in the code, it looks like the only places we have displayed text in the core editor are:

  • Text on the checkboxes for the anchor button
  • Tooltips & Aria attributes on the toolbar buttons

As it is today, you can change those to be whatever text you want by modifying the config you pass when initializing the editor:

Buttons

Both the tooltip and the aria attribute on buttons comes from the aria property for the button definitions. We support overriding any of those values by passing objects in the buttons array instead of strings:

var editor = new MediumEditor('.editable', {
    toolbar: {
        buttons: [
            {    name: 'bold',
                 aria: 'Translated Text For Bold'
            }, {
                 name: 'italic',
                 aria: 'Translated Text for Italic'
            }, ...
        ]
    }
});

Anchor Form

There are 3 different sets of text displayed in the anchor form, all of which can be customized when initializing the editor.

Look at the Anchor Form Options section of the options definitions. There, you can see how to override placeholderText, customClassOptionText, and targetCheckboxText.

Since all of these things are overridable, and we're only using them as placeholders with the expectation that people will customize them to be whatever they want, I don't think there's enough there to warrant having translations built into the editor.

If you find anything else that needs to be overridden, let us know and we can take a look to see if it is more impactful and would warrant built-in translations.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sPaCeMoNk3yIam picture sPaCeMoNk3yIam  路  5Comments

ctrlmaniac picture ctrlmaniac  路  6Comments

keligijus picture keligijus  路  4Comments

thatdoorsajar picture thatdoorsajar  路  7Comments

jorgedavila25 picture jorgedavila25  路  6Comments