Compliant with all XBMC addon requirements.
[clinton/xbmc-groove.git] / default.py
index ff6d2bd..f747929 100644 (file)
@@ -1,4 +1,30 @@
+# Copyright 2011 Stephen Denham
+
+#    This file is part of xbmc-groove.
+#
+#    xbmc-groove is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    xbmc-groove is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with xbmc-groove.  If not, see <http://www.gnu.org/licenses/>.
+
+
 import urllib, sys, os, shutil, re, pickle, time, tempfile, xbmcaddon, xbmcplugin, xbmcgui, xbmc
+
+__addon__     = xbmcaddon.Addon()
+__addonname__ = __addon__.getAddonInfo('name')
+__cwd__       = __addon__.getAddonInfo('path')
+__author__    = __addon__.getAddonInfo('author')
+__version__   = __addon__.getAddonInfo('version')
+__language__  = __addon__.getLocalizedString
+
 MODE_SEARCH_SONGS = 1
 MODE_SEARCH_ALBUMS = 2
 MODE_SEARCH_ARTISTS = 3
@@ -41,20 +67,20 @@ songMarkTime = 0
 player = xbmc.Player()
 playTimer = None
 
-baseDir = os.getcwd()
+baseDir = __cwd__
 resDir = xbmc.translatePath(os.path.join(baseDir, 'resources'))
 libDir = xbmc.translatePath(os.path.join(resDir,  'lib'))
 imgDir = xbmc.translatePath(os.path.join(resDir,  'img'))
-cacheDir = os.path.join(xbmc.translatePath('special://masterprofile/addon_data/'), os.path.basename(os.getcwd()))
+cacheDir = os.path.join(xbmc.translatePath('special://masterprofile/addon_data/'), os.path.basename(baseDir))
 thumbDirName = 'thumb'
-thumbDir = os.path.join('special://masterprofile/addon_data/', os.path.basename(os.getcwd()), thumbDirName)
+thumbDir = os.path.join('special://masterprofile/addon_data/', os.path.basename(baseDir), thumbDirName)
 
 baseModeUrl = 'plugin://plugin.audio.groove/'
 playlistUrl = baseModeUrl + '?mode=' + str(MODE_PLAYLIST)
 playlistsUrl = baseModeUrl + '?mode=' + str(MODE_PLAYLISTS)
 favoritesUrl = baseModeUrl + '?mode=' + str(MODE_FAVORITES)
 
-searchArtistsAlbumsName = "Search for artist's albums..."
+searchArtistsAlbumsName = xbmc.getLocalizedString(30006)
 
 thumbDef = os.path.join(imgDir, 'default.tbn')
 listBackground = os.path.join(imgDir, 'listbackground.png')
@@ -66,10 +92,10 @@ from threading import Event, Thread
 try:
     groovesharkApi = GrooveAPI()
     if groovesharkApi.pingService() != True:
-        raise StandardError('No Grooveshark service')
+        raise StandardError(xbmc.getLocalizedString(30007))
 except:
-    dialog = xbmcgui.Dialog()
-    dialog.ok('Grooveshark XBMC', 'Unable to connect with Grooveshark.', 'Please try again later')
+    dialog = xbmcgui.Dialog(xbmc.getLocalizedString(30008),xbmc.getLocalizedString(30009),xbmc.getLocalizedString(30010))
+    dialog.ok()
     sys.exit(-1)
   
 # Mark song as playing or played
@@ -118,7 +144,7 @@ class GroovesharkPlaylistSelect(xbmcgui.WindowDialog):
         listitems = []
         for playlist in items:
             listitems.append(xbmcgui.ListItem(playlist[0]))
-        listitems.append(xbmcgui.ListItem('New...'))
+        listitems.append(xbmcgui.ListItem(xbmc.getLocalizedString(30011)))
         self.playlistControl.addItems(listitems)
         self.setFocus(self.playlistControl)
         self.playlistControl.selectItem(0)
@@ -220,11 +246,11 @@ class Groveshark:
         self._handle = int(sys.argv[1])
         if os.path.isdir(cacheDir) == False:
             os.makedirs(cacheDir)
-            xbmc.log("Made " + cacheDir)
+            xbmc.log(xbmc.getLocalizedString(30012) + " " + cacheDir)
         artDir = xbmc.translatePath(thumbDir)
         if os.path.isdir(artDir) == False:
             os.makedirs(artDir)
-            xbmc.log("Made " + artDir)
+            xbmc.log(xbmc.getLocalizedString(30012) + " " + artDir)
             
     # Top-level menu
     def categories(self):
