add more translation entries

This commit is contained in:
Drew Weymouth
2024-07-21 11:12:55 -07:00
parent 0d2bca0a84
commit 1096e4434b
4 changed files with 70 additions and 42 deletions
+30 -4
View File
@@ -6,27 +6,43 @@
"Album gain": "Album gain", "Album gain": "Album gain",
"Album info not available": "Album info not available", "Album info not available": "Album info not available",
"Album peak": "Album peak", "Album peak": "Album peak",
"Albums": "Albums",
"All Tracks": "All Tracks", "All Tracks": "All Tracks",
"Alt. URL": "Alt. URL", "Alt. URL": "Alt. URL",
"Artist": "Artist", "Artist": "Artist",
"Artists": "Artists", "Artists": "Artists",
"Artist biography not available.": "Artist biography not available.", "Artist biography not available.": "Artist biography not available.",
"Bit rate": "Bit rate",
"BPM": "BPM",
"Cancel": "Cancel", "Cancel": "Cancel",
"Close": "Close", "Close": "Close",
"Close to system tray": "Close to system tray",
"Comment": "Comment",
"Composer": "Composer",
"Configure your music server to add radio stations": "Configure your music server to add radio stations", "Configure your music server to add radio stations": "Configure your music server to add radio stations",
"Content type": "Content type",
"Create new playlist": "Create new playlist", "Create new playlist": "Create new playlist",
"Delete Playlist": "Delete Playlist", "Delete Playlist": "Delete Playlist",
"Description": "Description", "Description": "Description",
"Disable server transcoding": "Disable server transcoding",
"Disc number": "Disc number",
"Discography": "Discography", "Discography": "Discography",
"Download": "Download", "Download": "Download",
"Duration": "Duration", "Duration": "Duration",
"Edit": "Edit", "Edit": "Edit",
"Edit Playlist": "Edit Playlist", "Edit Playlist": "Edit Playlist",
"Enable system tray": "Enable system tray",
"Enabled": "Enabled",
"Enter": "Enter", "Enter": "Enter",
"Equalizer": "Equalizer",
"Favorites": "Favorites", "Favorites": "Favorites",
"File path": "File path",
"File size": "File size",
"General": "General",
"Genre": "Genre", "Genre": "Genre",
"Genres": "Genres", "Genres": "Genres",
"Internet Radio Stations": "Internet Radio Stations", "Internet Radio Stations": "Internet Radio Stations",
"Last played": "Last played",
"Login to Server": "Login to Server", "Login to Server": "Login to Server",
"Lyrics": "Lyrics", "Lyrics": "Lyrics",
"My Server": "My Server", "My Server": "My Server",
@@ -37,33 +53,43 @@
"(optional)": "(optional)", "(optional)": "(optional)",
"Password": "Password", "Password": "Password",
"Play": "Play", "Play": "Play",
"Playlist": "Playlist", "Play count": "Play count",
"Playlists": "Playlists",
"playlist by": "playlist by",
"Play next": "Play next", "Play next": "Play next",
"Play Queue": "Play Queue", "Play Queue": "Play Queue",
"Play random": "Play random", "Play random": "Play random",
"Playlist": "Playlist",
"Playlists": "Playlists",
"playlist by": "playlist by",
"Private": "Private", "Private": "Private",
"Public": "Public", "Public": "Public",
"Related": "Related", "Related": "Related",
"Remove from playlist": "Remove from playlist", "Remove from playlist": "Remove from playlist",
"Restart required": "Restart required",
"Save play queue on exit": "Save play queue on exit",
"Search page": "Search page", "Search page": "Search page",
"Search playlists or new playlist name": "Search playlists or new playlist name", "Search playlists or new playlist name": "Search playlists or new playlist name",
"Send playback statistics to server": "Send playback statistics to server",
"Server": "Server", "Server": "Server",
"Server Type": "Server Type", "Server Type": "Server Type",
"Share": "Share", "Share": "Share",
"Show info": "Show info", "Show info": "Show info",
"Show notification on track change": "Show notification on track change",
"Show year in album grid cards": "Show year in album grid cards",
"Shuffle": "Shuffle", "Shuffle": "Shuffle",
"Similar artists": "Similar artists", "Similar artists": "Similar artists",
"Skip duplicate tracks": "Skip duplicate tracks", "Skip duplicate tracks": "Skip duplicate tracks",
"Startup page": "Startup page",
"Theme": "Theme",
"Title": "Title", "Title": "Title",
"Top Tracks": "Top Tracks", "Top Tracks": "Top Tracks",
"Track": "Track", "Track": "Track",
"track": "track", "track": "track",
"tracks": "tracks",
"Track count": "Track count", "Track count": "Track count",
"Track gain": "Track gain", "Track gain": "Track gain",
"Track Info": "Track Info",
"Track number": "Track number",
"Track peak": "Track peak", "Track peak": "Track peak",
"tracks": "tracks",
"URL": "URL", "URL": "URL",
"Use legacy authentication": "Use legacy authentication", "Use legacy authentication": "Use legacy authentication",
"Username": "Username", "Username": "Username",
+3 -3
View File
@@ -32,12 +32,12 @@ func NewSelectPlaylistDialog(mp mediaprovider.MediaProvider, im util.ImageFetche
} }
sd := NewSearchDialog( sd := NewSearchDialog(
im, im,
"Add to playlist", lang.L("Add to playlist"),
"Cancel", lang.L("Cancel"),
sp.onSearched, sp.onSearched,
) )
sd.ActionItem = widget.NewCheckWithData(lang.L("Skip duplicate tracks"), binding.BindBool(&sp.SkipDuplicates)) sd.ActionItem = widget.NewCheckWithData(lang.L("Skip duplicate tracks"), binding.BindBool(&sp.SkipDuplicates))
sd.PlaceholderText = "Search playlists or new playlist name" sd.PlaceholderText = lang.L("Search playlists or new playlist name")
sp.SearchDialog = sd sp.SearchDialog = sd
return sp return sp
} }
+14 -13
View File
@@ -19,6 +19,7 @@ import (
"fyne.io/fyne/v2/container" "fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/data/binding" "fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/dialog" "fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/lang"
"fyne.io/fyne/v2/layout" "fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/storage" "fyne.io/fyne/v2/storage"
"fyne.io/fyne/v2/theme" "fyne.io/fyne/v2/theme"
@@ -138,12 +139,12 @@ func (s *SettingsDialog) createGeneralTab(canSaveQueueToServer bool) *container.
if startupPage.Selected == "" { if startupPage.Selected == "" {
startupPage.SetSelectedIndex(0) startupPage.SetSelectedIndex(0)
} }
closeToTray := widget.NewCheckWithData("Close to system tray", closeToTray := widget.NewCheckWithData(lang.L("Close to system tray"),
binding.BindBool(&s.config.Application.CloseToSystemTray)) binding.BindBool(&s.config.Application.CloseToSystemTray))
if !s.config.Application.EnableSystemTray { if !s.config.Application.EnableSystemTray {
closeToTray.Disable() closeToTray.Disable()
} }
systemTrayEnable := widget.NewCheck("Enable system tray", func(val bool) { systemTrayEnable := widget.NewCheck(lang.L("Enable system tray"), func(val bool) {
s.config.Application.EnableSystemTray = val s.config.Application.EnableSystemTray = val
// TODO: see https://github.com/fyne-io/fyne/issues/3788 // TODO: see https://github.com/fyne-io/fyne/issues/3788
// Once Fyne supports removing/hiding an existing system tray menu, // Once Fyne supports removing/hiding an existing system tray menu,
@@ -170,7 +171,7 @@ func (s *SettingsDialog) createGeneralTab(canSaveQueueToServer bool) *container.
if s.config.Application.SaveQueueToServer { if s.config.Application.SaveQueueToServer {
saveToServer.Selected = "To server" saveToServer.Selected = "To server"
} }
saveQueue := widget.NewCheck("Save play queue on exit", func(save bool) { saveQueue := widget.NewCheck(lang.L("Save play queue on exit"), func(save bool) {
s.config.Application.SavePlayQueue = save s.config.Application.SavePlayQueue = save
if save && canSaveQueueToServer { if save && canSaveQueueToServer {
saveToServer.Enable() saveToServer.Enable()
@@ -184,9 +185,9 @@ func (s *SettingsDialog) createGeneralTab(canSaveQueueToServer bool) *container.
saveQueueHBox.Add(saveToServer) saveQueueHBox.Add(saveToServer)
} }
trackNotif := widget.NewCheckWithData("Show notification on track change", trackNotif := widget.NewCheckWithData(lang.L("Show notification on track change"),
binding.BindBool(&s.config.Application.ShowTrackChangeNotification)) binding.BindBool(&s.config.Application.ShowTrackChangeNotification))
albumGridYears := widget.NewCheck("Show year in album grid cards", func(b bool) { albumGridYears := widget.NewCheck(lang.L("Show year in album grid cards"), func(b bool) {
s.config.AlbumsPage.ShowYears = b s.config.AlbumsPage.ShowYears = b
s.config.FavoritesPage.ShowAlbumYears = b s.config.FavoritesPage.ShowAlbumYears = b
if s.OnPageNeedsRefresh != nil { if s.OnPageNeedsRefresh != nil {
@@ -256,7 +257,7 @@ func (s *SettingsDialog) createGeneralTab(canSaveQueueToServer bool) *container.
durationEnabled.Disable() durationEnabled.Disable()
} }
scrobbleEnabled := widget.NewCheck("Send playback statistics to server", func(checked bool) { scrobbleEnabled := widget.NewCheck(lang.L("Send playback statistics to server"), func(checked bool) {
s.config.Scrobbling.Enabled = checked s.config.Scrobbling.Enabled = checked
if !checked { if !checked {
percentEntry.Disable() percentEntry.Disable()
@@ -274,13 +275,13 @@ func (s *SettingsDialog) createGeneralTab(canSaveQueueToServer bool) *container.
}) })
scrobbleEnabled.Checked = s.config.Scrobbling.Enabled scrobbleEnabled.Checked = s.config.Scrobbling.Enabled
return container.NewTabItem("General", container.NewVBox( return container.NewTabItem(lang.L("General"), container.NewVBox(
container.NewBorder(nil, nil, widget.NewLabel("Theme"), /*left*/ container.NewBorder(nil, nil, widget.NewLabel(lang.L("Theme")), /*left*/
container.NewHBox(widget.NewLabel("Mode"), themeModeSelect, util.NewHSpace(5)), // right container.NewHBox(widget.NewLabel("Mode"), themeModeSelect, util.NewHSpace(5)), // right
themeFileSelect, // center themeFileSelect, // center
), ),
container.NewHBox( container.NewHBox(
widget.NewLabel("Startup page"), container.NewGridWithColumns(2, startupPage), widget.NewLabel(lang.L("Startup page")), container.NewGridWithColumns(2, startupPage),
), ),
container.NewHBox(systemTrayEnable, closeToTray), container.NewHBox(systemTrayEnable, closeToTray),
saveQueueHBox, saveQueueHBox,
@@ -304,7 +305,7 @@ func (s *SettingsDialog) createGeneralTab(canSaveQueueToServer bool) *container.
} }
func (s *SettingsDialog) createPlaybackTab(isLocalPlayer, isReplayGainPlayer bool) *container.TabItem { func (s *SettingsDialog) createPlaybackTab(isLocalPlayer, isReplayGainPlayer bool) *container.TabItem {
disableTranscode := widget.NewCheckWithData("Disable server transcoding", binding.BindBool(&s.config.Transcoding.ForceRawFile)) disableTranscode := widget.NewCheckWithData(lang.L("Disable server transcoding"), binding.BindBool(&s.config.Transcoding.ForceRawFile))
deviceList := make([]string, len(s.audioDevices)) deviceList := make([]string, len(s.audioDevices))
var selIndex int var selIndex int
for i, dev := range s.audioDevices { for i, dev := range s.audioDevices {
@@ -411,7 +412,7 @@ func (s *SettingsDialog) createPlaybackTab(isLocalPlayer, isReplayGainPlayer boo
} }
func (s *SettingsDialog) createEqualizerTab(eqBands []string) *container.TabItem { func (s *SettingsDialog) createEqualizerTab(eqBands []string) *container.TabItem {
enabled := widget.NewCheck("Enabled", func(b bool) { enabled := widget.NewCheck(lang.L("Enabled"), func(b bool) {
s.config.LocalPlayback.EqualizerEnabled = b s.config.LocalPlayback.EqualizerEnabled = b
if s.OnEqualizerSettingsChanged != nil { if s.OnEqualizerSettingsChanged != nil {
s.OnEqualizerSettingsChanged() s.OnEqualizerSettingsChanged()
@@ -435,7 +436,7 @@ func (s *SettingsDialog) createEqualizerTab(eqBands []string) *container.TabItem
debouncer() debouncer()
} }
cont := container.NewBorder(enabled, nil, nil, nil, geq) cont := container.NewBorder(enabled, nil, nil, nil, geq)
return container.NewTabItem("Equalizer", cont) return container.NewTabItem(lang.L("Equalizer"), cont)
} }
func (s *SettingsDialog) createExperimentalTab(window fyne.Window) *container.TabItem { func (s *SettingsDialog) createExperimentalTab(window fyne.Window) *container.TabItem {
@@ -524,7 +525,7 @@ func (s *SettingsDialog) setRestartRequired() {
if ts.Text != "" { if ts.Text != "" {
return return
} }
ts.Text = "Restart required" ts.Text = lang.L("Restart required")
ts.Style.ColorName = theme.ColorNameError ts.Style.ColorName = theme.ColorNameError
s.promptText.Refresh() s.promptText.Refresh()
} }
+23 -22
View File
@@ -7,6 +7,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"
@@ -36,7 +37,7 @@ func NewTrackInfoDialog(track *mediaprovider.Track) *TrackInfoDialog {
func (t *TrackInfoDialog) CreateRenderer() fyne.WidgetRenderer { func (t *TrackInfoDialog) CreateRenderer() fyne.WidgetRenderer {
c := container.New(layout.NewFormLayout()) c := container.New(layout.NewFormLayout())
addFormRow(c, "Title", t.track.Title) addFormRow(c, lang.L("Title"), t.track.Title)
c.Add(newFormText("Album", true)) c.Add(newFormText("Album", true))
album := widget.NewHyperlink(t.track.Album, nil) album := widget.NewHyperlink(t.track.Album, nil)
@@ -47,7 +48,7 @@ func (t *TrackInfoDialog) CreateRenderer() fyne.WidgetRenderer {
} }
c.Add(album) c.Add(album)
c.Add(newFormText("Artists", true)) c.Add(newFormText(lang.L("Artists"), true))
artists := widgets.NewMultiHyperlink() artists := widgets.NewMultiHyperlink()
artists.BuildSegments(t.track.ArtistNames, t.track.ArtistIDs) artists.BuildSegments(t.track.ArtistNames, t.track.ArtistIDs)
artists.OnTapped = func(id string) { artists.OnTapped = func(id string) {
@@ -58,7 +59,7 @@ func (t *TrackInfoDialog) CreateRenderer() fyne.WidgetRenderer {
c.Add(artists) c.Add(artists)
if len(t.track.ComposerNames) > 0 { if len(t.track.ComposerNames) > 0 {
c.Add(newFormText("Composers", true)) c.Add(newFormText(lang.L("Composers"), true))
composers := widgets.NewMultiHyperlink() composers := widgets.NewMultiHyperlink()
composers.BuildSegments(t.track.ComposerNames, t.track.ComposerIDs) composers.BuildSegments(t.track.ComposerNames, t.track.ComposerIDs)
artists.OnTapped = func(id string) { artists.OnTapped = func(id string) {
@@ -70,7 +71,7 @@ func (t *TrackInfoDialog) CreateRenderer() fyne.WidgetRenderer {
} }
if len(t.track.Genres) > 0 { if len(t.track.Genres) > 0 {
c.Add(newFormText("Genres", true)) c.Add(newFormText(lang.L("Genres"), true))
genres := widgets.NewMultiHyperlink() genres := widgets.NewMultiHyperlink()
genres.BuildSegments(t.track.Genres, t.track.Genres) genres.BuildSegments(t.track.Genres, t.track.Genres)
genres.OnTapped = func(g string) { genres.OnTapped = func(g string) {
@@ -81,7 +82,7 @@ func (t *TrackInfoDialog) CreateRenderer() fyne.WidgetRenderer {
c.Add(genres) c.Add(genres)
} }
addFormRow(c, "Duration", util.SecondsToTimeString(float64(t.track.Duration))) addFormRow(c, lang.L("Duration"), util.SecondsToTimeString(float64(t.track.Duration)))
copyBtn := widgets.NewIconButton(theme.ContentCopyIcon(), func() { copyBtn := widgets.NewIconButton(theme.ContentCopyIcon(), func() {
if t.OnCopyFilePath != nil { if t.OnCopyFilePath != nil {
@@ -91,39 +92,39 @@ func (t *TrackInfoDialog) CreateRenderer() fyne.WidgetRenderer {
copyBtn.IconSize = widgets.IconButtonSizeSmaller copyBtn.IconSize = widgets.IconButtonSizeSmaller
btnCtr := container.New(layout.NewCustomPaddedLayout(8, 0, 10, 0), btnCtr := container.New(layout.NewCustomPaddedLayout(8, 0, 10, 0),
container.NewVBox(copyBtn, layout.NewSpacer())) container.NewVBox(copyBtn, layout.NewSpacer()))
c.Add(container.NewHBox(btnCtr, newFormText("File path", true))) c.Add(container.NewHBox(btnCtr, newFormText(lang.L("File path"), true)))
c.Add(newFormText(t.track.FilePath, false)) c.Add(newFormText(t.track.FilePath, false))
addFormRow(c, "Comment", t.track.Comment) addFormRow(c, lang.L("Comment"), t.track.Comment)
addFormRow(c, "Year", strconv.Itoa(t.track.Year)) addFormRow(c, lang.L("Year"), strconv.Itoa(t.track.Year))
addFormRow(c, "Track number", strconv.Itoa(t.track.TrackNumber)) addFormRow(c, lang.L("Track number"), strconv.Itoa(t.track.TrackNumber))
addFormRow(c, "Disc number", strconv.Itoa(t.track.DiscNumber)) addFormRow(c, lang.L("Disc number"), strconv.Itoa(t.track.DiscNumber))
if t.track.BPM > 0 { if t.track.BPM > 0 {
addFormRow(c, "BPM", strconv.Itoa(t.track.BPM)) addFormRow(c, lang.L("BPM"), strconv.Itoa(t.track.BPM))
} }
addFormRow(c, "Content type", t.track.ContentType) addFormRow(c, lang.L("Content type"), t.track.ContentType)
addFormRow(c, "Bit rate", fmt.Sprintf("%d kbps", t.track.BitRate)) addFormRow(c, lang.L("Bit rate"), fmt.Sprintf("%d kbps", t.track.BitRate))
addFormRow(c, "File size", util.BytesToSizeString(t.track.Size)) addFormRow(c, lang.L("File size"), util.BytesToSizeString(t.track.Size))
addFormRow(c, "Play count", strconv.Itoa(t.track.PlayCount)) addFormRow(c, lang.L("Play count"), strconv.Itoa(t.track.PlayCount))
if !t.track.LastPlayed.IsZero() { if !t.track.LastPlayed.IsZero() {
addFormRow(c, "Last played", t.track.LastPlayed.Format(time.RFC1123)) addFormRow(c, lang.L("Last played"), t.track.LastPlayed.Format(time.RFC1123))
} }
if t.track.ReplayGain.TrackPeak > 0 { if t.track.ReplayGain.TrackPeak > 0 {
addFormRow(c, "Track gain", fmt.Sprintf("%0.2f dB", t.track.ReplayGain.TrackGain)) addFormRow(c, lang.L("Track gain"), fmt.Sprintf("%0.2f dB", t.track.ReplayGain.TrackGain))
addFormRow(c, "Track peak", fmt.Sprintf("%0.6f", t.track.ReplayGain.TrackPeak)) addFormRow(c, lang.L("Track peak"), fmt.Sprintf("%0.6f", t.track.ReplayGain.TrackPeak))
} }
if t.track.ReplayGain.AlbumPeak > 0 { if t.track.ReplayGain.AlbumPeak > 0 {
addFormRow(c, "Album gain", fmt.Sprintf("%0.2f dB", t.track.ReplayGain.AlbumGain)) addFormRow(c, lang.L("Album gain"), fmt.Sprintf("%0.2f dB", t.track.ReplayGain.AlbumGain))
addFormRow(c, "Album peak", fmt.Sprintf("%0.6f", t.track.ReplayGain.AlbumPeak)) addFormRow(c, lang.L("Album peak"), fmt.Sprintf("%0.6f", t.track.ReplayGain.AlbumPeak))
} }
title := widget.NewRichTextWithText("Track Info") title := widget.NewRichTextWithText(lang.L("Track Info"))
title.Segments[0].(*widget.TextSegment).Style.TextStyle.Bold = true title.Segments[0].(*widget.TextSegment).Style.TextStyle.Bold = true
dismissBtn := widget.NewButton("Close", func() { dismissBtn := widget.NewButton(lang.L("Close"), func() {
if t.OnDismiss != nil { if t.OnDismiss != nil {
t.OnDismiss() t.OnDismiss()
} }