diff --git a/res/translations/en.json b/res/translations/en.json index 92b574f..91e13d9 100644 --- a/res/translations/en.json +++ b/res/translations/en.json @@ -212,6 +212,9 @@ "Search": "Search", "Owner": "Owner", "To server": "To server", - "Time": "Time", - "Fav.": "Fav." + "Fav.": "Fav.", + "Set favorite": "Set favorite", + "Unset favorite": "Unset favorite", + "Remove from queue": "Remove from queue", + "Play song radio": "Play song radio" } diff --git a/res/translations/zh.json b/res/translations/zh.json index e5bad31..4009732 100644 --- a/res/translations/zh.json +++ b/res/translations/zh.json @@ -120,7 +120,7 @@ "Play Artist Radio": "播放艺术家电台", "Play count": "播放次数", "Play Discography": "播放唱片集", - "Play next": "播放下一个", + "Play next": "下一首播放", "Play Queue": "播放队列", "Play random": "随机播放", "Playback": "播放", @@ -211,5 +211,10 @@ "Owner": "拥有者", "Locally": "到本地", "Time": "时长", - "Fav.": "收藏" + "Fav.": "收藏", + "Set favorite": "设为收藏", + "Unset favorite": "取消收藏", + "Remove from queue": "从队列中移除", + "Size": "大小", + "Play song radio": "播放歌曲电台" } diff --git a/res/translations/zhHans.json b/res/translations/zhHans.json index c7751e4..551e4d0 100644 --- a/res/translations/zhHans.json +++ b/res/translations/zhHans.json @@ -120,7 +120,7 @@ "Play Artist Radio": "播放艺术家电台", "Play count": "播放次数", "Play Discography": "播放唱片集", - "Play next": "播放下一个", + "Play next": "下一首播放", "Play Queue": "播放队列", "Play random": "随机播放", "Playback": "播放", @@ -211,5 +211,10 @@ "Owner": "拥有者", "To server": "到服务器", "Time": "时长", - "Fav.": "收藏" + "Fav.": "收藏", + "Set favorite": "设为收藏", + "Unset favorite": "取消收藏", + "Remove from queue": "从队列中移除", + "Size": "大小", + "Play song radio": "播放歌曲电台" } diff --git a/res/translations/zhHant.json b/res/translations/zhHant.json index 08c9a3e..3e6e785 100644 --- a/res/translations/zhHant.json +++ b/res/translations/zhHant.json @@ -120,7 +120,7 @@ "Play Artist Radio": "播放藝術家電台", "Play count": "播放次數", "Play Discography": "播放唱片集", - "Play next": "播放下一個", + "Play next": "下一首播放", "Play Queue": "播放佇列", "Play random": "隨機播放", "Playback": "播放", @@ -211,5 +211,10 @@ "Owner": "擁有者", "To server": "到伺服器", "Time": "時长", - "Fav.": "收藏" + "Fav.": "收藏", + "Set favorite": "“設為收藏", + "Unset favorite": "取消收藏", + "Remove from queue": "從隊列中移除", + "Size": "大小", + "Play song radio": "播放歌曲電台" } diff --git a/ui/dialogs/trackinfodialog.go b/ui/dialogs/trackinfodialog.go index 49f390f..2c7a04d 100644 --- a/ui/dialogs/trackinfodialog.go +++ b/ui/dialogs/trackinfodialog.go @@ -39,7 +39,7 @@ func (t *TrackInfoDialog) CreateRenderer() fyne.WidgetRenderer { addFormRow(c, lang.L("Title"), t.track.Title) - c.Add(newFormText("Album", true)) + c.Add(newFormText(lang.L("Album"), true)) album := widget.NewHyperlink(t.track.Album, nil) album.OnTapped = func() { if t.OnNavigateToAlbum != nil { diff --git a/ui/widgets/gridview.go b/ui/widgets/gridview.go index 6982048..eef999b 100644 --- a/ui/widgets/gridview.go +++ b/ui/widgets/gridview.go @@ -3,6 +3,7 @@ package widgets import ( "context" "fmt" + "fyne.io/fyne/v2/lang" "strconv" "sync" @@ -13,7 +14,6 @@ import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/container" - "fyne.io/fyne/v2/lang" "fyne.io/fyne/v2/theme" "fyne.io/fyne/v2/widget" ) @@ -410,7 +410,7 @@ func (g *GridView) cancelFetch() { func (g *GridView) showContextMenu(card *GridViewItem, pos fyne.Position) { g.menuGridViewItemId = card.ItemID() if g.menu == nil { - play := fyne.NewMenuItem(lang.l("Play"), func() { g.onPlay(g.menuGridViewItemId, false) }) + play := fyne.NewMenuItem(lang.L("Play"), func() { g.onPlay(g.menuGridViewItemId, false) }) play.Icon = theme.MediaPlayIcon() shuffle := fyne.NewMenuItem(lang.L("Shuffle"), func() { g.onPlay(g.menuGridViewItemId, true) }) shuffle.Icon = myTheme.ShuffleIcon diff --git a/ui/widgets/nowplayingcard.go b/ui/widgets/nowplayingcard.go index 6118959..d1ea682 100644 --- a/ui/widgets/nowplayingcard.go +++ b/ui/widgets/nowplayingcard.go @@ -1,6 +1,7 @@ package widgets import ( + "fyne.io/fyne/v2/lang" "image" "github.com/dweymouth/supersonic/backend/mediaprovider" @@ -157,13 +158,13 @@ func (n *NowPlayingCard) SetImage(cover image.Image) { func (n *NowPlayingCard) showMenu(btnPos fyne.Position) { if n.menu == nil { n.ratingMenu = util.NewRatingSubmenu(n.onSetRating) - favorite := fyne.NewMenuItem("Set favorite", func() { n.onSetFavorite(true) }) + favorite := fyne.NewMenuItem(lang.L("Set favorite"), func() { n.onSetFavorite(true) }) favorite.Icon = myTheme.FavoriteIcon - unfavorite := fyne.NewMenuItem("Unset favorite", func() { n.onSetFavorite(false) }) + unfavorite := fyne.NewMenuItem(lang.L("Unset favorite"), func() { n.onSetFavorite(false) }) unfavorite.Icon = myTheme.NotFavoriteIcon - playlist := fyne.NewMenuItem("Add to playlist...", func() { n.onAddToPlaylist() }) + playlist := fyne.NewMenuItem(lang.L("Add to playlist")+"...", func() { n.onAddToPlaylist() }) playlist.Icon = myTheme.PlaylistIcon - share := fyne.NewMenuItem("Share...", func() { n.onShare() }) + share := fyne.NewMenuItem(lang.L("Share")+"...", func() { n.onShare() }) share.Icon = myTheme.ShareIcon m := fyne.NewMenu("", favorite, unfavorite, n.ratingMenu, playlist, share) diff --git a/ui/widgets/playqueuelist.go b/ui/widgets/playqueuelist.go index 98b2af0..bb0ab32 100644 --- a/ui/widgets/playqueuelist.go +++ b/ui/widgets/playqueuelist.go @@ -1,6 +1,7 @@ package widgets import ( + "fyne.io/fyne/v2/lang" "image" "slices" "strconv" @@ -277,31 +278,31 @@ func (p *PlayQueueList) ensureTracksMenu() { menuItems = append(menuItems, fyne.NewMenuItemSeparator()) } - playlist := fyne.NewMenuItem("Add to playlist...", func() { + playlist := fyne.NewMenuItem(lang.L("Add to playlist")+"...", func() { if p.OnAddToPlaylist != nil { p.OnAddToPlaylist(p.selectedItemIDs()) } }) playlist.Icon = myTheme.PlaylistIcon - download := fyne.NewMenuItem("Download...", func() { + download := fyne.NewMenuItem(lang.L("Download")+"...", func() { if p.OnDownload != nil { p.OnDownload(p.selectedTracks(), "Selected tracks") } }) download.Icon = theme.DownloadIcon() - p.shareMenuItem = fyne.NewMenuItem("Share...", func() { + p.shareMenuItem = fyne.NewMenuItem(lang.L("Share")+"...", func() { if p.OnShare != nil { p.OnShare(p.selectedTracks()) } }) p.shareMenuItem.Icon = myTheme.ShareIcon - favorite := fyne.NewMenuItem("Set favorite", func() { + favorite := fyne.NewMenuItem(lang.L("Set favorite"), func() { if p.OnSetFavorite != nil { p.OnSetFavorite(p.selectedItemIDs(), true) } }) favorite.Icon = myTheme.FavoriteIcon - unfavorite := fyne.NewMenuItem("Unset favorite", func() { + unfavorite := fyne.NewMenuItem(lang.L("Unset favorite"), func() { if p.OnSetFavorite != nil { p.OnSetFavorite(p.selectedItemIDs(), false) } @@ -323,7 +324,7 @@ func (p *PlayQueueList) ensureTracksMenu() { ) if !p.useNonQueueMenu { - remove := fyne.NewMenuItem("Remove from queue", func() { + remove := fyne.NewMenuItem(lang.L("Remove from queue"), func() { if p.OnRemoveFromQueue != nil { p.OnRemoveFromQueue(p.selectedIdxs()) } @@ -344,7 +345,7 @@ func (p *PlayQueueList) ensureRadiosMenu() { if p.radiosMenu != nil { return } - remove := fyne.NewMenuItem("Remove from queue", func() { + remove := fyne.NewMenuItem(lang.L("Remove from queue"), func() { if p.OnRemoveFromQueue != nil { p.OnRemoveFromQueue(p.selectedIdxs()) } @@ -357,25 +358,25 @@ func (p *PlayQueueList) ensureRadiosMenu() { } func (p *PlayQueueList) createQueueActionMenuItems() []*fyne.MenuItem { - play := fyne.NewMenuItem("Play", func() { + play := fyne.NewMenuItem(lang.L("Play"), func() { if p.OnPlaySelection != nil { p.OnPlaySelection(p.selectedItems(), false) } }) play.Icon = theme.MediaPlayIcon() - shuffle := fyne.NewMenuItem("Shuffle", func() { + shuffle := fyne.NewMenuItem(lang.L("Shuffle"), func() { if p.OnPlaySelection != nil { p.OnPlaySelection(p.selectedItems(), true) } }) shuffle.Icon = myTheme.ShuffleIcon - playNext := fyne.NewMenuItem("Play next", func() { + playNext := fyne.NewMenuItem(lang.L("Play next"), func() { if p.OnPlaySelection != nil { p.OnPlaySelectionNext(p.selectedItems()) } }) playNext.Icon = myTheme.PlayNextIcon - add := fyne.NewMenuItem("Add to queue", func() { + add := fyne.NewMenuItem(lang.L("Add to queue"), func() { if p.OnPlaySelection != nil { p.OnAddToQueue(p.selectedItems()) } diff --git a/ui/widgets/tracklist.go b/ui/widgets/tracklist.go index 53703da..9104e12 100644 --- a/ui/widgets/tracklist.go +++ b/ui/widgets/tracklist.go @@ -1,6 +1,7 @@ package widgets import ( + "fyne.io/fyne/v2/lang" "log" "slices" "sort" @@ -521,64 +522,64 @@ func (t *Tracklist) onShowContextMenu(e *fyne.PointEvent, trackIdx int) { if t.ctxMenu == nil { t.ctxMenu = fyne.NewMenu("") if !t.Options.DisablePlaybackMenu { - play := fyne.NewMenuItem("Play", func() { + play := fyne.NewMenuItem(lang.L("Play"), func() { if t.OnPlaySelection != nil { t.OnPlaySelection(t.selectedTracks(), false) } }) play.Icon = theme.MediaPlayIcon() - shuffle := fyne.NewMenuItem("Shuffle", func() { + shuffle := fyne.NewMenuItem(lang.L("Shuffle"), func() { if t.OnPlaySelection != nil { t.OnPlaySelection(t.selectedTracks(), true) } }) shuffle.Icon = myTheme.ShuffleIcon - playNext := fyne.NewMenuItem("Play next", func() { + playNext := fyne.NewMenuItem(lang.L("Play next"), func() { if t.OnPlaySelection != nil { t.OnPlaySelectionNext(t.selectedTracks()) } }) playNext.Icon = myTheme.PlayNextIcon - add := fyne.NewMenuItem("Add to queue", func() { + add := fyne.NewMenuItem(lang.L("Add to queue"), func() { if t.OnPlaySelection != nil { t.OnAddToQueue(t.selectedTracks()) } }) add.Icon = theme.ContentAddIcon() - t.songRadioMenuItem = fyne.NewMenuItem("Play song radio", func() { + t.songRadioMenuItem = fyne.NewMenuItem(lang.L("Play song radio"), func() { t.onPlaySongRadio(t.selectedTracks()) }) t.songRadioMenuItem.Icon = myTheme.RadioIcon t.ctxMenu.Items = append(t.ctxMenu.Items, play, shuffle, playNext, add, t.songRadioMenuItem) } - playlist := fyne.NewMenuItem("Add to playlist...", func() { + playlist := fyne.NewMenuItem(lang.L("Add to playlist")+"...", func() { if t.OnAddToPlaylist != nil { t.OnAddToPlaylist(t.SelectedTrackIDs()) } }) playlist.Icon = myTheme.PlaylistIcon - download := fyne.NewMenuItem("Download...", func() { + download := fyne.NewMenuItem(lang.L("Download")+"...", func() { t.onDownload(t.selectedTracks(), "Selected tracks") }) download.Icon = theme.DownloadIcon() - t.infoMenuItem = fyne.NewMenuItem("Show info...", func() { + t.infoMenuItem = fyne.NewMenuItem(lang.L("Show info")+"...", func() { if t.OnShowTrackInfo != nil { t.OnShowTrackInfo(t.selectedTracks()[0]) } }) t.infoMenuItem.Icon = theme.InfoIcon() - favorite := fyne.NewMenuItem("Set favorite", func() { + favorite := fyne.NewMenuItem(lang.L("Set favorite"), func() { t.onSetFavorites(t.selectedTracks(), true, true) }) favorite.Icon = myTheme.FavoriteIcon - unfavorite := fyne.NewMenuItem("Unset favorite", func() { + unfavorite := fyne.NewMenuItem(lang.L("Unset favorite"), func() { t.onSetFavorites(t.selectedTracks(), false, true) }) unfavorite.Icon = myTheme.NotFavoriteIcon t.ctxMenu.Items = append(t.ctxMenu.Items, fyne.NewMenuItemSeparator(), playlist, download, t.infoMenuItem) - t.shareMenuItem = fyne.NewMenuItem("Share...", func() { + t.shareMenuItem = fyne.NewMenuItem(lang.L("Share")+"...", func() { t.onShare(t.selectedTracks()) }) t.shareMenuItem.Icon = myTheme.ShareIcon