@@ -234,70 +260,70 @@ class Groveshark:
         # Setup
         xbmcplugin.setPluginFanart(int(sys.argv[1]), self.fanImg)
         
-        self._add_dir('Search for songs...', '', MODE_SEARCH_SONGS, self.songImg, 0)
-        self._add_dir('Search for albums...', '', MODE_SEARCH_ALBUMS, self.albumImg, 0)
-        self._add_dir('Search for artists...', '', MODE_SEARCH_ARTISTS, self.artistImg, 0)
+        self._add_dir(xbmc.getLocalizedString(30013), '', MODE_SEARCH_SONGS, self.songImg, 0)
+        self._add_dir(xbmc.getLocalizedString(30014), '', MODE_SEARCH_ALBUMS, self.albumImg, 0)
+        self._add_dir(xbmc.getLocalizedString(30015), '', MODE_SEARCH_ARTISTS, self.artistImg, 0)
         self._add_dir(searchArtistsAlbumsName, '', MODE_SEARCH_ARTISTS_ALBUMS, self.artistsAlbumsImg, 0)
         # Not supported by key
         #self._add_dir("Search for user's playlists...", '', MODE_SEARCH_PLAYLISTS, self.usersplaylistsImg, 0)
-        self._add_dir('Popular Grooveshark songs for artist...', '', MODE_ARTIST_POPULAR, self.popularSongsArtistImg, 0)
-        self._add_dir('Popular Grooveshark songs', '', MODE_POPULAR_SONGS, self.popularSongsImg, 0)
+        self._add_dir(xbmc.getLocalizedString(30016), '', MODE_ARTIST_POPULAR, self.popularSongsArtistImg, 0)
+        self._add_dir(xbmc.getLocalizedString(30017), '', MODE_POPULAR_SONGS, self.popularSongsImg, 0)
         if (self.userid != 0):
-            self._add_dir('My Grooveshark favorites', '', MODE_FAVORITES, self.favoritesImg, 0)
-            self._add_dir('My Grooveshark playlists', '', MODE_PLAYLISTS, self.playlistImg, 0)
+            self._add_dir(xbmc.getLocalizedString(30018), '', MODE_FAVORITES, self.favoritesImg, 0)
+            self._add_dir(xbmc.getLocalizedString(30019), '', MODE_PLAYLISTS, self.playlistImg, 0)
 
     # Search for songs            
     def searchSongs(self):
-        query = self._get_keyboard(default="", heading='Search for songs powered by Grooveshark')
+        query = self._get_keyboard(default="", heading=xbmc.getLocalizedString(30020))
         if (query != ''):
             songs = groovesharkApi.getSongSearchResults(query, limit = self.songsearchlimit)
             if (len(songs) > 0):
                 self._add_songs_directory(songs)
             else:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'No matching songs.')
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30021))
                 self.categories()
         else:
             self.categories()
     
     # Search for albums
     def searchAlbums(self):
-        query = self._get_keyboard(default="", heading='Search for albums powered by Grooveshark')
+        query = self._get_keyboard(default="", heading=xbmc.getLocalizedString(30022))
         if (query != ''): 
             albums = groovesharkApi.getAlbumSearchResults(query, limit = self.albumsearchlimit)
             if (len(albums) > 0):
                 self._add_albums_directory(albums)
             else:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'No matching albums.')
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30023))
                 self.categories()
         else:
             self.categories()
     
     # Search for artists
     def searchArtists(self):
-        query = self._get_keyboard(default="", heading='Search for artists powered by Grooveshark')
+        query = self._get_keyboard(default="", heading=xbmc.getLocalizedString(30024))
         if (query != ''): 
             artists = groovesharkApi.getArtistSearchResults(query, limit = self.artistsearchlimit)
             if (len(artists) > 0):
                 self._add_artists_directory(artists)
             else:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'No matching artists.')
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30025))
                 self.categories()
         else:
             self.categories()
 
     # Search for playlists
     def searchPlaylists(self):
-        query = self._get_keyboard(default="", heading="Username")
+        query = self._get_keyboard(default="", heading=xbmc.getLocalizedString(30026))
         if (query != ''): 
             playlists = groovesharkApi.getUserPlaylistsByUsername(query)
             if (len(playlists) > 0):
                 self._add_playlists_directory(playlists)
             else:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'No Grooveshark playlists found.')
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30027))
                 self.categories()
         else:
             self.categories()
@@ -305,7 +331,7 @@ class Groveshark:
     # Search for artists albums
     def searchArtistsAlbums(self, artistName = None):
         if artistName == None or artistName == searchArtistsAlbumsName:
-            query = self._get_keyboard(default="", heading="Search for artist's albums powered by Grooveshark")
+            query = self._get_keyboard(default="", heading=xbmc.getLocalizedString(30028))
         else:
             query = artistName
         if (query != ''): 
@@ -319,11 +345,11 @@ class Groveshark:
                     self._add_albums_directory(albums, artistID)
                 else:
                     dialog = xbmcgui.Dialog()
-                    dialog.ok('Grooveshark XBMC', 'No matching albums.')
+                    dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30029))
                     self.categories()
             else:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'No matching artists.')
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30030))
                 self.categories()
         else:
             self.categories()
@@ -337,7 +363,7 @@ class Groveshark:
                 self._add_songs_directory(favorites, isFavorites=True)
             else:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'You have no favorites.')
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30031))
                 self.categories()
     
     # Get popular songs
@@ -347,7 +373,7 @@ class Groveshark:
             self._add_songs_directory(popular)
         else:
             dialog = xbmcgui.Dialog()
-            dialog.ok('Grooveshark XBMC', 'No popular songs.')
+            dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30032))
             self.categories()
 
     # Get my playlists             
@@ -359,11 +385,11 @@ class Groveshark:
                 self._add_playlists_directory(playlists)
             else:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'You have no Grooveshark playlists.')
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30033))
                 self.categories()
         else:
             dialog = xbmcgui.Dialog()
-            dialog.ok('Grooveshark XBMC', 'You must be logged in ', ' to see your Grooveshark playlists.')
+            dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30034), xbmc.getLocalizedString(30035))
                 
     # Make songs a favorite 
     def favorite(self, songid):
@@ -371,10 +397,10 @@ class Groveshark:
         if (userid != 0):
             xbmc.log("Favorite song: " + str(songid))
             groovesharkApi.addUserFavoriteSong(songID = songid)
-            xbmc.executebuiltin('XBMC.Notification(Grooveshark XBMC, Added to favorites, 1000, ' + thumbDef + ')')
+            xbmc.executebuiltin('XBMC.Notification(' + xbmc.getLocalizedString(30008) + ', ' + xbmc.getLocalizedString(30036) + ', 1000, ' + thumbDef + ')')
         else:
             dialog = xbmcgui.Dialog()
-            dialog.ok('Grooveshark XBMC', 'You must be logged in', 'to add favorites.')
+            dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30034), xbmc.getLocalizedString(30037))
             
     # Remove song from favorites
     def unfavorite(self, songid, prevMode=0):
@@ -382,13 +408,13 @@ class Groveshark:
         if (userid != 0):
             xbmc.log("Unfavorite song: " + str(songid) + ', previous mode was ' + str(prevMode))
             groovesharkApi.removeUserFavoriteSongs(songIDs = songid)
-            xbmc.executebuiltin('XBMC.Notification(Grooveshark XBMC, Removed from Grooveshark favorites, 1000, ' + thumbDef + ')')
+            xbmc.executebuiltin('XBMC.Notification(' + xbmc.getLocalizedString(30008) + ', ' + xbmc.getLocalizedString(30038) + ', 1000, ' + thumbDef + ')')
             # Refresh to remove item from directory
             if (int(prevMode) == MODE_FAVORITES):
                 xbmc.executebuiltin("Container.Refresh(" + favoritesUrl + ")")
         else:
             dialog = xbmcgui.Dialog()
-            dialog.ok('Grooveshark XBMC', 'You must be logged in', 'to remove Grooveshark favorites.')
+            dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30034), xbmc.getLocalizedString(30039))
             
 
     # Show selected album
@@ -409,11 +435,11 @@ class Groveshark:
             self._add_songs_directory(songs, trackLabelFormat=NAME_ALBUM_ARTIST_LABEL, playlistid=playlistid, playlistname=playlistname)
         else:
             dialog = xbmcgui.Dialog()
-            dialog.ok('Grooveshark XBMC', 'You must be logged in', 'to get Grooveshark playlists.')
+            dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30034), xbmc.getLocalizedString(30040))
             
     # Show popular songs of the artist
     def artistPopularSongs(self):
-        query = self._get_keyboard(default="", heading="Artist")
+        query = self._get_keyboard(default="", heading=xbmc.getLocalizedString(30041))
         if (query != ''): 
             artists = groovesharkApi.getArtistSearchResults(query, limit = self.artistsearchlimit)
             if (len(artists) > 0):
