Documentation
¶
Overview ¶
Package locales says the updater's words: its alerts where the platform's updater has no windows of its own. Apps supply other languages in their catalogs, under the key github.com/nsgo-dev/nsgo/updater/locales.
Index ¶
- Constants
- Variables
- func InstallError(cx *core.Scope) string
- func InstallErrorMessage(cx *core.Scope, app string, version string) string
- func Later(cx *core.Scope) string
- func Ok(cx *core.Scope) string
- func OpenPage(cx *core.Scope) string
- func Supply(lang string, t Translation)
- func UpToDate(cx *core.Scope) string
- func UpToDateMessage(cx *core.Scope, app string, version string) string
- func Update(cx *core.Scope) string
- func UpdateAvailable(cx *core.Scope, app string) string
- func UpdateAvailableMessage(cx *core.Scope, app string, version string, current string) string
- func UpdateChannel(cx *core.Scope) string
- func UpdateDevelopment(cx *core.Scope) string
- func UpdateError(cx *core.Scope) string
- func UpdateErrorMessage(cx *core.Scope) string
- func UpdateReadyMessage(cx *core.Scope, app string) string
- func UpdateStore(cx *core.Scope, store string) string
- type Messages
- func (msgs Messages) InstallError() string
- func (msgs Messages) InstallErrorMessage(app string, version string) string
- func (msgs Messages) Later() string
- func (msgs Messages) Ok() string
- func (msgs Messages) OpenPage() string
- func (msgs Messages) UpToDate() string
- func (msgs Messages) UpToDateMessage(app string, version string) string
- func (msgs Messages) Update() string
- func (msgs Messages) UpdateAvailable(app string) string
- func (msgs Messages) UpdateAvailableMessage(app string, version string, current string) string
- func (msgs Messages) UpdateChannel() string
- func (msgs Messages) UpdateDevelopment() string
- func (msgs Messages) UpdateError() string
- func (msgs Messages) UpdateErrorMessage() string
- func (msgs Messages) UpdateReadyMessage(app string) string
- func (msgs Messages) UpdateStore(store string) string
- type Translation
Constants ¶
const Source = "en"
Source is the language the messages are written in.
Variables ¶
var Catalog = i18n.NewCatalog("en", "zh-Hans")
Catalog holds the messages' languages: en, the source, zh-Hans, and those other packages supply.
var Parameters = map[string][]string{
"UpdateAvailable": {"app"},
"UpdateAvailableMessage": {"app", "version", "current"},
"UpdateReadyMessage": {"app"},
"UpToDateMessage": {"app", "version"},
"InstallErrorMessage": {"app", "version"},
"UpdateStore": {"store"},
}
Parameters names the parameters of each message that has some, by its method, for the TSX declarations of the messages (tsx.RegisterMessages).
Functions ¶
func InstallError ¶
InstallError says "Can’t install the update" in the language the app shows under cx.
The title of the alert saying the newer version the user chose to install could not be downloaded or installed.
func InstallErrorMessage ¶
InstallErrorMessage says "{app} {version} couldn’t be downloaded or installed. You can get it from its page instead." in the language the app shows under cx.
The alert saying the newer version could not be installed, which names it and offers its page.
func Later ¶
Later says "Later" in the language the app shows under cx.
The button closing the alert offering a newer version.
func OpenPage ¶
OpenPage says "Open Page" in the language the app shows under cx.
The button of the alert saying the newer version could not be installed, which opens its page in a browser.
func Supply ¶
func Supply(lang string, t Translation)
Supply adds the messages t has in lang to the catalog, over its own. nsgo writes the calls, in the package that supplies them, which runs them as it initializes.
func UpToDate ¶
UpToDate says "You’re up to date" in the language the app shows under cx.
The title of the alert saying no newer version of the app exists.
func UpToDateMessage ¶
UpToDateMessage says "{app} {version} is the newest version available." in the language the app shows under cx.
The alert saying no newer version exists, which names the running one.
func Update ¶
Update says "Update" in the language the app shows under cx.
The button of the alert offering a newer version, which installs it, or opens its page in the App Store or a browser.
func UpdateAvailable ¶
UpdateAvailable says "A new version of {app} is available" in the language the app shows under cx.
The title of the alert offering a newer version of the app.
func UpdateAvailableMessage ¶
UpdateAvailableMessage says "{app} {version} is available. You have {current}." in the language the app shows under cx.
The alert offering a newer version, which names it and the running one.
func UpdateChannel ¶
UpdateChannel says "This build is updated through its distribution channel, not this app." in the language the app shows under cx.
func UpdateDevelopment ¶
UpdateDevelopment says "This is a development build. It does not update itself." in the language the app shows under cx.
func UpdateError ¶
UpdateError says "Can’t check for updates" in the language the app shows under cx.
The title of the alert saying the check for a newer version failed.
func UpdateErrorMessage ¶
UpdateErrorMessage says "Something went wrong while checking for updates. Try again later." in the language the app shows under cx.
func UpdateReadyMessage ¶
UpdateReadyMessage says "A new build of {app} is ready. Restart to use it." in the language the app shows under cx.
The alert offering a prepared platform update whose version label is unavailable or unchanged.
Types ¶
type Messages ¶
type Messages struct {
// contains filtered or unexported fields
}
Messages say the messages in one language, their times in the hour cycle hc the user set; with mark, the source's with their arguments marked, which a pseudo locale transforms.
func For ¶
For returns the messages in the language the app shows under cx (i18n.Language), their times as the user reads them; a binding that says them follows both as they change.
func In ¶
In returns the messages in the catalog's language that suits locale best, as zh-Hant suits zh-TW, else in the source language.
func (Messages) InstallError ¶
InstallError is the package's InstallError in the language of msgs.
func (Messages) InstallErrorMessage ¶
InstallErrorMessage is the package's InstallErrorMessage in the language of msgs.
func (Messages) UpToDateMessage ¶
UpToDateMessage is the package's UpToDateMessage in the language of msgs.
func (Messages) UpdateAvailable ¶
UpdateAvailable is the package's UpdateAvailable in the language of msgs.
func (Messages) UpdateAvailableMessage ¶
UpdateAvailableMessage is the package's UpdateAvailableMessage in the language of msgs.
func (Messages) UpdateChannel ¶
UpdateChannel is the package's UpdateChannel in the language of msgs.
func (Messages) UpdateDevelopment ¶
UpdateDevelopment is the package's UpdateDevelopment in the language of msgs.
func (Messages) UpdateError ¶
UpdateError is the package's UpdateError in the language of msgs.
func (Messages) UpdateErrorMessage ¶
UpdateErrorMessage is the package's UpdateErrorMessage in the language of msgs.
func (Messages) UpdateReadyMessage ¶
UpdateReadyMessage is the package's UpdateReadyMessage in the language of msgs.
func (Messages) UpdateStore ¶
UpdateStore is the package's UpdateStore in the language of msgs.
type Translation ¶
type Translation struct {
Texts map[string]string
UpdateAvailable func(app string) string
UpdateAvailableMessage func(app string, version string, current string) string
UpdateReadyMessage func(app string) string
UpToDateMessage func(app string, version string) string
InstallErrorMessage func(app string, version string) string
UpdateStore func(store string) string
}
Translation is a language's messages another package supplies: those without arguments in Texts, by key, and a function for each of the others; a key or a field left out leaves the message to the catalog.