Remove unnecessary bind call

This was creating, calling and throwing away a brand new bound function
on every single call to `gettext`. This is wasteful, as the original
function can be called directly in such a way that `this` is bound
correctly.
This commit is contained in:
Mark Florian 2019-05-17 11:29:38 +08:00
parent e9ed028472
commit 50910d501f

View file

@ -11,7 +11,7 @@ delete window.translations;
@param text The text to be translated
@returns {String} The translated text
*/
const gettext = text => locale.gettext.bind(locale)(ensureSingleLine(text));
const gettext = text => locale.gettext(ensureSingleLine(text));
/**
Translate the text with a number