@@ -425,11 +451,11 @@ class Groveshark:
                     self._add_songs_directory(songs, trackLabelFormat=NAME_ALBUM_ARTIST_LABEL)
                 else:
                     dialog = xbmcgui.Dialog()
-                    dialog.ok('Grooveshark XBMC', 'No popular songs.')
+                    dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30042))
                     self.categories()
             else:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'No matching artists.')
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30043))
                 self.categories()
         else:
             self.categories()
@@ -461,7 +487,7 @@ class Groveshark:
                 time.sleep(1)
                 seconds = seconds + 1
         else:
-            xbmc.executebuiltin('XBMC.Notification(Grooveshark XBMC, Unable to play song, 1000, ' + thumbDef + ')')
+            xbmc.executebuiltin('XBMC.Notification(' + xbmc.getLocalizedString(30008) + ', ' + xbmc.getLocalizedString(30044) + ', 1000, ' + thumbDef + ')')
         
     # Make a song directory item
     def songItem(self, songid, name, album, artist, coverart, trackLabelFormat=ARTIST_ALBUM_NAME_LABEL):
@@ -494,7 +520,7 @@ class Groveshark:
         if (userid != 0):
             re.split(' - ',name,1)
             nameTokens = re.split(' - ',name,1) # suggested name
-            name = self._get_keyboard(default=nameTokens[0], heading="Grooveshark playlist name")
+            name = self._get_keyboard(default=nameTokens[0], heading=xbmc.getLocalizedString(30045))
             if name != '':
                 album = groovesharkApi.getAlbumSongs(albumid, limit = self.songsearchlimit)
                 songids = []
@@ -502,45 +528,45 @@ class Groveshark:
                     songids.append(song[1])
                 if groovesharkApi.createPlaylist(name, songids) == 0:
                     dialog = xbmcgui.Dialog()
-                    dialog.ok('Grooveshark XBMC', 'Cannot create Grooveshark playlist ', name)
+                    dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30046), name)
                 else:
-                    xbmc.executebuiltin('XBMC.Notification(Grooveshark XBMC, Grooveshark playlist created, 1000, ' + thumbDef + ')')
+                    xbmc.executebuiltin('XBMC.Notification(' + xbmc.getLocalizedString(30008) + ',' + xbmc.getLocalizedString(30047)+ ', 1000, ' + thumbDef + ')')
         else:
             dialog = xbmcgui.Dialog()
-            dialog.ok('Grooveshark XBMC', 'You must be logged in ', ' to create a Grooveshark playlist.')
+            dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30034), xbmc.getLocalizedString(30048))
     
     # Rename a playlist
     def renamePlaylist(self, playlistid, name):
         userid = self._get_login()
         if (userid != 0):
-            newname = self._get_keyboard(default=name, heading="Grooveshark playlist name")
+            newname = self._get_keyboard(default=name, heading=xbmc.getLocalizedString(30049))
             if newname == '':
                 return
             elif groovesharkApi.playlistRename(playlistid, newname) == 0:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'Cannot rename Grooveshark playlist ', name)
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30050), name)
             else:
                 # Refresh to show new item name
                 xbmc.executebuiltin("Container.Refresh")
         else:
             dialog = xbmcgui.Dialog()
-            dialog.ok('Grooveshark XBMC', 'You must be logged in ', ' to rename a Grooveshark playlist.')
+            dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30034), xbmc.getLocalizedString(30051))
         
     # Remove a playlist
     def removePlaylist(self, playlistid, name):
         dialog = xbmcgui.Dialog()
-        if dialog.yesno('Grooveshark XBMC', name, 'Delete this Grooveshark playlist?') == True:
+        if dialog.yesno(xbmc.getLocalizedString(30008), name, xbmc.getLocalizedString(30052)) == True:
             userid = self._get_login()
             if (userid != 0):
                 if groovesharkApi.playlistDelete(playlistid) == 0:
                     dialog = xbmcgui.Dialog()
-                    dialog.ok('Grooveshark XBMC', 'Cannot remove Grooveshark playlist ', name)
+                    dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30053), name)
                 else:
                     # Refresh to remove item from directory
                     xbmc.executebuiltin("Container.Refresh(" + playlistsUrl + ")")
             else:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'You must be logged in ', ' to delete a Grooveshark playlist.')
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30034), xbmc.getLocalizedString(30054))
 
     # Add song to playlist
     def addPlaylistSong(self, songid):
