more translation prep
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/data/binding"
|
||||
"fyne.io/fyne/v2/lang"
|
||||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
@@ -46,7 +47,7 @@ func NewAddEditServerDialog(title string, cancelable bool, prefillServer *backen
|
||||
|
||||
titleLabel := widget.NewLabel(title)
|
||||
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) {
|
||||
a.ServerType = backend.ServerType(s)
|
||||
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.OnSubmitted = func(_ string) { focusHandler(a.passField) }
|
||||
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) }
|
||||
hostField := widget.NewEntryWithData(binding.BindString(&a.Host))
|
||||
hostField.SetPlaceHolder("http://localhost:4533")
|
||||
hostField.OnSubmitted = func(_ string) { focusHandler(altHostField) }
|
||||
nickField := widget.NewEntryWithData(binding.BindString(&a.Nickname))
|
||||
nickField.SetPlaceHolder("My Server")
|
||||
nickField.SetPlaceHolder(lang.L("My Server"))
|
||||
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.promptText = widget.NewRichTextWithText("")
|
||||
a.promptText.Hidden = true
|
||||
@@ -85,7 +86,7 @@ func NewAddEditServerDialog(title string, cancelable bool, prefillServer *backen
|
||||
bottomRow = container.NewHBox(
|
||||
a.promptText,
|
||||
layout.NewSpacer(),
|
||||
widget.NewButton("Cancel", a.onCancel),
|
||||
widget.NewButton(lang.L("Cancel"), a.onCancel),
|
||||
a.submitBtn)
|
||||
} else {
|
||||
bottomRow = container.NewHBox(
|
||||
@@ -97,17 +98,17 @@ func NewAddEditServerDialog(title string, cancelable bool, prefillServer *backen
|
||||
a.container = container.NewVBox(
|
||||
container.NewHBox(layout.NewSpacer(), titleLabel, layout.NewSpacer()),
|
||||
container.New(layout.NewFormLayout(),
|
||||
widget.NewLabel("Type"),
|
||||
widget.NewLabel(lang.L("Server Type")),
|
||||
serverTypeChoice,
|
||||
widget.NewLabel("Nickname"),
|
||||
widget.NewLabel(lang.L("Nickname")),
|
||||
nickField,
|
||||
widget.NewLabel("URL"),
|
||||
widget.NewLabel(lang.L("URL")),
|
||||
hostField,
|
||||
widget.NewLabel("Alt. URL"),
|
||||
widget.NewLabel(lang.L("Alt. URL")),
|
||||
altHostField,
|
||||
widget.NewLabel("Username"),
|
||||
widget.NewLabel(lang.L("Username")),
|
||||
userField,
|
||||
widget.NewLabel("Password"),
|
||||
widget.NewLabel(lang.L("Password")),
|
||||
a.passField,
|
||||
),
|
||||
container.NewHBox(layout.NewSpacer(), legacyAuthCheck),
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/canvas"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/lang"
|
||||
|
||||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
@@ -36,7 +37,7 @@ func NewAlbumInfoDialog(albumInfo *mediaprovider.AlbumInfo, albumName string, al
|
||||
widget.NewSeparator(),
|
||||
container.NewHBox(
|
||||
layout.NewSpacer(),
|
||||
widget.NewButton("Close", func() {
|
||||
widget.NewButton(lang.L("Close"), func() {
|
||||
if a.OnDismiss != nil {
|
||||
a.OnDismiss()
|
||||
}
|
||||
@@ -61,7 +62,7 @@ func (a *AlbumInfoDialog) buildMainContainer(albumInfo *mediaprovider.AlbumInfo,
|
||||
title.Segments[0].(*widget.TextSegment).Style.Alignment = fyne.TextAlignCenter
|
||||
title.Truncation = fyne.TextTruncateEllipsis
|
||||
|
||||
infoContent := widget.NewLabel("Album info not available")
|
||||
infoContent := widget.NewLabel(lang.L("Album info not available"))
|
||||
|
||||
if albumInfo.Notes != "" {
|
||||
infoContent = a.infoLabel(albumInfo.Notes)
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/data/binding"
|
||||
"fyne.io/fyne/v2/lang"
|
||||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
||||
@@ -31,33 +32,33 @@ func NewEditPlaylistDialog(playlist *mediaprovider.Playlist, showPublicCheck boo
|
||||
}
|
||||
e.ExtendBaseWidget(e)
|
||||
|
||||
isPublicCheck := widget.NewCheckWithData("Public", binding.BindBool(&e.IsPublic))
|
||||
isPublicCheck := widget.NewCheckWithData(lang.L("Public"), binding.BindBool(&e.IsPublic))
|
||||
isPublicCheck.Hidden = !showPublicCheck
|
||||
nameEntry := widget.NewEntryWithData(binding.BindString(&e.Name))
|
||||
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 {
|
||||
e.OnDeletePlaylist()
|
||||
}
|
||||
})
|
||||
submitBtn := widget.NewButton("OK", func() {
|
||||
submitBtn := widget.NewButton(lang.L("OK"), func() {
|
||||
if e.OnUpdateMetadata != nil {
|
||||
e.OnUpdateMetadata()
|
||||
}
|
||||
})
|
||||
submitBtn.Importance = widget.HighImportance
|
||||
cancelBtn := widget.NewButton("Cancel", func() {
|
||||
cancelBtn := widget.NewButton(lang.L("Cancel"), func() {
|
||||
if e.OnCanceled != nil {
|
||||
e.OnCanceled()
|
||||
}
|
||||
})
|
||||
|
||||
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(),
|
||||
widget.NewLabel("Name"),
|
||||
widget.NewLabel(lang.L("Name")),
|
||||
nameEntry,
|
||||
widget.NewLabel("Description"),
|
||||
widget.NewLabel(lang.L("Description")),
|
||||
descriptionEntry,
|
||||
),
|
||||
container.NewHBox(isPublicCheck, layout.NewSpacer(), deleteBtn),
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/lang"
|
||||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
@@ -37,7 +38,7 @@ var _ fyne.Widget = (*LoginDialog)(nil)
|
||||
func NewLoginDialog(servers []*backend.ServerConfig, pwFetch PasswordFetchFunc) *LoginDialog {
|
||||
l := &LoginDialog{servers: servers}
|
||||
l.ExtendBaseWidget(l)
|
||||
titleLabel := widget.NewLabel("Login to Server")
|
||||
titleLabel := widget.NewLabel(lang.L("Login to Server"))
|
||||
titleLabel.TextStyle.Bold = true
|
||||
l.passField = widget.NewPasswordEntry()
|
||||
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)
|
||||
newBtn := widget.NewButtonWithIcon("", theme.ContentAddIcon(), l.onNewServer)
|
||||
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.promptText = widget.NewRichTextWithText("")
|
||||
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(
|
||||
container.NewHBox(layout.NewSpacer(), titleLabel, layout.NewSpacer()),
|
||||
container.New(layout.NewFormLayout(),
|
||||
widget.NewLabel("Server"),
|
||||
widget.NewLabel(lang.L("Server")),
|
||||
container.NewBorder(nil, nil, nil, container.NewHBox(editBtn, newBtn, deleteBtn), l.serverSelect),
|
||||
widget.NewLabel("Password"),
|
||||
widget.NewLabel(lang.L("Password")),
|
||||
l.passField),
|
||||
widget.NewSeparator(),
|
||||
container.NewHBox(l.promptText, layout.NewSpacer(), l.submitBtn),
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/data/binding"
|
||||
"fyne.io/fyne/v2/lang"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/deluan/sanitize"
|
||||
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
||||
@@ -35,7 +36,7 @@ func NewSelectPlaylistDialog(mp mediaprovider.MediaProvider, im util.ImageFetche
|
||||
"Cancel",
|
||||
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"
|
||||
sp.SearchDialog = sd
|
||||
return sp
|
||||
@@ -82,7 +83,7 @@ func (sp *SelectPlaylist) onSearched(query string) []*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,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user