more translation prep
This commit is contained in:
@@ -1,13 +1,49 @@
|
|||||||
{
|
{
|
||||||
|
"Add to playlist": "Add to playlist",
|
||||||
|
"Add to queue": "Add to queue",
|
||||||
"Album": "Album",
|
"Album": "Album",
|
||||||
|
"Album count": "Album count",
|
||||||
"Album gain": "Album gain",
|
"Album gain": "Album gain",
|
||||||
"Album peak": "Album peak",
|
"Album peak": "Album peak",
|
||||||
|
"All Tracks": "All Tracks",
|
||||||
"Artist": "Artist",
|
"Artist": "Artist",
|
||||||
|
"Artists": "Artists",
|
||||||
|
"Artist biography not available.": "Artist biography not available.",
|
||||||
|
"Configure your music server to add radio stations": "Configure your music server to add radio stations",
|
||||||
|
"Discography": "Discography",
|
||||||
|
"Download": "Download",
|
||||||
"Duration": "Duration",
|
"Duration": "Duration",
|
||||||
|
"Edit": "Edit",
|
||||||
|
"Favorites": "Favorites",
|
||||||
|
"Genre": "Genre",
|
||||||
|
"Genres": "Genres",
|
||||||
|
"Internet Radio Stations": "Internet Radio Stations",
|
||||||
|
"Lyrics": "Lyrics",
|
||||||
|
"Name": "Name",
|
||||||
|
"No radio stations available": "No radio stations available",
|
||||||
|
"Play": "Play",
|
||||||
|
"Playlist": "Playlist",
|
||||||
|
"Playlists": "Playlists",
|
||||||
|
"playlist by": "playlist by",
|
||||||
|
"Play next": "Play next",
|
||||||
|
"Play Queue": "Play Queue",
|
||||||
|
"Play random": "Play random",
|
||||||
|
"Private": "Private",
|
||||||
|
"Public": "Public",
|
||||||
|
"Related": "Related",
|
||||||
|
"Remove from playlist": "Remove from playlist",
|
||||||
|
"Search page": "Search page",
|
||||||
|
"Share": "Share",
|
||||||
|
"Show info": "Show info",
|
||||||
|
"Shuffle": "Shuffle",
|
||||||
|
"Similar artists": "Similar artists",
|
||||||
"Title": "Title",
|
"Title": "Title",
|
||||||
|
"Top Tracks": "Top Tracks",
|
||||||
"Track": "Track",
|
"Track": "Track",
|
||||||
|
"track": "track",
|
||||||
|
"tracks": "tracks",
|
||||||
|
"Track count": "Track count",
|
||||||
"Track gain": "Track gain",
|
"Track gain": "Track gain",
|
||||||
"Track peak": "Track peak",
|
"Track peak": "Track peak",
|
||||||
"Genre": "Genre",
|
|
||||||
"Year": "Year"
|
"Year": "Year"
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,7 @@ import (
|
|||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
|
"fyne.io/fyne/v2/lang"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
"fyne.io/fyne/v2/theme"
|
"fyne.io/fyne/v2/theme"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
@@ -224,10 +225,10 @@ func NewAlbumPageHeader(page *AlbumPage) *AlbumPageHeader {
|
|||||||
a.page.contr.NavigateTo(controller.GenreRoute(genre))
|
a.page.contr.NavigateTo(controller.GenreRoute(genre))
|
||||||
}
|
}
|
||||||
a.miscLabel = widget.NewLabel("")
|
a.miscLabel = widget.NewLabel("")
|
||||||
playButton := widget.NewButtonWithIcon("Play", theme.MediaPlayIcon(), func() {
|
playButton := widget.NewButtonWithIcon(lang.L("Play"), theme.MediaPlayIcon(), func() {
|
||||||
go a.page.pm.PlayAlbum(a.page.albumID, 0, false)
|
go a.page.pm.PlayAlbum(a.page.albumID, 0, false)
|
||||||
})
|
})
|
||||||
shuffleBtn := widget.NewButtonWithIcon("Shuffle", myTheme.ShuffleIcon, func() {
|
shuffleBtn := widget.NewButtonWithIcon(lang.L("Shuffle"), myTheme.ShuffleIcon, func() {
|
||||||
a.page.pm.LoadTracks(a.page.tracklist.GetTracks(), backend.Replace, true)
|
a.page.pm.LoadTracks(a.page.tracklist.GetTracks(), backend.Replace, true)
|
||||||
a.page.pm.PlayFromBeginning()
|
a.page.pm.PlayFromBeginning()
|
||||||
})
|
})
|
||||||
@@ -235,28 +236,28 @@ func NewAlbumPageHeader(page *AlbumPage) *AlbumPageHeader {
|
|||||||
menuBtn := widget.NewButtonWithIcon("", theme.MoreHorizontalIcon(), nil)
|
menuBtn := widget.NewButtonWithIcon("", theme.MoreHorizontalIcon(), nil)
|
||||||
menuBtn.OnTapped = func() {
|
menuBtn.OnTapped = func() {
|
||||||
if pop == nil {
|
if pop == nil {
|
||||||
playNext := fyne.NewMenuItem("Play next", func() {
|
playNext := fyne.NewMenuItem(lang.L("Play next"), func() {
|
||||||
go a.page.pm.LoadAlbum(a.albumID, backend.InsertNext, false /*shuffle*/)
|
go a.page.pm.LoadAlbum(a.albumID, backend.InsertNext, false /*shuffle*/)
|
||||||
})
|
})
|
||||||
playNext.Icon = myTheme.PlayNextIcon
|
playNext.Icon = myTheme.PlayNextIcon
|
||||||
queue := fyne.NewMenuItem("Add to queue", func() {
|
queue := fyne.NewMenuItem(lang.L("Add to queue"), func() {
|
||||||
go a.page.pm.LoadAlbum(a.albumID, backend.Append, false /*shuffle*/)
|
go a.page.pm.LoadAlbum(a.albumID, backend.Append, false /*shuffle*/)
|
||||||
})
|
})
|
||||||
queue.Icon = theme.ContentAddIcon()
|
queue.Icon = theme.ContentAddIcon()
|
||||||
playlist := fyne.NewMenuItem("Add to playlist...", func() {
|
playlist := fyne.NewMenuItem(lang.L("Add to playlist")+"...", func() {
|
||||||
a.page.contr.DoAddTracksToPlaylistWorkflow(
|
a.page.contr.DoAddTracksToPlaylistWorkflow(
|
||||||
sharedutil.TracksToIDs(a.page.tracks))
|
sharedutil.TracksToIDs(a.page.tracks))
|
||||||
})
|
})
|
||||||
playlist.Icon = myTheme.PlaylistIcon
|
playlist.Icon = myTheme.PlaylistIcon
|
||||||
download := fyne.NewMenuItem("Download...", func() {
|
download := fyne.NewMenuItem(lang.L("Download")+"...", func() {
|
||||||
a.page.contr.ShowDownloadDialog(a.page.tracks, a.titleLabel.String())
|
a.page.contr.ShowDownloadDialog(a.page.tracks, a.titleLabel.String())
|
||||||
})
|
})
|
||||||
download.Icon = theme.DownloadIcon()
|
download.Icon = theme.DownloadIcon()
|
||||||
info := fyne.NewMenuItem("Show Info...", func() {
|
info := fyne.NewMenuItem(lang.L("Show info")+"...", func() {
|
||||||
a.page.contr.ShowAlbumInfoDialog(a.albumID, a.titleLabel.String(), a.cover.Image())
|
a.page.contr.ShowAlbumInfoDialog(a.albumID, a.titleLabel.String(), a.cover.Image())
|
||||||
})
|
})
|
||||||
info.Icon = theme.InfoIcon()
|
info.Icon = theme.InfoIcon()
|
||||||
a.shareMenuItem = fyne.NewMenuItem("Share...", func() {
|
a.shareMenuItem = fyne.NewMenuItem(lang.L("Share")+"...", func() {
|
||||||
a.page.contr.ShowShareDialog(a.albumID)
|
a.page.contr.ShowShareDialog(a.albumID)
|
||||||
})
|
})
|
||||||
a.shareMenuItem.Icon = myTheme.ShareIcon
|
a.shareMenuItem.Icon = myTheme.ShareIcon
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import (
|
|||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
|
"fyne.io/fyne/v2/lang"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
"fyne.io/fyne/v2/theme"
|
"fyne.io/fyne/v2/theme"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
@@ -50,9 +51,14 @@ type ArtistPage struct {
|
|||||||
container *fyne.Container
|
container *fyne.Container
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
viewTopTracks = "Top Tracks"
|
||||||
|
viewDiscography = "Discography"
|
||||||
|
)
|
||||||
|
|
||||||
func NewArtistPage(artistID string, cfg *backend.ArtistPageConfig, pool *util.WidgetPool, pm *backend.PlaybackManager, mp mediaprovider.MediaProvider, im *backend.ImageManager, contr *controller.Controller) *ArtistPage {
|
func NewArtistPage(artistID string, cfg *backend.ArtistPageConfig, pool *util.WidgetPool, pm *backend.PlaybackManager, mp mediaprovider.MediaProvider, im *backend.ImageManager, contr *controller.Controller) *ArtistPage {
|
||||||
activeView := 0
|
activeView := 0
|
||||||
if cfg.InitialView == "Top Tracks" {
|
if cfg.InitialView == viewTopTracks {
|
||||||
activeView = 1
|
activeView = 1
|
||||||
}
|
}
|
||||||
return newArtistPage(artistID, cfg, pool, pm, mp, im, contr, activeView, widgets.TracklistSort{})
|
return newArtistPage(artistID, cfg, pool, pm, mp, im, contr, activeView, widgets.TracklistSort{})
|
||||||
@@ -81,7 +87,7 @@ func newArtistPage(artistID string, cfg *backend.ArtistPageConfig, pool *util.Wi
|
|||||||
if img, ok := im.GetCachedArtistImage(artistID); ok {
|
if img, ok := im.GetCachedArtistImage(artistID); ok {
|
||||||
a.header.artistImage.SetImage(img, true /*tappable*/)
|
a.header.artistImage.SetImage(img, true /*tappable*/)
|
||||||
}
|
}
|
||||||
viewToggle := widgets.NewToggleText(0, []string{"Discography", "Top Tracks"})
|
viewToggle := widgets.NewToggleText(0, []string{lang.L("Discography"), lang.L("Top Tracks")})
|
||||||
viewToggle.SetActivatedLabel(a.activeView)
|
viewToggle.SetActivatedLabel(a.activeView)
|
||||||
viewToggle.OnChanged = a.onViewChange
|
viewToggle.OnChanged = a.onViewChange
|
||||||
//line := canvas.NewLine(theme.TextColor())
|
//line := canvas.NewLine(theme.TextColor())
|
||||||
@@ -270,9 +276,9 @@ func (a *ArtistPage) onViewChange(num int) {
|
|||||||
}
|
}
|
||||||
a.activeView = num
|
a.activeView = num
|
||||||
if num == 1 {
|
if num == 1 {
|
||||||
a.cfg.InitialView = "Top Tracks"
|
a.cfg.InitialView = viewTopTracks
|
||||||
} else {
|
} else {
|
||||||
a.cfg.InitialView = "Discography"
|
a.cfg.InitialView = viewDiscography
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,7 +291,7 @@ func (s *artistPageState) Restore() Page {
|
|||||||
return newArtistPage(s.artistID, s.cfg, s.pool, s.pm, s.mp, s.im, s.contr, s.activeView, s.trackSort)
|
return newArtistPage(s.artistID, s.cfg, s.pool, s.pm, s.mp, s.im, s.contr, s.activeView, s.trackSort)
|
||||||
}
|
}
|
||||||
|
|
||||||
const artistBioNotAvailableStr = "Artist biography not available."
|
const artistBioNotAvailableKey = "Artist biography not available."
|
||||||
|
|
||||||
type ArtistPageHeader struct {
|
type ArtistPageHeader struct {
|
||||||
widget.BaseWidget
|
widget.BaseWidget
|
||||||
@@ -310,7 +316,7 @@ func NewArtistPageHeader(page *ArtistPage) *ArtistPageHeader {
|
|||||||
a := &ArtistPageHeader{
|
a := &ArtistPageHeader{
|
||||||
artistPage: page,
|
artistPage: page,
|
||||||
titleDisp: widget.NewRichTextWithText(""),
|
titleDisp: widget.NewRichTextWithText(""),
|
||||||
biographyDisp: widgets.NewMaxRowsLabel(5, artistBioNotAvailableStr),
|
biographyDisp: widgets.NewMaxRowsLabel(5, lang.L(artistBioNotAvailableKey)),
|
||||||
similarArtists: container.NewHBox(),
|
similarArtists: container.NewHBox(),
|
||||||
}
|
}
|
||||||
a.titleDisp.Segments[0].(*widget.TextSegment).Style = widget.RichTextStyle{
|
a.titleDisp.Segments[0].(*widget.TextSegment).Style = widget.RichTextStyle{
|
||||||
@@ -374,7 +380,7 @@ func (a *ArtistPageHeader) Clear() {
|
|||||||
a.artistID = ""
|
a.artistID = ""
|
||||||
a.favoriteBtn.IsFavorited = false
|
a.favoriteBtn.IsFavorited = false
|
||||||
a.titleDisp.Segments[0].(*widget.TextSegment).Text = ""
|
a.titleDisp.Segments[0].(*widget.TextSegment).Text = ""
|
||||||
a.biographyDisp.Text = artistBioNotAvailableStr
|
a.biographyDisp.Text = lang.L(artistBioNotAvailableKey)
|
||||||
for _, obj := range a.similarArtists.Objects {
|
for _, obj := range a.similarArtists.Objects {
|
||||||
obj.Hide()
|
obj.Hide()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"slices"
|
"slices"
|
||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
|
"fyne.io/fyne/v2/lang"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
"github.com/dweymouth/supersonic/backend"
|
"github.com/dweymouth/supersonic/backend"
|
||||||
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
||||||
@@ -26,7 +27,7 @@ func NewArtistsPage(cfg *backend.ArtistsPageConfig, pool *util.WidgetPool, contr
|
|||||||
return NewGridViewPage(adapter, pool, mp, im)
|
return NewGridViewPage(adapter, pool, mp, im)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *artistsPageAdapter) Title() string { return "Artists" }
|
func (a *artistsPageAdapter) Title() string { return lang.L("Artists") }
|
||||||
|
|
||||||
func (a *artistsPageAdapter) Filter() mediaprovider.ArtistFilter {
|
func (a *artistsPageAdapter) Filter() mediaprovider.ArtistFilter {
|
||||||
if a.filter == nil {
|
if a.filter == nil {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import (
|
|||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
|
"fyne.io/fyne/v2/lang"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
"fyne.io/fyne/v2/theme"
|
"fyne.io/fyne/v2/theme"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
@@ -85,7 +86,7 @@ func NewFavoritesPage(cfg *backend.FavoritesPageConfig, pool *util.WidgetPool, c
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *FavoritesPage) createHeader(activeBtnIdx int) {
|
func (a *FavoritesPage) createHeader(activeBtnIdx int) {
|
||||||
a.titleDisp = widget.NewRichTextWithText("Favorites")
|
a.titleDisp = widget.NewRichTextWithText(lang.L("Favorites"))
|
||||||
a.titleDisp.Segments[0].(*widget.TextSegment).Style = widget.RichTextStyle{
|
a.titleDisp.Segments[0].(*widget.TextSegment).Style = widget.RichTextStyle{
|
||||||
SizeName: theme.SizeNameHeadingText,
|
SizeName: theme.SizeNameHeadingText,
|
||||||
}
|
}
|
||||||
@@ -94,7 +95,7 @@ func (a *FavoritesPage) createHeader(activeBtnIdx int) {
|
|||||||
widget.NewButtonWithIcon("", myTheme.ArtistIcon, a.onShowFavoriteArtists),
|
widget.NewButtonWithIcon("", myTheme.ArtistIcon, a.onShowFavoriteArtists),
|
||||||
widget.NewButtonWithIcon("", myTheme.TracksIcon, a.onShowFavoriteSongs))
|
widget.NewButtonWithIcon("", myTheme.TracksIcon, a.onShowFavoriteSongs))
|
||||||
a.searcher = widgets.NewSearchEntry()
|
a.searcher = widgets.NewSearchEntry()
|
||||||
a.searcher.PlaceHolder = "Search page"
|
a.searcher.PlaceHolder = lang.L("Search page")
|
||||||
a.searcher.OnSearched = a.OnSearched
|
a.searcher.OnSearched = a.OnSearched
|
||||||
a.searcher.Entry.Text = a.searchText
|
a.searcher.Entry.Text = a.searchText
|
||||||
a.filterBtn = widgets.NewAlbumFilterButton(a.filter, a.mp.GetGenres)
|
a.filterBtn = widgets.NewAlbumFilterButton(a.filter, a.mp.GetGenres)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import (
|
|||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
|
"fyne.io/fyne/v2/lang"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
"fyne.io/fyne/v2/theme"
|
"fyne.io/fyne/v2/theme"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
@@ -42,14 +43,14 @@ func newGenresPage(contr *controller.Controller, mp mediaprovider.MediaProvider,
|
|||||||
a := &GenresPage{
|
a := &GenresPage{
|
||||||
contr: contr,
|
contr: contr,
|
||||||
mp: mp,
|
mp: mp,
|
||||||
titleDisp: widget.NewRichTextWithText("Genres"),
|
titleDisp: widget.NewRichTextWithText(lang.L("Genres")),
|
||||||
}
|
}
|
||||||
a.ExtendBaseWidget(a)
|
a.ExtendBaseWidget(a)
|
||||||
a.titleDisp.Segments[0].(*widget.TextSegment).Style.SizeName = theme.SizeNameHeadingText
|
a.titleDisp.Segments[0].(*widget.TextSegment).Style.SizeName = theme.SizeNameHeadingText
|
||||||
a.list = NewGenreList(sorting)
|
a.list = NewGenreList(sorting)
|
||||||
a.list.OnNavTo = func(id string) { a.contr.NavigateTo(controller.GenreRoute(id)) }
|
a.list.OnNavTo = func(id string) { a.contr.NavigateTo(controller.GenreRoute(id)) }
|
||||||
a.searcher = widgets.NewSearchEntry()
|
a.searcher = widgets.NewSearchEntry()
|
||||||
a.searcher.PlaceHolder = "Search page"
|
a.searcher.PlaceHolder = lang.L("Search page")
|
||||||
a.searcher.OnSearched = a.onSearched
|
a.searcher.OnSearched = a.onSearched
|
||||||
a.searcher.Entry.Text = searchText
|
a.searcher.Entry.Text = searchText
|
||||||
a.buildContainer()
|
a.buildContainer()
|
||||||
@@ -188,15 +189,20 @@ func NewGenreListRow(layout *layouts.ColumnsLayout) *GenreListRow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewGenreList(sorting widgets.ListHeaderSort) *GenreList {
|
func NewGenreList(sorting widgets.ListHeaderSort) *GenreList {
|
||||||
|
albumCount := lang.L("Album count")
|
||||||
|
trackCount := lang.L("Track count")
|
||||||
|
albumW := widget.NewLabel(albumCount).MinSize().Width + 15 /*room for sort icon */
|
||||||
|
trackW := widget.NewLabel(trackCount).MinSize().Width + 15 /*room for sort icon */
|
||||||
|
|
||||||
a := &GenreList{
|
a := &GenreList{
|
||||||
sorting: sorting,
|
sorting: sorting,
|
||||||
columnsLayout: layouts.NewColumnsLayout([]float32{-1, 125, 125}),
|
columnsLayout: layouts.NewColumnsLayout([]float32{-1, albumW, trackW}),
|
||||||
}
|
}
|
||||||
a.ExtendBaseWidget(a)
|
a.ExtendBaseWidget(a)
|
||||||
a.hdr = widgets.NewListHeader([]widgets.ListColumn{
|
a.hdr = widgets.NewListHeader([]widgets.ListColumn{
|
||||||
{Text: "Name", Alignment: fyne.TextAlignLeading, CanToggleVisible: false},
|
{Text: lang.L("Name"), Alignment: fyne.TextAlignLeading, CanToggleVisible: false},
|
||||||
{Text: "Album Count", Alignment: fyne.TextAlignTrailing, CanToggleVisible: false},
|
{Text: albumCount, Alignment: fyne.TextAlignTrailing, CanToggleVisible: false},
|
||||||
{Text: "Track Count", Alignment: fyne.TextAlignTrailing, CanToggleVisible: false}},
|
{Text: trackCount, Alignment: fyne.TextAlignTrailing, CanToggleVisible: false}},
|
||||||
a.columnsLayout)
|
a.columnsLayout)
|
||||||
a.hdr.SetSorting(sorting)
|
a.hdr.SetSorting(sorting)
|
||||||
a.hdr.OnColumnSortChanged = a.onSorted
|
a.hdr.OnColumnSortChanged = a.onSorted
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import (
|
|||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/canvas"
|
"fyne.io/fyne/v2/canvas"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
|
"fyne.io/fyne/v2/lang"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
"fyne.io/fyne/v2/theme"
|
"fyne.io/fyne/v2/theme"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
@@ -203,12 +204,12 @@ func (a *NowPlayingPage) CreateRenderer() fyne.WidgetRenderer {
|
|||||||
a.lyricsLoading = widgets.NewLoadingDots()
|
a.lyricsLoading = widgets.NewLoadingDots()
|
||||||
a.relatedLoading = widgets.NewLoadingDots()
|
a.relatedLoading = widgets.NewLoadingDots()
|
||||||
a.tabs = container.NewAppTabs(
|
a.tabs = container.NewAppTabs(
|
||||||
container.NewTabItem("Play Queue",
|
container.NewTabItem(lang.L("Play Queue"),
|
||||||
container.NewBorder(layout.NewSpacer(), nil, nil, nil, a.queueList)),
|
container.NewBorder(layout.NewSpacer(), nil, nil, nil, a.queueList)),
|
||||||
container.NewTabItem("Lyrics", container.NewStack(
|
container.NewTabItem(lang.L("Lyrics"), container.NewStack(
|
||||||
a.lyricsViewer,
|
a.lyricsViewer,
|
||||||
container.NewCenter(a.lyricsLoading))),
|
container.NewCenter(a.lyricsLoading))),
|
||||||
container.NewTabItem("Related", container.NewStack(
|
container.NewTabItem(lang.L("Related"), container.NewStack(
|
||||||
a.relatedList,
|
a.relatedList,
|
||||||
container.NewCenter(a.relatedLoading))),
|
container.NewCenter(a.relatedLoading))),
|
||||||
)
|
)
|
||||||
|
|||||||
+17
-13
@@ -14,6 +14,7 @@ import (
|
|||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
|
"fyne.io/fyne/v2/lang"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
"fyne.io/fyne/v2/theme"
|
"fyne.io/fyne/v2/theme"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
@@ -89,7 +90,7 @@ func newPlaylistPage(
|
|||||||
a.tracklist.OnReorderTracks = a.doSetNewTrackOrder
|
a.tracklist.OnReorderTracks = a.doSetNewTrackOrder
|
||||||
_, canRate := a.sm.Server.(mediaprovider.SupportsRating)
|
_, canRate := a.sm.Server.(mediaprovider.SupportsRating)
|
||||||
_, canShare := a.sm.Server.(mediaprovider.SupportsSharing)
|
_, canShare := a.sm.Server.(mediaprovider.SupportsSharing)
|
||||||
remove := fyne.NewMenuItem("Remove from playlist", a.onRemoveSelectedFromPlaylist)
|
remove := fyne.NewMenuItem(lang.L("Remove from playlist"), a.onRemoveSelectedFromPlaylist)
|
||||||
remove.Icon = theme.ContentClearIcon()
|
remove.Icon = theme.ContentClearIcon()
|
||||||
a.tracklist.Options = widgets.TracklistOptions{
|
a.tracklist.Options = widgets.TracklistOptions{
|
||||||
Reorderable: true,
|
Reorderable: true,
|
||||||
@@ -252,17 +253,17 @@ func NewPlaylistPageHeader(page *PlaylistPage) *PlaylistPageHeader {
|
|||||||
a.ownerLabel = util.NewTruncatingLabel()
|
a.ownerLabel = util.NewTruncatingLabel()
|
||||||
a.createdAtLabel = widget.NewLabel("")
|
a.createdAtLabel = widget.NewLabel("")
|
||||||
a.trackTimeLabel = widget.NewLabel("")
|
a.trackTimeLabel = widget.NewLabel("")
|
||||||
a.editButton = widget.NewButtonWithIcon("Edit", theme.DocumentCreateIcon(), func() {
|
a.editButton = widget.NewButtonWithIcon(lang.L("Edit"), theme.DocumentCreateIcon(), func() {
|
||||||
if a.playlistInfo != nil {
|
if a.playlistInfo != nil {
|
||||||
a.page.contr.DoEditPlaylistWorkflow(&a.playlistInfo.Playlist)
|
a.page.contr.DoEditPlaylistWorkflow(&a.playlistInfo.Playlist)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
a.editButton.Hidden = true
|
a.editButton.Hidden = true
|
||||||
playButton := widget.NewButtonWithIcon("Play", theme.MediaPlayIcon(), func() {
|
playButton := widget.NewButtonWithIcon(lang.L("Play"), theme.MediaPlayIcon(), func() {
|
||||||
a.page.pm.LoadTracks(a.page.tracks, backend.Replace, false)
|
a.page.pm.LoadTracks(a.page.tracks, backend.Replace, false)
|
||||||
a.page.pm.PlayFromBeginning()
|
a.page.pm.PlayFromBeginning()
|
||||||
})
|
})
|
||||||
shuffleBtn := widget.NewButtonWithIcon("Shuffle", myTheme.ShuffleIcon, func() {
|
shuffleBtn := widget.NewButtonWithIcon(lang.L("Shuffle"), myTheme.ShuffleIcon, func() {
|
||||||
a.page.pm.LoadTracks(a.page.tracks, backend.Replace, true)
|
a.page.pm.LoadTracks(a.page.tracks, backend.Replace, true)
|
||||||
a.page.pm.PlayFromBeginning()
|
a.page.pm.PlayFromBeginning()
|
||||||
})
|
})
|
||||||
@@ -270,20 +271,20 @@ func NewPlaylistPageHeader(page *PlaylistPage) *PlaylistPageHeader {
|
|||||||
menuBtn := widget.NewButtonWithIcon("", theme.MoreHorizontalIcon(), nil)
|
menuBtn := widget.NewButtonWithIcon("", theme.MoreHorizontalIcon(), nil)
|
||||||
menuBtn.OnTapped = func() {
|
menuBtn.OnTapped = func() {
|
||||||
if pop == nil {
|
if pop == nil {
|
||||||
playNext := fyne.NewMenuItem("Play next", func() {
|
playNext := fyne.NewMenuItem(lang.L("Play next"), func() {
|
||||||
go a.page.pm.LoadPlaylist(a.page.playlistID, backend.InsertNext, false)
|
go a.page.pm.LoadPlaylist(a.page.playlistID, backend.InsertNext, false)
|
||||||
})
|
})
|
||||||
playNext.Icon = myTheme.PlayNextIcon
|
playNext.Icon = myTheme.PlayNextIcon
|
||||||
queue := fyne.NewMenuItem("Add to queue", func() {
|
queue := fyne.NewMenuItem(lang.L("Add to queue"), func() {
|
||||||
go a.page.pm.LoadPlaylist(a.page.playlistID, backend.Append, false)
|
go a.page.pm.LoadPlaylist(a.page.playlistID, backend.Append, false)
|
||||||
})
|
})
|
||||||
queue.Icon = theme.ContentAddIcon()
|
queue.Icon = theme.ContentAddIcon()
|
||||||
playlist := fyne.NewMenuItem("Add to playlist...", func() {
|
playlist := fyne.NewMenuItem(lang.L("Add to playlist")+"...", func() {
|
||||||
a.page.contr.DoAddTracksToPlaylistWorkflow(
|
a.page.contr.DoAddTracksToPlaylistWorkflow(
|
||||||
sharedutil.TracksToIDs(a.page.tracks))
|
sharedutil.TracksToIDs(a.page.tracks))
|
||||||
})
|
})
|
||||||
playlist.Icon = myTheme.PlaylistIcon
|
playlist.Icon = myTheme.PlaylistIcon
|
||||||
download := fyne.NewMenuItem("Download...", func() {
|
download := fyne.NewMenuItem(lang.L("Download")+"...", func() {
|
||||||
a.page.contr.ShowDownloadDialog(a.page.tracks, a.titleLabel.String())
|
a.page.contr.ShowDownloadDialog(a.page.tracks, a.titleLabel.String())
|
||||||
})
|
})
|
||||||
download.Icon = theme.DownloadIcon()
|
download.Icon = theme.DownloadIcon()
|
||||||
@@ -342,17 +343,20 @@ func (a *PlaylistPageHeader) Update(playlist *mediaprovider.PlaylistWithTracks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *PlaylistPageHeader) formatPlaylistOwnerStr(p *mediaprovider.PlaylistWithTracks) string {
|
func (a *PlaylistPageHeader) formatPlaylistOwnerStr(p *mediaprovider.PlaylistWithTracks) string {
|
||||||
pubPriv := "Public"
|
pubPriv := lang.L("Public")
|
||||||
if !p.Public {
|
if !p.Public {
|
||||||
pubPriv = "Private"
|
pubPriv = lang.L("Private")
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%s playlist by %s", pubPriv, p.Owner)
|
playlistBy := lang.L("playlist by")
|
||||||
|
return fmt.Sprintf("%s %s %s", pubPriv, playlistBy, p.Owner)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *PlaylistPageHeader) formatPlaylistTrackTimeStr(p *mediaprovider.PlaylistWithTracks) string {
|
func (a *PlaylistPageHeader) formatPlaylistTrackTimeStr(p *mediaprovider.PlaylistWithTracks) string {
|
||||||
tracks := "tracks"
|
var tracks string
|
||||||
if p.TrackCount == 1 {
|
if p.TrackCount == 1 {
|
||||||
tracks = "track"
|
tracks = lang.L("track")
|
||||||
|
} else {
|
||||||
|
tracks = lang.L("tracks")
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%d %s, %s", p.TrackCount, tracks, util.SecondsToTimeString(float64(p.Duration)))
|
return fmt.Sprintf("%d %s, %s", p.TrackCount, tracks, util.SecondsToTimeString(float64(p.Duration)))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import (
|
|||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
|
"fyne.io/fyne/v2/lang"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
"fyne.io/fyne/v2/theme"
|
"fyne.io/fyne/v2/theme"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
@@ -71,14 +72,14 @@ func newPlaylistsPage(
|
|||||||
mp: mp,
|
mp: mp,
|
||||||
contr: contr,
|
contr: contr,
|
||||||
listSort: listSort,
|
listSort: listSort,
|
||||||
titleDisp: widget.NewRichTextWithText("Playlists"),
|
titleDisp: widget.NewRichTextWithText(lang.L("Playlists")),
|
||||||
initialListScrollPos: listScrollPos,
|
initialListScrollPos: listScrollPos,
|
||||||
initialGridScrollPos: gridScrollPos,
|
initialGridScrollPos: gridScrollPos,
|
||||||
}
|
}
|
||||||
a.ExtendBaseWidget(a)
|
a.ExtendBaseWidget(a)
|
||||||
a.titleDisp.Segments[0].(*widget.TextSegment).Style.SizeName = theme.SizeNameHeadingText
|
a.titleDisp.Segments[0].(*widget.TextSegment).Style.SizeName = theme.SizeNameHeadingText
|
||||||
a.searcher = widgets.NewSearchEntry()
|
a.searcher = widgets.NewSearchEntry()
|
||||||
a.searcher.PlaceHolder = "Search page"
|
a.searcher.PlaceHolder = lang.L("Search page")
|
||||||
a.searcher.OnSearched = a.onSearched
|
a.searcher.OnSearched = a.onSearched
|
||||||
a.searcher.Entry.Text = searchText
|
a.searcher.Entry.Text = searchText
|
||||||
a.viewToggle = widgets.NewToggleButtonGroup(0,
|
a.viewToggle = widgets.NewToggleButtonGroup(0,
|
||||||
@@ -193,9 +194,11 @@ func (a *PlaylistsPage) showGridView() {
|
|||||||
|
|
||||||
func createPlaylistGridViewModel(playlists []*mediaprovider.Playlist) []widgets.GridViewItemModel {
|
func createPlaylistGridViewModel(playlists []*mediaprovider.Playlist) []widgets.GridViewItemModel {
|
||||||
return sharedutil.MapSlice(playlists, func(pl *mediaprovider.Playlist) widgets.GridViewItemModel {
|
return sharedutil.MapSlice(playlists, func(pl *mediaprovider.Playlist) widgets.GridViewItemModel {
|
||||||
tracks := "tracks"
|
var tracks string
|
||||||
if pl.TrackCount == 1 {
|
if pl.TrackCount == 1 {
|
||||||
tracks = "track"
|
tracks = lang.L("track")
|
||||||
|
} else {
|
||||||
|
tracks = lang.L("tracks")
|
||||||
}
|
}
|
||||||
return widgets.GridViewItemModel{
|
return widgets.GridViewItemModel{
|
||||||
Name: pl.Name,
|
Name: pl.Name,
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import (
|
|||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
|
"fyne.io/fyne/v2/lang"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
"fyne.io/fyne/v2/theme"
|
"fyne.io/fyne/v2/theme"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
@@ -48,7 +49,7 @@ func newRadiosPage(contr *controller.Controller, rp mediaprovider.RadioProvider,
|
|||||||
contr: contr,
|
contr: contr,
|
||||||
rp: rp,
|
rp: rp,
|
||||||
pm: pm,
|
pm: pm,
|
||||||
titleDisp: widget.NewRichTextWithText("Internet Radio Stations"),
|
titleDisp: widget.NewRichTextWithText(lang.L("Internet Radio Stations")),
|
||||||
}
|
}
|
||||||
a.ExtendBaseWidget(a)
|
a.ExtendBaseWidget(a)
|
||||||
a.titleDisp.Segments[0].(*widget.TextSegment).Style.SizeName = theme.SizeNameHeadingText
|
a.titleDisp.Segments[0].(*widget.TextSegment).Style.SizeName = theme.SizeNameHeadingText
|
||||||
@@ -56,13 +57,13 @@ func newRadiosPage(contr *controller.Controller, rp mediaprovider.RadioProvider,
|
|||||||
a.list.OnPlay = a.onPlay
|
a.list.OnPlay = a.onPlay
|
||||||
a.list.OnQueue = a.onQueue
|
a.list.OnQueue = a.onQueue
|
||||||
a.searcher = widgets.NewSearchEntry()
|
a.searcher = widgets.NewSearchEntry()
|
||||||
a.searcher.PlaceHolder = "Search page"
|
a.searcher.PlaceHolder = lang.L("Search page")
|
||||||
a.searcher.OnSearched = a.onSearched
|
a.searcher.OnSearched = a.onSearched
|
||||||
a.searcher.Entry.Text = searchText
|
a.searcher.Entry.Text = searchText
|
||||||
|
|
||||||
a.noRadiosMsg = container.NewCenter(widgets.NewInfoMessage(
|
a.noRadiosMsg = container.NewCenter(widgets.NewInfoMessage(
|
||||||
"No radio stations available",
|
lang.L("No radio stations available"),
|
||||||
"Configure your music server to add radio stations",
|
lang.L("Configure your music server to add radio stations"),
|
||||||
))
|
))
|
||||||
a.noRadiosMsg.Hide()
|
a.noRadiosMsg.Hide()
|
||||||
|
|
||||||
@@ -314,21 +315,21 @@ func NewRadioList(nowPlayingIDPtr *string) *RadioList {
|
|||||||
|
|
||||||
func (a *RadioList) showMenu(pos fyne.Position) {
|
func (a *RadioList) showMenu(pos fyne.Position) {
|
||||||
if a.menu == nil {
|
if a.menu == nil {
|
||||||
play := fyne.NewMenuItem("Play", func() {
|
play := fyne.NewMenuItem(lang.L("Play"), func() {
|
||||||
if a.OnPlay != nil {
|
if a.OnPlay != nil {
|
||||||
a.OnPlay(a.selected.Item)
|
a.OnPlay(a.selected.Item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
play.Icon = theme.MediaPlayIcon()
|
play.Icon = theme.MediaPlayIcon()
|
||||||
|
|
||||||
playNext := fyne.NewMenuItem("Play next", func() {
|
playNext := fyne.NewMenuItem(lang.L("Play next"), func() {
|
||||||
if a.OnQueue != nil {
|
if a.OnQueue != nil {
|
||||||
a.OnQueue(a.selected.Item, true)
|
a.OnQueue(a.selected.Item, true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
playNext.Icon = myTheme.PlayNextIcon
|
playNext.Icon = myTheme.PlayNextIcon
|
||||||
|
|
||||||
append := fyne.NewMenuItem("Add to queue", func() {
|
append := fyne.NewMenuItem(lang.L("Add to queue"), func() {
|
||||||
if a.OnQueue != nil {
|
if a.OnQueue != nil {
|
||||||
a.OnQueue(a.selected.Item, false)
|
a.OnQueue(a.selected.Item, false)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import (
|
|||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
|
"fyne.io/fyne/v2/lang"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
)
|
)
|
||||||
@@ -65,11 +66,11 @@ func NewTracksPage(contr *controller.Controller, conf *backend.TracksPageConfig,
|
|||||||
}
|
}
|
||||||
contr.ConnectTracklistActions(t.tracklist)
|
contr.ConnectTracklistActions(t.tracklist)
|
||||||
|
|
||||||
t.title = widget.NewRichTextWithText("All Tracks")
|
t.title = widget.NewRichTextWithText(lang.L("All Tracks"))
|
||||||
t.title.Segments[0].(*widget.TextSegment).Style.SizeName = widget.RichTextStyleHeading.SizeName
|
t.title.Segments[0].(*widget.TextSegment).Style.SizeName = widget.RichTextStyleHeading.SizeName
|
||||||
t.playRandom = widget.NewButtonWithIcon("Play random", theme.ShuffleIcon, t.playRandomSongs)
|
t.playRandom = widget.NewButtonWithIcon(lang.L("Play random"), theme.ShuffleIcon, t.playRandomSongs)
|
||||||
t.searcher = widgets.NewSearchEntry()
|
t.searcher = widgets.NewSearchEntry()
|
||||||
t.searcher.PlaceHolder = "Search page"
|
t.searcher.PlaceHolder = lang.L("Search page")
|
||||||
t.searcher.OnSearched = t.OnSearched
|
t.searcher.OnSearched = t.OnSearched
|
||||||
t.createContainer()
|
t.createContainer()
|
||||||
t.Reload()
|
t.Reload()
|
||||||
|
|||||||
Reference in New Issue
Block a user