@@ -558,15 +584,15 @@ class Groveshark:
                 if i > -1:
                     # Add a new playlist
                     if i >= len(playlists):
-                        name = self._get_keyboard(default='', heading="Grooveshark playlist name")
+                        name = self._get_keyboard(default='', heading=xbmc.getLocalizedString(30055))
                         if name != '':
                             songIds = []
                             songIds.append(songid)
                             if groovesharkApi.createPlaylist(name, songIds) == 0:
                                 dialog = xbmcgui.Dialog()
-                                dialog.ok('Grooveshark XBMC', 'Cannot create Grooveshark playlist ', name)
+                                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30056), name)
                             else:
-                                xbmc.executebuiltin('XBMC.Notification(Grooveshark XBMC, Grooveshark playlist created, 1000, ' + thumbDef + ')')
+                                xbmc.executebuiltin('XBMC.Notification(' + xbmc.getLocalizedString(30008) + ',' + xbmc.getLocalizedString(30057) + ', 1000, ' + thumbDef + ')')
                     # Existing playlist
                     else:
                         playlist = playlists[i]
@@ -580,21 +606,21 @@ class Groveshark:
                         ret = groovesharkApi.setPlaylistSongs(playlistid, songIDs)
                         if ret == False:
                             dialog = xbmcgui.Dialog()
-                            dialog.ok('Grooveshark XBMC', 'Cannot add to playlist ')
+                            dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30058))
                         else:    
-                            xbmc.executebuiltin('XBMC.Notification(Grooveshark XBMC, Added song to Grooveshark playlist, 1000, ' + thumbDef + ')')
+                            xbmc.executebuiltin('XBMC.Notification(' + xbmc.getLocalizedString(30008) + ',' + xbmc.getLocalizedString(30059) + ', 1000, ' + thumbDef + ')')
             else:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'You have no Grooveshark playlists.')
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30060))
                 self.categories()
         else:
             dialog = xbmcgui.Dialog()
-            dialog.ok('Grooveshark XBMC', 'You must be logged in', 'to add a song to a Grooveshark playlist.')
+            dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30034), xbmc.getLocalizedString(30061))
 
     # Remove song from playlist
     def removePlaylistSong(self, playlistid, playlistname, songid):
         dialog = xbmcgui.Dialog()
-        if dialog.yesno('Grooveshark XBMC', 'Delete this song from', 'the Grooveshark playlist?') == True:
+        if dialog.yesno(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30062), xbmc.getLocalizedString(30063)) == True:
             userid = self._get_login()
             if (userid != 0):
                 songs = groovesharkApi.getPlaylistSongs(playlistID)
@@ -605,14 +631,14 @@ class Groveshark:
                 ret = groovesharkApi.setPlaylistSongs(playlistID, songIDs)
                 if ret == False:
                     dialog = xbmcgui.Dialog()
-                    dialog.ok('Grooveshark XBMC', 'Failed to remove', 'song from Grooveshark playlist.')
+                    dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30064), xbmc.getLocalizedString(30065))
                 else:
                     # Refresh to remove item from directory
-                    xbmc.executebuiltin('XBMC.Notification(Grooveshark XBMC, Removed song from Grooveshark playlist, 1000, ' + thumbDef + ')')
+                    xbmc.executebuiltin('XBMC.Notification(' + xbmc.getLocalizedString(30008) + ',' + xbmc.getLocalizedString(30066)+ ', 1000, ' + thumbDef + ')')
                     xbmc.executebuiltin("Container.Update(" + playlistUrl + "&id="+str(playlistid) + "&name=" + playlistname + ")")
             else:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'You must be logged in', 'to delete a song from a Grooveshark playlist.')
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30034), xbmc.getLocalizedString(30067))
       
     # Find similar artists to searched artist
     def similarArtists(self, artistId):
@@ -621,7 +647,7 @@ class Groveshark:
             self._add_artists_directory(similar)
         else:
             dialog = xbmcgui.Dialog()
-            dialog.ok('Grooveshark XBMC', 'No similar artists.')
+            dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30068))
             self.categories()
         
     # Get keyboard input
@@ -636,7 +662,7 @@ class Groveshark:
     def _get_login(self):
         if (self.username == "" or self.password == ""):
             dialog = xbmcgui.Dialog()
-            dialog.ok('Grooveshark XBMC', 'Unable to login.', 'Check username and password in settings.')
+            dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30069), xbmc.getLocalizedString(30070))
             return 0
         else:
             if self.userid == 0:
