From 1c1ba2ef0274bd93fa3e5c79dadaf7d9ca227adf Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 24 Oct 2013 09:37:54 +0000 Subject: [PATCH] strings for lastfm --- modules/lastfm/lastfm.js | 14 +++++++++++--- modules/lastfm/strings.json | 11 +++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 modules/lastfm/strings.json 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 :'(" + } +}