diff --git a/modules/lastfm/lastfm.js b/modules/lastfm/lastfm.js index 2b4c99d..10f3733 100644 --- a/modules/lastfm/lastfm.js +++ b/modules/lastfm/lastfm.js @@ -30,12 +30,20 @@ var lastfm = function(dbot) { } else if(_.has(body, 'recenttracks') && !_.isUndefined(body.recenttracks.track[0])) { var track = body.recenttracks.track[0]; if(_.has(track, '@attr') && _.has(track['@attr'], 'nowplaying') && track['@attr'].nowplaying == 'true') { - event.reply(event.user + ' is listening to ' + track.name + ' by ' + track.artist['#text']); + event.reply(dbot.t('now_listening', { + 'user': event.user, + 'track': track.name, + 'artist': track.artist['#text'] + })); } else { - event.reply(event.user + ' last listened to ' + track.name + ' by ' + track.artist['#text']); + event.reply(dbot.t('last_listened', { + 'user': event.user, + 'track': track.name, + 'artist': track.artist['#text'] + })); } } else { - event.reply(event.user + ' isn\'t listening to anything right now :\'('); + event.reply(dbot.t('no_listen', { 'user': event.user })); } }); } else { diff --git a/modules/lastfm/strings.json b/modules/lastfm/strings.json new file mode 100644 index 0000000..962d84b --- /dev/null +++ b/modules/lastfm/strings.json @@ -0,0 +1,11 @@ +{ + "now_listening": { + "en": "{user} is listening to {track} by {artist}" + }, + "last_listened": { + "en": "{user} last listened to {track} by {artist}" + }, + "no_listen": { + "en": "{user} doesn't seem to have listened to anything recently :'(" + } +}