@@ -645,7 +671,7 @@ class Groveshark:
                 return uid
             else:
                 dialog = xbmcgui.Dialog()
-                dialog.ok('Grooveshark XBMC', 'Unable to login.', 'Check username and password in settings.')
+                dialog.ok(xbmc.getLocalizedString(30008), xbmc.getLocalizedString(30069), xbmc.getLocalizedString(30070))
                 return 0
     
     # Get a song directory item
@@ -714,14 +740,14 @@ class Groveshark:
             if isFavorites == True:
                 unfav = unfav +str(MODE_FAVORITES)
             else:
-                menuItems.append(("Grooveshark favorite", "XBMC.RunPlugin("+fav+")"))
-            menuItems.append(("Not Grooveshark favorite", "XBMC.RunPlugin("+unfav+")"))
+                menuItems.append((xbmc.getLocalizedString(30071), "XBMC.RunPlugin("+fav+")"))
+            menuItems.append((xbmc.getLocalizedString(30072), "XBMC.RunPlugin("+unfav+")"))
             if playlistid > 0:
                 rmplaylstsong=sys.argv[0]+"?playlistid="+str(playlistid)+"&id="+str(songid)+"&mode="+str(MODE_REMOVE_PLAYLIST_SONG)+"&name="+playlistname
-                menuItems.append(("Remove from Grooveshark playlist", "XBMC.RunPlugin("+rmplaylstsong+")"))
+                menuItems.append((xbmc.getLocalizedString(30073), "XBMC.RunPlugin("+rmplaylstsong+")"))
             else:
                 addplaylstsong=sys.argv[0]+"?id="+str(songid)+"&mode="+str(MODE_ADD_PLAYLIST_SONG)
-                menuItems.append(("Add to Grooveshark playlist", "XBMC.RunPlugin("+addplaylstsong+")"))
+                menuItems.append((xbmc.getLocalizedString(30074), "XBMC.RunPlugin("+addplaylstsong+")"))
             item.addContextMenuItems(menuItems, replaceItems=False)
             xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=item,isFolder=False, totalItems=len(songs))
             id = id + 1
@@ -729,7 +755,7 @@ class Groveshark:
         page = page + 1
         if totalSongs > page * self.songspagelimit:
             u=sys.argv[0]+"?mode="+str(MODE_SONG_PAGE)+"&id=playlistid"+"&page="+str(page)+"&label="+str(trackLabelFormat)+"&name="+playlistname
-            self._add_dir('More songs...', u, MODE_SONG_PAGE, self.songImg, 0, totalSongs - (page * self.songspagelimit))
+            self._add_dir(xbmc.getLocalizedString(30075) + '...', u, MODE_SONG_PAGE, self.songImg, 0, totalSongs - (page * self.songspagelimit))
 
         xbmcplugin.setContent(self._handle, 'songs')
         xbmcplugin.setPluginFanart(int(sys.argv[1]), self.fanImg)
@@ -798,13 +824,13 @@ class Groveshark:
         menuItems = []
         if mode == MODE_ALBUM:
             mkplaylst=sys.argv[0]+"?mode="+str(MODE_MAKE_PLAYLIST)+"&name="+name+"&id="+str(id)
-            menuItems.append(("Make Grooveshark playlist", "XBMC.RunPlugin("+mkplaylst+")"))
+            menuItems.append((xbmc.getLocalizedString(30076), "XBMC.RunPlugin("+mkplaylst+")"))
         # Broken rename/delete are broken in API
         if mode == MODE_PLAYLIST:
             rmplaylst=sys.argv[0]+"?mode="+str(MODE_REMOVE_PLAYLIST)+"&name="+urllib.quote_plus(name)+"&id="+str(id)
-            menuItems.append(("Delete Grooveshark playlist", "XBMC.RunPlugin("+rmplaylst+")"))
+            menuItems.append((xbmc.getLocalizedString(30077), "XBMC.RunPlugin("+rmplaylst+")"))
             mvplaylst=sys.argv[0]+"?mode="+str(MODE_RENAME_PLAYLIST)+"&name="+urllib.quote_plus(name)+"&id="+str(id)
-            menuItems.append(("Rename Grooveshark playlist", "XBMC.RunPlugin("+mvplaylst+")"))
+            menuItems.append((xbmc.getLocalizedString(30078), "XBMC.RunPlugin("+mvplaylst+")"))
         dir.addContextMenuItems(menuItems, replaceItems=False)
         
         return xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=dir,isFolder=True, totalItems=items)