You need to import `l10n` and do

    var gettext = l10n.gettext;