locales

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const Source = "en"

Source is the language the messages are written in.

Variables

View Source
var Catalog = i18n.NewCatalog("en", "zh-Hans")

Catalog holds the messages' languages: en, the source, zh-Hans, and those other packages supply.

View Source
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

func InstallError(cx *core.Scope) string

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

func InstallErrorMessage(cx *core.Scope, app string, version string) string

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

func Later(cx *core.Scope) string

Later says "Later" in the language the app shows under cx.

The button closing the alert offering a newer version.

func Ok

func Ok(cx *core.Scope) string

Ok says "OK" in the language the app shows under cx.

func OpenPage

func OpenPage(cx *core.Scope) string

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

func UpToDate(cx *core.Scope) string

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

func UpToDateMessage(cx *core.Scope, app string, version string) string

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

func Update(cx *core.Scope) string

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

func UpdateAvailable(cx *core.Scope, app string) string

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

func UpdateAvailableMessage(cx *core.Scope, app string, version string, current string) string

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

func UpdateChannel(cx *core.Scope) string

UpdateChannel says "This build is updated through its distribution channel, not this app." in the language the app shows under cx.

func UpdateDevelopment

func UpdateDevelopment(cx *core.Scope) string

UpdateDevelopment says "This is a development build. It does not update itself." in the language the app shows under cx.

func UpdateError

func UpdateError(cx *core.Scope) string

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

func UpdateErrorMessage(cx *core.Scope) string

UpdateErrorMessage says "Something went wrong while checking for updates. Try again later." in the language the app shows under cx.

func UpdateReadyMessage

func UpdateReadyMessage(cx *core.Scope, app string) string

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.

func UpdateStore

func UpdateStore(cx *core.Scope, store string) string

UpdateStore says "{store} installed this app and manages its updates." in the language the app shows under cx.

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

func For(cx *core.Scope) Messages

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

func In(locale string) Messages

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

func (msgs Messages) InstallError() string

InstallError is the package's InstallError in the language of msgs.

func (Messages) InstallErrorMessage

func (msgs Messages) InstallErrorMessage(app string, version string) string

InstallErrorMessage is the package's InstallErrorMessage in the language of msgs.

func (Messages) Later

func (msgs Messages) Later() string

Later is the package's Later in the language of msgs.

func (Messages) Ok

func (msgs Messages) Ok() string

Ok is the package's Ok in the language of msgs.

func (Messages) OpenPage

func (msgs Messages) OpenPage() string

OpenPage is the package's OpenPage in the language of msgs.

func (Messages) UpToDate

func (msgs Messages) UpToDate() string

UpToDate is the package's UpToDate in the language of msgs.

func (Messages) UpToDateMessage

func (msgs Messages) UpToDateMessage(app string, version string) string

UpToDateMessage is the package's UpToDateMessage in the language of msgs.

func (Messages) Update

func (msgs Messages) Update() string

Update is the package's Update in the language of msgs.

func (Messages) UpdateAvailable

func (msgs Messages) UpdateAvailable(app string) string

UpdateAvailable is the package's UpdateAvailable in the language of msgs.

func (Messages) UpdateAvailableMessage

func (msgs Messages) UpdateAvailableMessage(app string, version string, current string) string

UpdateAvailableMessage is the package's UpdateAvailableMessage in the language of msgs.

func (Messages) UpdateChannel

func (msgs Messages) UpdateChannel() string

UpdateChannel is the package's UpdateChannel in the language of msgs.

func (Messages) UpdateDevelopment

func (msgs Messages) UpdateDevelopment() string

UpdateDevelopment is the package's UpdateDevelopment in the language of msgs.

func (Messages) UpdateError

func (msgs Messages) UpdateError() string

UpdateError is the package's UpdateError in the language of msgs.

func (Messages) UpdateErrorMessage

func (msgs Messages) UpdateErrorMessage() string

UpdateErrorMessage is the package's UpdateErrorMessage in the language of msgs.

func (Messages) UpdateReadyMessage

func (msgs Messages) UpdateReadyMessage(app string) string

UpdateReadyMessage is the package's UpdateReadyMessage in the language of msgs.

func (Messages) UpdateStore

func (msgs Messages) UpdateStore(store string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL