more translation prep

This commit is contained in:
Drew Weymouth
2024-07-21 11:10:01 -07:00
parent 48db088af7
commit 0d2bca0a84
6 changed files with 53 additions and 26 deletions
+22
View File
@@ -4,23 +4,38 @@
"Album": "Album", "Album": "Album",
"Album count": "Album count", "Album count": "Album count",
"Album gain": "Album gain", "Album gain": "Album gain",
"Album info not available": "Album info not available",
"Album peak": "Album peak", "Album peak": "Album peak",
"All Tracks": "All Tracks", "All Tracks": "All Tracks",
"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.",
"Cancel": "Cancel",
"Close": "Close",
"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",
"Create new playlist": "Create new playlist",
"Delete Playlist": "Delete Playlist",
"Description": "Description",
"Discography": "Discography", "Discography": "Discography",
"Download": "Download", "Download": "Download",
"Duration": "Duration", "Duration": "Duration",
"Edit": "Edit", "Edit": "Edit",
"Edit Playlist": "Edit Playlist",
"Enter": "Enter",
"Favorites": "Favorites", "Favorites": "Favorites",
"Genre": "Genre", "Genre": "Genre",
"Genres": "Genres", "Genres": "Genres",
"Internet Radio Stations": "Internet Radio Stations", "Internet Radio Stations": "Internet Radio Stations",
"Login to Server": "Login to Server",
"Lyrics": "Lyrics", "Lyrics": "Lyrics",
"My Server": "My Server",
"Name": "Name", "Name": "Name",
"Nickname": "Nickname",
"No radio stations available": "No radio stations available", "No radio stations available": "No radio stations available",
"OK": "OK",
"(optional)": "(optional)",
"Password": "Password",
"Play": "Play", "Play": "Play",
"Playlist": "Playlist", "Playlist": "Playlist",
"Playlists": "Playlists", "Playlists": "Playlists",
@@ -33,10 +48,14 @@
"Related": "Related", "Related": "Related",
"Remove from playlist": "Remove from playlist", "Remove from playlist": "Remove from playlist",
"Search page": "Search page", "Search page": "Search page",
"Search playlists or new playlist name": "Search playlists or new playlist name",
"Server": "Server",
"Server Type": "Server Type",
"Share": "Share", "Share": "Share",
"Show info": "Show info", "Show info": "Show info",
"Shuffle": "Shuffle", "Shuffle": "Shuffle",
"Similar artists": "Similar artists", "Similar artists": "Similar artists",
"Skip duplicate tracks": "Skip duplicate tracks",
"Title": "Title", "Title": "Title",
"Top Tracks": "Top Tracks", "Top Tracks": "Top Tracks",
"Track": "Track", "Track": "Track",
@@ -45,5 +64,8 @@
"Track count": "Track count", "Track count": "Track count",
"Track gain": "Track gain", "Track gain": "Track gain",
"Track peak": "Track peak", "Track peak": "Track peak",
"URL": "URL",
"Use legacy authentication": "Use legacy authentication",
"Username": "Username",
"Year": "Year" "Year": "Year"
} }
+12 -11
View File
@@ -6,6 +6,7 @@ import (
"fyne.io/fyne/v2" "fyne.io/fyne/v2"
"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/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"
@@ -46,7 +47,7 @@ func NewAddEditServerDialog(title string, cancelable bool, prefillServer *backen
titleLabel := widget.NewLabel(title) titleLabel := widget.NewLabel(title)
titleLabel.TextStyle.Bold = true titleLabel.TextStyle.Bold = true
legacyAuthCheck := widget.NewCheckWithData("Use legacy authentication", binding.BindBool(&a.LegacyAuth)) legacyAuthCheck := widget.NewCheckWithData(lang.L("Use legacy authentication"), binding.BindBool(&a.LegacyAuth))
serverTypeChoice := widget.NewRadioGroup([]string{"Subsonic", "Jellyfin"}, func(s string) { serverTypeChoice := widget.NewRadioGroup([]string{"Subsonic", "Jellyfin"}, func(s string) {
a.ServerType = backend.ServerType(s) a.ServerType = backend.ServerType(s)
if s == string(backend.ServerTypeSubsonic) { if s == string(backend.ServerTypeSubsonic) {
@@ -67,15 +68,15 @@ func NewAddEditServerDialog(title string, cancelable bool, prefillServer *backen
userField := widget.NewEntryWithData(binding.BindString(&a.Username)) userField := widget.NewEntryWithData(binding.BindString(&a.Username))
userField.OnSubmitted = func(_ string) { focusHandler(a.passField) } userField.OnSubmitted = func(_ string) { focusHandler(a.passField) }
altHostField := widget.NewEntryWithData(binding.BindString(&a.AltHost)) altHostField := widget.NewEntryWithData(binding.BindString(&a.AltHost))
altHostField.SetPlaceHolder("(optional) https://my-external-domain.net/music") altHostField.SetPlaceHolder(lang.L("(optional)") + " https://my-external-domain.net/music")
altHostField.OnSubmitted = func(_ string) { focusHandler(userField) } altHostField.OnSubmitted = func(_ string) { focusHandler(userField) }
hostField := widget.NewEntryWithData(binding.BindString(&a.Host)) hostField := widget.NewEntryWithData(binding.BindString(&a.Host))
hostField.SetPlaceHolder("http://localhost:4533") hostField.SetPlaceHolder("http://localhost:4533")
hostField.OnSubmitted = func(_ string) { focusHandler(altHostField) } hostField.OnSubmitted = func(_ string) { focusHandler(altHostField) }
nickField := widget.NewEntryWithData(binding.BindString(&a.Nickname)) nickField := widget.NewEntryWithData(binding.BindString(&a.Nickname))
nickField.SetPlaceHolder("My Server") nickField.SetPlaceHolder(lang.L("My Server"))
nickField.OnSubmitted = func(_ string) { focusHandler(hostField) } nickField.OnSubmitted = func(_ string) { focusHandler(hostField) }
a.submitBtn = widget.NewButton("Enter", a.doSubmit) a.submitBtn = widget.NewButton(lang.L("Enter"), a.doSubmit)
a.submitBtn.Importance = widget.HighImportance a.submitBtn.Importance = widget.HighImportance
a.promptText = widget.NewRichTextWithText("") a.promptText = widget.NewRichTextWithText("")
a.promptText.Hidden = true a.promptText.Hidden = true
@@ -85,7 +86,7 @@ func NewAddEditServerDialog(title string, cancelable bool, prefillServer *backen
bottomRow = container.NewHBox( bottomRow = container.NewHBox(
a.promptText, a.promptText,
layout.NewSpacer(), layout.NewSpacer(),
widget.NewButton("Cancel", a.onCancel), widget.NewButton(lang.L("Cancel"), a.onCancel),
a.submitBtn) a.submitBtn)
} else { } else {
bottomRow = container.NewHBox( bottomRow = container.NewHBox(
@@ -97,17 +98,17 @@ func NewAddEditServerDialog(title string, cancelable bool, prefillServer *backen
a.container = container.NewVBox( a.container = container.NewVBox(
container.NewHBox(layout.NewSpacer(), titleLabel, layout.NewSpacer()), container.NewHBox(layout.NewSpacer(), titleLabel, layout.NewSpacer()),
container.New(layout.NewFormLayout(), container.New(layout.NewFormLayout(),
widget.NewLabel("Type"), widget.NewLabel(lang.L("Server Type")),
serverTypeChoice, serverTypeChoice,
widget.NewLabel("Nickname"), widget.NewLabel(lang.L("Nickname")),
nickField, nickField,
widget.NewLabel("URL"), widget.NewLabel(lang.L("URL")),
hostField, hostField,
widget.NewLabel("Alt. URL"), widget.NewLabel(lang.L("Alt. URL")),
altHostField, altHostField,
widget.NewLabel("Username"), widget.NewLabel(lang.L("Username")),
userField, userField,
widget.NewLabel("Password"), widget.NewLabel(lang.L("Password")),
a.passField, a.passField,
), ),
container.NewHBox(layout.NewSpacer(), legacyAuthCheck), container.NewHBox(layout.NewSpacer(), legacyAuthCheck),
+3 -2
View File
@@ -11,6 +11,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"
@@ -36,7 +37,7 @@ func NewAlbumInfoDialog(albumInfo *mediaprovider.AlbumInfo, albumName string, al
widget.NewSeparator(), widget.NewSeparator(),
container.NewHBox( container.NewHBox(
layout.NewSpacer(), layout.NewSpacer(),
widget.NewButton("Close", func() { widget.NewButton(lang.L("Close"), func() {
if a.OnDismiss != nil { if a.OnDismiss != nil {
a.OnDismiss() a.OnDismiss()
} }
@@ -61,7 +62,7 @@ func (a *AlbumInfoDialog) buildMainContainer(albumInfo *mediaprovider.AlbumInfo,
title.Segments[0].(*widget.TextSegment).Style.Alignment = fyne.TextAlignCenter title.Segments[0].(*widget.TextSegment).Style.Alignment = fyne.TextAlignCenter
title.Truncation = fyne.TextTruncateEllipsis title.Truncation = fyne.TextTruncateEllipsis
infoContent := widget.NewLabel("Album info not available") infoContent := widget.NewLabel(lang.L("Album info not available"))
if albumInfo.Notes != "" { if albumInfo.Notes != "" {
infoContent = a.infoLabel(albumInfo.Notes) infoContent = a.infoLabel(albumInfo.Notes)
+8 -7
View File
@@ -4,6 +4,7 @@ import (
"fyne.io/fyne/v2" "fyne.io/fyne/v2"
"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/lang"
"fyne.io/fyne/v2/layout" "fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/widget"
"github.com/dweymouth/supersonic/backend/mediaprovider" "github.com/dweymouth/supersonic/backend/mediaprovider"
@@ -31,33 +32,33 @@ func NewEditPlaylistDialog(playlist *mediaprovider.Playlist, showPublicCheck boo
} }
e.ExtendBaseWidget(e) e.ExtendBaseWidget(e)
isPublicCheck := widget.NewCheckWithData("Public", binding.BindBool(&e.IsPublic)) isPublicCheck := widget.NewCheckWithData(lang.L("Public"), binding.BindBool(&e.IsPublic))
isPublicCheck.Hidden = !showPublicCheck isPublicCheck.Hidden = !showPublicCheck
nameEntry := widget.NewEntryWithData(binding.BindString(&e.Name)) nameEntry := widget.NewEntryWithData(binding.BindString(&e.Name))
descriptionEntry := widget.NewEntryWithData(binding.BindString(&e.Description)) descriptionEntry := widget.NewEntryWithData(binding.BindString(&e.Description))
deleteBtn := widget.NewButton("Delete Playlist", func() { deleteBtn := widget.NewButton(lang.L("Delete Playlist"), func() {
if e.OnDeletePlaylist != nil { if e.OnDeletePlaylist != nil {
e.OnDeletePlaylist() e.OnDeletePlaylist()
} }
}) })
submitBtn := widget.NewButton("OK", func() { submitBtn := widget.NewButton(lang.L("OK"), func() {
if e.OnUpdateMetadata != nil { if e.OnUpdateMetadata != nil {
e.OnUpdateMetadata() e.OnUpdateMetadata()
} }
}) })
submitBtn.Importance = widget.HighImportance submitBtn.Importance = widget.HighImportance
cancelBtn := widget.NewButton("Cancel", func() { cancelBtn := widget.NewButton(lang.L("Cancel"), func() {
if e.OnCanceled != nil { if e.OnCanceled != nil {
e.OnCanceled() e.OnCanceled()
} }
}) })
e.container = container.NewVBox( e.container = container.NewVBox(
container.NewHBox(layout.NewSpacer(), widget.NewLabel("Edit Playlist"), layout.NewSpacer()), container.NewHBox(layout.NewSpacer(), widget.NewLabel(lang.L("Edit Playlist")), layout.NewSpacer()),
container.New(layout.NewFormLayout(), container.New(layout.NewFormLayout(),
widget.NewLabel("Name"), widget.NewLabel(lang.L("Name")),
nameEntry, nameEntry,
widget.NewLabel("Description"), widget.NewLabel(lang.L("Description")),
descriptionEntry, descriptionEntry,
), ),
container.NewHBox(isPublicCheck, layout.NewSpacer(), deleteBtn), container.NewHBox(isPublicCheck, layout.NewSpacer(), deleteBtn),
+5 -4
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"
@@ -37,7 +38,7 @@ var _ fyne.Widget = (*LoginDialog)(nil)
func NewLoginDialog(servers []*backend.ServerConfig, pwFetch PasswordFetchFunc) *LoginDialog { func NewLoginDialog(servers []*backend.ServerConfig, pwFetch PasswordFetchFunc) *LoginDialog {
l := &LoginDialog{servers: servers} l := &LoginDialog{servers: servers}
l.ExtendBaseWidget(l) l.ExtendBaseWidget(l)
titleLabel := widget.NewLabel("Login to Server") titleLabel := widget.NewLabel(lang.L("Login to Server"))
titleLabel.TextStyle.Bold = true titleLabel.TextStyle.Bold = true
l.passField = widget.NewPasswordEntry() l.passField = widget.NewPasswordEntry()
l.passField.OnSubmitted = func(_ string) { l.onSubmit() } l.passField.OnSubmitted = func(_ string) { l.onSubmit() }
@@ -57,7 +58,7 @@ func NewLoginDialog(servers []*backend.ServerConfig, pwFetch PasswordFetchFunc)
editBtn := widget.NewButtonWithIcon("", theme.DocumentCreateIcon(), l.onEditServer) editBtn := widget.NewButtonWithIcon("", theme.DocumentCreateIcon(), l.onEditServer)
newBtn := widget.NewButtonWithIcon("", theme.ContentAddIcon(), l.onNewServer) newBtn := widget.NewButtonWithIcon("", theme.ContentAddIcon(), l.onNewServer)
deleteBtn := widget.NewButtonWithIcon("", theme.DeleteIcon(), func() { l.onDeleteServer(l.serverSelect.SelectedIndex()) }) deleteBtn := widget.NewButtonWithIcon("", theme.DeleteIcon(), func() { l.onDeleteServer(l.serverSelect.SelectedIndex()) })
l.submitBtn = widget.NewButton("OK", l.onSubmit) l.submitBtn = widget.NewButton(lang.L("OK"), l.onSubmit)
l.submitBtn.Importance = widget.HighImportance l.submitBtn.Importance = widget.HighImportance
l.promptText = widget.NewRichTextWithText("") l.promptText = widget.NewRichTextWithText("")
l.promptText.Segments[0].(*widget.TextSegment).Style.ColorName = theme.ColorNameError l.promptText.Segments[0].(*widget.TextSegment).Style.ColorName = theme.ColorNameError
@@ -66,9 +67,9 @@ func NewLoginDialog(servers []*backend.ServerConfig, pwFetch PasswordFetchFunc)
l.container = container.NewVBox( l.container = container.NewVBox(
container.NewHBox(layout.NewSpacer(), titleLabel, layout.NewSpacer()), container.NewHBox(layout.NewSpacer(), titleLabel, layout.NewSpacer()),
container.New(layout.NewFormLayout(), container.New(layout.NewFormLayout(),
widget.NewLabel("Server"), widget.NewLabel(lang.L("Server")),
container.NewBorder(nil, nil, nil, container.NewHBox(editBtn, newBtn, deleteBtn), l.serverSelect), container.NewBorder(nil, nil, nil, container.NewHBox(editBtn, newBtn, deleteBtn), l.serverSelect),
widget.NewLabel("Password"), widget.NewLabel(lang.L("Password")),
l.passField), l.passField),
widget.NewSeparator(), widget.NewSeparator(),
container.NewHBox(l.promptText, layout.NewSpacer(), l.submitBtn), container.NewHBox(l.promptText, layout.NewSpacer(), l.submitBtn),
+3 -2
View File
@@ -8,6 +8,7 @@ import (
"fyne.io/fyne/v2" "fyne.io/fyne/v2"
"fyne.io/fyne/v2/data/binding" "fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/lang"
"fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/widget"
"github.com/deluan/sanitize" "github.com/deluan/sanitize"
"github.com/dweymouth/supersonic/backend/mediaprovider" "github.com/dweymouth/supersonic/backend/mediaprovider"
@@ -35,7 +36,7 @@ func NewSelectPlaylistDialog(mp mediaprovider.MediaProvider, im util.ImageFetche
"Cancel", "Cancel",
sp.onSearched, sp.onSearched,
) )
sd.ActionItem = widget.NewCheckWithData("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 = "Search playlists or new playlist name"
sp.SearchDialog = sd sp.SearchDialog = sd
return sp return sp
@@ -82,7 +83,7 @@ func (sp *SelectPlaylist) onSearched(query string) []*mediaprovider.SearchResult
) )
}) })
results = append(results, &mediaprovider.SearchResult{ results = append(results, &mediaprovider.SearchResult{
Name: fmt.Sprintf("Create new playlist: %s", query), Name: fmt.Sprintf("%s: %s", lang.L("Create new playlist"), query),
Type: mediaprovider.ContentTypePlaylist, Type: mediaprovider.ContentTypePlaylist,
}) })
} }