Skip to content

Add localization support via fyne.io/fyne/v2/lang - #14

Open
olegmlsn wants to merge 1 commit into
fynelabs:mainfrom
olegmlsn:main
Open

olegmlsn wants to merge 1 commit into
fynelabs:mainfrom
olegmlsn:main

Conversation

@olegmlsn

Copy link
Copy Markdown

Adds support for Fyne's standard localization package (lang) to fyneselfupdate. All strings shown in the update/restart confirmation dialogs and the download progress dialog are now passed through lang.L(...), so they will be translated if the consuming application provides a matching translation bundle and simply fall back to English otherwise.

No breaking changes to the public API. Behavior is unchanged for applications that don't call lang.AddTranslations* dialogs still show the same English text as before (used as the fallback).

@andydotxyz andydotxyz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great update thanks, but very wordy in the comments / doc - can you trim?

Comment thread README.md
func NewExitCallback(app fyne.App, win fyne.Window)
```

## Localization

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a huge amount of text for a small addition. One of the nice things about using standard language package should be that it doesn't need a lot of setup etc. Can this be trimmed to the essentials?

Comment thread confirm.go
}()
}
d = dialog.NewConfirm("Application Update", info+"\n\nDo you wish to update?\n", func(ok bool) {
// info comes from the selfupdate package (e.g. "New version found) and is looked

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note about where info comes from is helpful - but adding info about how lang.L works is superfluous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants