xdamman / selection-sharer

Medium like popover menu to share on Twitter or by email any text selected on the page
MIT License
509 stars 104 forks source link

Text translations #61

Open philippze opened 6 years ago

philippze commented 6 years ago

I would like to make the selection sharer translatable. Do you have any preferences about how this sould be done?

I actually need this feature for Drupal, where we must wrap the strings into the function Drupal.t().

To make the feature available also for other environments, I would suggest something like this:

if (typeof(selection_sharer_gettext) === 'undefined') {
    var selection_sharer_gettext = function (string) {
        return string;
    };
}

So, everyone using a translation framework can wrap it into this function.