diff --git a/README.md b/README.md index a5b4e374..edac6fcc 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ See the [user manual](docs/user.md) for detailed usage documentation. - Desktop and laptop keyboard layouts, with an interactive tutorial. - A keyboard-operated settings menu and quick settings shortcuts. - Temporary built-in application overrides for Ninjam, NetworkManager's nmtui, - classic Rogue, and Codex CLI (with an optional event bridge). + classic Rogue, and Codex CLI (with an optional event bridge), plus your own + application profiles created from the Applications menu. - Speech Dispatcher and hardware speech synthesizer support. - Sound icons, progress tones, and indentation and text attribute feedback. - Multiple clipboards, optional persistent history, and X clipboard synchronization. @@ -267,6 +268,9 @@ ordinary settings save directory. For example, Ninjam uses `applications/ninjam.toml`. Only customized values are stored; other values inherit ordinary settings. Returning to a shell prompt or selecting Default restores your ordinary settings, including previous unsaved adjustments. +**New profile** in the Applications menu saves current settings under a +program name, and `sudo fenrir -i USER` copies a user's profiles to console +Fenrir. See [application overrides](docs/user.md#application-overrides) for details and Ninjam's temporary region shortcuts. In the laptop layout, reading the current attributes now uses **Fenrir+Shift+A**. diff --git a/cmd/fenrir/main.go b/cmd/fenrir/main.go index 4d858dac..1e01b71a 100644 --- a/cmd/fenrir/main.go +++ b/cmd/fenrir/main.go @@ -29,6 +29,7 @@ import ( "os/user" "path/filepath" "strconv" + "strings" "syscall" "time" @@ -71,6 +72,10 @@ func runWithReady(args []string, stdout, stderr io.Writer, ready func() error) i rate := flags.Int("speech-rate", config.Defaults().Presentation.Speech.Rate, "Speech Dispatcher rate (-100 to 100)") module := flags.String("speech-module", "", "Speech Dispatcher output module (empty uses server default)") debugFile := flags.String("debug-file", "", "append timing and reader-decision diagnostics without text or key values") + var importUser string + const importUsage = "import USER's application profiles into this settings directory and exit (existing profiles are skipped)" + flags.StringVar(&importUser, "import-applications", "", importUsage) + flags.StringVar(&importUser, "i", "", "shorthand for --import-applications") var devices []string flags.Func("input-device", "keyboard event path; repeat to select devices (default: discover keyboards)", func(value string) error { if value == "" { @@ -102,6 +107,16 @@ func runWithReady(args []string, stdout, stderr io.Writer, ready func() error) i fmt.Fprintln(stdout, "fenrir", version.Label()) return 0 } + importRequested := false + flags.Visit(func(option *flag.Flag) { + if option.Name == "i" || option.Name == "import-applications" { + importRequested = true + } + }) + if importRequested && strings.TrimSpace(importUser) == "" { + fmt.Fprintln(stderr, "fenrir: import applications: a user name is required") + return 2 + } if err := initializeHome(); err != nil { fmt.Fprintln(stderr, "fenrir: settings:", err) return 2 @@ -111,6 +126,9 @@ func runWithReady(args []string, stdout, stderr io.Writer, ready func() error) i fmt.Fprintln(stderr, "fenrir: settings:", path, err) return 2 } + if importUser != "" { + return importApplications(importUser, path, stdout, stderr) + } if *writeConfig != "" { if err := config.Save(*writeConfig, settings); err != nil { fmt.Fprintln(stderr, "fenrir: save settings:", err) @@ -273,3 +291,45 @@ func initializeHome() error { } return os.Setenv("HOME", account.HomeDir) } + +// importApplications copies another account's application profiles, e.g. +// from a user's fenrir -x into root console Fenrir with sudo fenrir -i USER. +func importApplications(name, settingsPath string, stdout, stderr io.Writer) int { + account, err := user.Lookup(name) + if err != nil { + fmt.Fprintln(stderr, "fenrir: import applications:", err) + return 2 + } + uid, err := strconv.Atoi(account.Uid) + if err != nil || !filepath.IsAbs(account.HomeDir) { + fmt.Fprintln(stderr, "fenrir: import applications: invalid account", name) + return 2 + } + source := config.ApplicationsDir(config.Paths(account.HomeDir, uid)[0]) + destination := config.ApplicationsDir(settingsPath) + if filepath.Clean(source) == filepath.Clean(destination) { + fmt.Fprintln(stderr, "fenrir: import applications: source and destination are the same:", source) + return 2 + } + result, err := config.ImportApplications(source, destination) + if errors.Is(err, os.ErrNotExist) || err == nil && len(result.Imported)+len(result.Skipped)+len(result.Invalid) == 0 { + fmt.Fprintln(stdout, "No application profiles found in", source) + return 0 + } + for _, line := range []struct { + label string + ids []string + }{{"Imported:", result.Imported}, {"Skipped (already exists):", result.Skipped}, {"Invalid:", result.Invalid}} { + if len(line.ids) != 0 { + fmt.Fprintln(stdout, line.label, strings.Join(line.ids, ", ")) + } + } + if err != nil { + fmt.Fprintln(stderr, "fenrir: import applications:", err) + return 1 + } + if len(result.Imported) != 0 { + fmt.Fprintln(stdout, "Profiles saved to", destination) + } + return 0 +} diff --git a/cmd/fenrir/main_test.go b/cmd/fenrir/main_test.go index f05ee5ec..e310ced9 100644 --- a/cmd/fenrir/main_test.go +++ b/cmd/fenrir/main_test.go @@ -233,3 +233,28 @@ func TestCheckConfigValidatesEffectiveModifierRoles(t *testing.T) { } } } + +func TestImportApplicationsRejectsUnknownUserBeforeStartup(t *testing.T) { + settingsPath := filepath.Join(t.TempDir(), "settings.toml") + if err := config.Save(settingsPath, config.Defaults()); err != nil { + t.Fatal(err) + } + for _, flag := range []string{"-i", "--import-applications"} { + var stdout, stderr bytes.Buffer + if status := run([]string{"--config", settingsPath, flag, "Username-does-not-exist"}, &stdout, &stderr); status != 2 || !strings.Contains(stderr.String(), "import applications") { + t.Fatal(flag, status, stdout.String(), stderr.String()) + } + } +} + +func TestImportApplicationsRejectsEmptyUser(t *testing.T) { + for _, option := range []string{"-i", "--import-applications"} { + var stdout, stderr bytes.Buffer + // --check-config makes a regression safe: it must not fall through + // into another mode when the import argument is empty. + status := run([]string{"--check-config", option, ""}, &stdout, &stderr) + if status != 2 || !strings.Contains(stderr.String(), "import applications") { + t.Fatal(option, status, stdout.String(), stderr.String()) + } + } +} diff --git a/docs/fenrir.1 b/docs/fenrir.1 index 708ccc64..e1fe3c27 100644 --- a/docs/fenrir.1 +++ b/docs/fenrir.1 @@ -334,8 +334,8 @@ Press \f[B]Fenrir+A\f[R] to open \f[B]Applications\f[R]. Up and Down select an item; Enter activates it and closes the menu. Escape or the Cancel button closes the menu without changing the selection. -Tab and Shift+Tab move between the list, Copy alias to clipboard, -Cancel, and the tab selector. +Tab and Shift+Tab move between the list, New profile, Update profile, +Delete profile, Copy alias to clipboard, Cancel, and the tab selector. The active override is initially selected. .PP Type the start of a name to jump to it: \f[B]n\f[R] selects @@ -351,8 +351,8 @@ Start the application normally, then select its override. This menu does not launch programs. Choose \f[B]Default\f[R] to restore the settings and reading regions that were in effect before the override. -Overrides are built into Fenrir and are never selected automatically or -remembered across restarts. +Overrides are never selected automatically or remembered across +restarts. .PP To launch a program with its override, select its name in this list, then Tab to \f[B]Copy alias to clipboard\f[R] and press Enter. @@ -424,6 +424,64 @@ restoration. A malformed profile or unavailable voice leaves ordinary settings in effect and reports an error. Select the application again after correcting the file. +.SS Your own application profiles +The list also includes profiles you create, after the built\-in +applications. +To create one, adjust settings for the program, for example with the +quick settings keys. +Then press \f[B]Fenrir+A\f[R], Tab to \f[B]New profile\f[R], and press +Enter. +Type the program\(cqs command name, such as \f[CR]mutt\f[R], and press +Enter or activate \f[B]Create\f[R]. +Names are saved in lower case and may contain letters, numbers, dot, +plus, underscore, and hyphen. +The menu returns with the new profile selected. +.PP +A new profile saves only the application settings that differ from your +saved ordinary settings. +If nothing differs, it is created empty and inherits everything until +you update it. +.PP +\f[B]Update profile\f[R] adds the current differences to the selected +profile. +Settings already in the profile are kept unless you have changed them +again. +Saving while the profile is active, with \f[B]Fenrir+F\f[R] or +\f[B]Fenrir+Control+S\f[R], also updates it. +.PP +\f[B]Delete profile\f[R] asks for confirmation; \f[B]No\f[R] has focus +first. +Deleting the active profile restores Default first. +Built\-in applications cannot be deleted. +To reset a built\-in application, delete its file as described above. +.PP +Your own profiles do not detect the program on screen. +They apply as soon as they are selected and end at the next fresh shell +prompt, like the built\-in overrides. +Select one just before starting the program, or copy its alias: the +alias for \f[CR]mutt\f[R] runs \f[CR]mutt\f[R]. +.SS Copying profiles to console Fenrir +Profiles made in \f[CR]fenrir \-x\f[R] are saved in your home directory, +while console Fenrir running as root uses +\f[CR]/etc/fenrirscreenreader/settings/applications/\f[R]. +To copy your profiles, run: +.IP +.EX +sudo fenrir \-i USERNAME +.EE +.PP +\f[CR]\-\-import\-applications USERNAME\f[R] is the long form. +Fenrir copies valid profiles from that user\(cqs +\f[CR]\(ti/.local/share/stormux/fenrirscreenreader/settings/applications/\f[R] +into the applications directory beside the settings it loads, then exits +without opening devices. +Profiles that already exist there are skipped and listed, so your +console changes are never overwritten. +Delete one first to replace it. +Invalid files are listed by name and skipped. +If the user has no profiles, Fenrir reports the directory it checked. +A running Fenrir sees imported profiles the next time you open +\f[B]Fenrir+A\f[R]. .PP For example, a rate\-only profile contains current TOML setting names, with no top\-level \f[CR]version\f[R] field: @@ -1148,6 +1206,12 @@ opening devices \f[B]Purpose:\f[R] Write effective settings to a file and exit .RE .IP \(bu 2 +\f[B]\f[CB]\-i USER\f[B]\f[R], \f[B]\f[CB]\-\-import\-applications USER\f[B]\f[R] +.RS 2 +\f[B]Purpose:\f[R] Copy USER\(cqs application profiles into this +settings directory and exit +.RE +.IP \(bu 2 \f[B]\f[CB]\-\-speech\-driver ID\f[B]\f[R] .RS 2 \f[B]Purpose:\f[R] Override the configured speech driver diff --git a/docs/user.md b/docs/user.md index 4bd88585..a9390c50 100644 --- a/docs/user.md +++ b/docs/user.md @@ -228,8 +228,8 @@ from saved startup preferences. Press **Fenrir+A** to open **Applications**. Up and Down select an item; Enter activates it and closes the menu. Escape or the Cancel button closes the menu without changing the selection. Tab and Shift+Tab move between the list, -Copy alias to clipboard, Cancel, and the tab selector. The active override is -initially selected. +New profile, Update profile, Delete profile, Copy alias to clipboard, Cancel, +and the tab selector. The active override is initially selected. Type the start of a name to jump to it: **n** selects NetworkManager, then **i** selects Ninjam. Searching ignores letter case and does not activate the item. @@ -239,8 +239,8 @@ characters announce **No matches** and leave the last matching search intact. Start the application normally, then select its override. This menu does not launch programs. Choose **Default** to restore the settings and reading regions -that were in effect before the override. Overrides are built into Fenrir and -are never selected automatically or remembered across restarts. +that were in effect before the override. Overrides are never selected +automatically or remembered across restarts. To launch a program with its override, select its name in this list, then Tab to **Copy alias to clipboard** and press Enter. This copies a Bash alias into @@ -291,6 +291,53 @@ Saving is blocked during context transitions or failed voice restoration. A malformed profile or unavailable voice leaves ordinary settings in effect and reports an error. Select the application again after correcting the file. +### Your own application profiles + +The list also includes profiles you create, after the built-in applications. +To create one, adjust settings for the program, for example with the quick +settings keys. Then press **Fenrir+A**, Tab to **New profile**, and press Enter. +Type the program's command name, such as `mutt`, and press Enter or activate +**Create**. Names are saved in lower case and may contain letters, numbers, +dot, plus, underscore, and hyphen. The menu returns with the new profile +selected. + +A new profile saves only the application settings that differ from your saved +ordinary settings. If nothing differs, it is created empty and inherits +everything until you update it. + +**Update profile** adds the current differences to the selected profile. +Settings already in the profile are kept unless you have changed them again. +Saving while the profile is active, with **Fenrir+F** or +**Fenrir+Control+S**, also updates it. + +**Delete profile** asks for confirmation; **No** has focus first. Deleting the +active profile restores Default first. Built-in applications cannot be deleted. +To reset a built-in application, delete its file as described above. + +Your own profiles do not detect the program on screen. They apply as soon as +they are selected and end at the next fresh shell prompt, like the built-in +overrides. Select one just before starting the program, or copy its alias: +the alias for `mutt` runs `mutt`. + +### Copying profiles to console Fenrir + +Profiles made in `fenrir -x` are saved in your home directory, while console +Fenrir running as root uses `/etc/fenrirscreenreader/settings/applications/`. +To copy your profiles, run: + +```sh +sudo fenrir -i USERNAME +``` + +`--import-applications USERNAME` is the long form. Fenrir copies valid profiles +from that user's `~/.local/share/stormux/fenrirscreenreader/settings/applications/` +into the applications directory beside the settings it loads, then exits without +opening devices. Profiles that already exist there are skipped and listed, so +your console changes are never overwritten. Delete one first to replace it. +Invalid files are listed by name and skipped. If the user has no profiles, +Fenrir reports the directory it checked. A running Fenrir sees imported +profiles the next time you open **Fenrir+A**. + For example, a rate-only profile contains current TOML setting names, with no top-level `version` field: @@ -771,6 +818,7 @@ Fenrir runs as `fenrir [options]`. Use `--help` for the built-in reference. | `--punctuation-profile NAME_OR_PATH` | Select a punctuation profile | | `--check-config` | Validate settings, layout, and punctuation without opening devices | | `--write-config PATH` | Write effective settings to a file and exit | +| `-i USER`, `--import-applications USER` | Copy USER's application profiles into this settings directory and exit | | `--speech-driver ID` | Override the configured speech driver | | `--speech-rate NUMBER` | Override rate, from -100 to 100 | | `--speech-module NAME` | Select a Speech Dispatcher module | diff --git a/docs/user.txt b/docs/user.txt index 597c857c..31abc8bd 100644 --- a/docs/user.txt +++ b/docs/user.txt @@ -238,8 +238,9 @@ Application overrides Press Fenrir+A to open Applications. Up and Down select an item; Enter activates it and closes the menu. Escape or the Cancel button closes the menu without changing the selection. Tab and Shift+Tab move between the -list, Copy alias to clipboard, Cancel, and the tab selector. The active -override is initially selected. +list, New profile, Update profile, Delete profile, Copy alias to +clipboard, Cancel, and the tab selector. The active override is +initially selected. Type the start of a name to jump to it: n selects NetworkManager, then i selects Ninjam. Searching ignores letter case and does not activate the @@ -250,9 +251,8 @@ matching search intact. Start the application normally, then select its override. This menu does not launch programs. Choose Default to restore the settings and reading -regions that were in effect before the override. Overrides are built -into Fenrir and are never selected automatically or remembered across -restarts. +regions that were in effect before the override. Overrides are never +selected automatically or remembered across restarts. To launch a program with its override, select its name in this list, then Tab to Copy alias to clipboard and press Enter. This copies a Bash @@ -308,6 +308,54 @@ context transitions or failed voice restoration. A malformed profile or unavailable voice leaves ordinary settings in effect and reports an error. Select the application again after correcting the file. +Your own application profiles + +The list also includes profiles you create, after the built-in +applications. To create one, adjust settings for the program, for +example with the quick settings keys. Then press Fenrir+A, Tab to New +profile, and press Enter. Type the program’s command name, such as mutt, +and press Enter or activate Create. Names are saved in lower case and +may contain letters, numbers, dot, plus, underscore, and hyphen. The +menu returns with the new profile selected. + +A new profile saves only the application settings that differ from your +saved ordinary settings. If nothing differs, it is created empty and +inherits everything until you update it. + +Update profile adds the current differences to the selected profile. +Settings already in the profile are kept unless you have changed them +again. Saving while the profile is active, with Fenrir+F or +Fenrir+Control+S, also updates it. + +Delete profile asks for confirmation; No has focus first. Deleting the +active profile restores Default first. Built-in applications cannot be +deleted. To reset a built-in application, delete its file as described +above. + +Your own profiles do not detect the program on screen. They apply as +soon as they are selected and end at the next fresh shell prompt, like +the built-in overrides. Select one just before starting the program, or +copy its alias: the alias for mutt runs mutt. + +Copying profiles to console Fenrir + +Profiles made in fenrir -x are saved in your home directory, while +console Fenrir running as root uses +/etc/fenrirscreenreader/settings/applications/. To copy your profiles, +run: + + sudo fenrir -i USERNAME + +--import-applications USERNAME is the long form. Fenrir copies valid +profiles from that user’s +~/.local/share/stormux/fenrirscreenreader/settings/applications/ into +the applications directory beside the settings it loads, then exits +without opening devices. Profiles that already exist there are skipped +and listed, so your console changes are never overwritten. Delete one +first to replace it. Invalid files are listed by name and skipped. If +the user has no profiles, Fenrir reports the directory it checked. A +running Fenrir sees imported profiles the next time you open Fenrir+A. + For example, a rate-only profile contains current TOML setting names, with no top-level version field: @@ -827,6 +875,10 @@ Fenrir runs as fenrir [options]. Use --help for the built-in reference. --write-config PATH Write effective settings to a file and exit + -i USER, --import-applications USER Copy USER’s application profiles + into this settings directory and + exit + --speech-driver ID Override the configured speech driver diff --git a/internal/app/application.go b/internal/app/application.go index 05e49beb..193d7e55 100644 --- a/internal/app/application.go +++ b/internal/app/application.go @@ -80,6 +80,7 @@ type application struct { overrideCurrent *applicationOverride overrideFailed *applicationOverride overrideTransition, overrideRestoreFailed, overrideDirty bool + profileBusy bool } func newApplication(ctx context.Context, source Source, keyboards Keyboards, voice Speaker, options RunOptions) (*application, error) { diff --git a/internal/app/application_alias.go b/internal/app/application_alias.go index 766900da..97a59209 100644 --- a/internal/app/application_alias.go +++ b/internal/app/application_alias.go @@ -22,10 +22,11 @@ func applicationAlias(id, socketPath string) string { program = "nmtui" case "ninjam": program = "cninjam" - case "rogue", "codex": - program = id - default: + case "default", "": return "" + default: + // Rogue, Codex and user profiles are named after their programs. + program = id } if socketPath == "" { socketPath = control.MainSocket diff --git a/internal/app/application_alias_test.go b/internal/app/application_alias_test.go index 08e29ab5..a21dd33d 100644 --- a/internal/app/application_alias_test.go +++ b/internal/app/application_alias_test.go @@ -131,16 +131,23 @@ func TestApplicationsMenuCopiesAliasWithoutSelecting(t *testing.T) { a, voice := persistenceApplication(t, true) overrideRead(t, a, overrideScreen(1, "ninjam")) a.openApplications() - a.ui.handle(internalui.Key{Name: "tab"}) + // New, Update and Delete profile precede the copy button. + for range 4 { + a.ui.handle(internalui.Key{Name: "tab"}) + } a.ui.handle(internalui.Key{Name: "enter"}) if got := voice.messages[len(voice.messages)-1]; got != "Default has no application alias" { t.Fatal(got) } - a.ui.handle(internalui.Key{Name: "tab", Shift: true}) + for range 4 { + a.ui.handle(internalui.Key{Name: "tab", Shift: true}) + } // Use the list's prefix search, then Tab to the copy button. a.ui.handle(internalui.Key{Text: "n"}) a.ui.handle(internalui.Key{Text: "i"}) - a.ui.handle(internalui.Key{Name: "tab"}) + for range 4 { + a.ui.handle(internalui.Key{Name: "tab"}) + } a.ui.handle(internalui.Key{Name: "enter"}) if !a.ui.active || len(a.overrides) != 0 { t.Fatal("copy closed menu or selected an override") diff --git a/internal/app/application_overrides.go b/internal/app/application_overrides.go index edac0ab1..6606634d 100644 --- a/internal/app/application_overrides.go +++ b/internal/app/application_overrides.go @@ -5,21 +5,18 @@ package app import ( "maps" - "path/filepath" - "slices" "git.stormux.org/storm/fenrir/internal/applicationoverrides" "git.stormux.org/storm/fenrir/internal/applicationoverrides/codex" + "git.stormux.org/storm/fenrir/internal/applicationoverrides/custom" "git.stormux.org/storm/fenrir/internal/applicationoverrides/networkmanager" "git.stormux.org/storm/fenrir/internal/applicationoverrides/ninjam" "git.stormux.org/storm/fenrir/internal/applicationoverrides/rogue" "git.stormux.org/storm/fenrir/internal/config" "git.stormux.org/storm/fenrir/internal/i18n" - "git.stormux.org/storm/fenrir/internal/presentation" "git.stormux.org/storm/fenrir/internal/prompt" "git.stormux.org/storm/fenrir/internal/reader" "git.stormux.org/storm/fenrir/internal/screen" - "git.stormux.org/storm/screenreader-common/internalui" ) type overrideSnapshot struct { @@ -42,7 +39,7 @@ type applicationOverride struct { } func (a *application) savesUnavailable() bool { - return a.overrideTransition || a.overrideRestoreFailed || a.overrideFailed != nil || (a.overrideCurrent != nil && (!a.overrideCurrent.recognized || a.overrideCurrent.path == "")) + return a.profileBusy || a.overrideTransition || a.overrideRestoreFailed || a.overrideFailed != nil || (a.overrideCurrent != nil && (!a.overrideCurrent.recognized || a.overrideCurrent.path == "")) } func (a *application) settingsPath() string { @@ -179,7 +176,7 @@ func (a *application) restoreOverrideResult(done func(error)) bool { } func (a *application) selectOverride(id string) { - if a.saver.busy || a.speechPending || a.overrideTransition { + if a.saver.busy || a.speechPending || a.overrideTransition || a.profileBusy { a.voice.Say(i18n.T("Settings are busy")) return } @@ -228,18 +225,20 @@ func (a *application) selectOverrideResult(id string, done func(string)) { case "rogue": adapter = &rogue.Adapter{} default: - return + if !a.customApplicationExists(id) { + done("Application profile not found: " + id) + return + } + adapter = &custom.Adapter{ID: id} } if a.overrides == nil { a.overrides = make(map[int]*applicationOverride) } selected := &applicationOverride{id: id, terminal: terminal, adapter: adapter} - if a.options.ConfigPath != "" { - selected.path = filepath.Join(filepath.Dir(a.options.ConfigPath), "applications", id+".toml") - } + selected.path = a.applicationProfilePath(id) selected.shell.Observe(a.lastSnapshot) a.overrides[terminal] = selected - a.voice.Say(i18n.Format("{0} application override selected", i18n.T(adapter.Name()))) + a.voice.Say(i18n.Format("{0} application override selected", overrideName(adapter))) done("") }) } @@ -247,7 +246,7 @@ func (a *application) selectOverrideResult(id string, done func(string)) { // Called before reader.Update so exit detection and restored settings affect // the first shell snapshot, rather than interpreting it with the old adapter. func (a *application) observeOverride(next screen.Snapshot) (applicationoverrides.Frame, bool) { - if a.overrideTransition || (a.saver.busy && len(a.overrides) != 0) { + if a.profileBusy || a.overrideTransition || (a.saver.busy && len(a.overrides) != 0) { return applicationoverrides.Frame{}, false } if a.overrideRestoreFailed { @@ -352,52 +351,17 @@ func (a *application) observeOverride(next screen.Snapshot) (applicationoverride } func (a *application) openApplications() { - if a.saver.busy || a.speechPending || a.overrideTransition { + if a.saver.busy || a.speechPending || a.overrideTransition || a.profileBusy { a.voice.Say(i18n.T("Settings are busy")) return } - items := []string{i18n.T("Default"), i18n.T("NetworkManager"), i18n.T("Ninjam"), i18n.T("Rogue"), i18n.T("Codex")} - ids := []string{"default", "networkmanager", "ninjam", "rogue", "codex"} - position := 0 - if selected := a.overrides[a.lastTerminal]; selected != nil { - position = slices.Index(ids, selected.id) - } - session, err := newInternalUISession(internalui.Form{Type: internalui.TabForm, Title: "Applications", Tabs: []internalui.Tab{{ID: "applications", Label: "Applications", Controls: []internalui.Control{ - {ID: "application", Label: "Application", Kind: internalui.List, Items: items, Selected: position, Action: "activate"}, - {ID: "copy_alias", Label: "Copy alias to clipboard", Kind: internalui.Button, Action: "copy_alias"}, - {ID: "cancel", Label: "Cancel", Kind: internalui.Button, Action: "cancel"}, - }}}}) - if err != nil { - a.ui.failed("Could not open Applications: {0}", err) - return - } if _, err := a.ui.begin("Applications"); err != nil { a.ui.failed("Could not open Applications: {0}", err) return } - session.Handle(internalui.Key{Name: "tab"}) // Start on the list, not its tab strip. - a.ui.session = session - a.ui.action = func(action string, session *internalui.Session) { - if action == "cancel" { - a.ui.close() - return - } - if action == "activate" { - selected := session.Values()["applications.application"].Selected - a.ui.close() - a.selectOverride(ids[selected]) - } - if action == "copy_alias" { - selected := session.Values()["applications.application"].Selected - text := applicationAlias(ids[selected], a.settings.live.Remote.SocketFile) - if text == "" { - a.voice.Say(i18n.T("Default has no application alias")) - return - } - if a.clipboards.add(text, true) { - a.present(i18n.T("Application alias copied to clipboard"), presentation.CopyToClipboard) - } - } + selected := "" + if current := a.overrides[a.lastTerminal]; current != nil { + selected = current.id } - a.voice.Say(session.Open()) + a.showApplications(selected) } diff --git a/internal/app/application_overrides_test.go b/internal/app/application_overrides_test.go index b9f7a1af..5589ac7d 100644 --- a/internal/app/application_overrides_test.go +++ b/internal/app/application_overrides_test.go @@ -255,8 +255,9 @@ func TestApplicationsMenuActivatesOnlyOnEnterAndReleasesCapture(t *testing.T) { if a.ui.session.Values()["applications.application"].Selected != 2 { t.Fatal("active item not selected") } - a.ui.handle(internalui.Key{Name: "tab"}) - a.ui.handle(internalui.Key{Name: "tab"}) // Skip Copy alias to reach Cancel. + for range 5 { // Skip the profile buttons and Copy alias to reach Cancel. + a.ui.handle(internalui.Key{Name: "tab"}) + } a.ui.handle(internalui.Key{Name: "enter"}) if a.ui.active || a.overrides[1] == nil { t.Fatal("Cancel button changed selection") diff --git a/internal/app/application_profiles.go b/internal/app/application_profiles.go new file mode 100644 index 00000000..136f0a20 --- /dev/null +++ b/internal/app/application_profiles.go @@ -0,0 +1,360 @@ +// Copyright (c) 2026 Storm Dragon +// SPDX-License-Identifier: GPL-3.0-or-later + +package app + +import ( + "errors" + "log/slog" + "os" + "path/filepath" + "slices" + "time" + + "git.stormux.org/storm/fenrir/internal/applicationoverrides" + "git.stormux.org/storm/fenrir/internal/applicationoverrides/custom" + "git.stormux.org/storm/fenrir/internal/config" + "git.stormux.org/storm/fenrir/internal/i18n" + "git.stormux.org/storm/fenrir/internal/presentation" + "git.stormux.org/storm/screenreader-common/internalui" +) + +// builtinApplicationLabel keeps literal messages for catalog extraction. +func builtinApplicationLabel(id string) string { + switch id { + case "networkmanager": + return i18n.T("NetworkManager") + case "ninjam": + return i18n.T("Ninjam") + case "rogue": + return i18n.T("Rogue") + case "codex": + return i18n.T("Codex") + } + return id +} + +// overrideName translates built-in adapter names; user profile IDs are not +// messages and are presented as typed. +func overrideName(adapter applicationoverrides.Adapter) string { + if _, ok := adapter.(*custom.Adapter); ok { + return adapter.Name() + } + return i18n.T(adapter.Name()) +} + +func (a *application) applicationsDir() string { + if a.options.ConfigPath == "" { + return "" + } + return config.ApplicationsDir(a.options.ConfigPath) +} + +func (a *application) applicationProfilePath(id string) string { + if dir := a.applicationsDir(); dir != "" { + return filepath.Join(dir, id+".toml") + } + return "" +} + +func (a *application) customApplications() []string { + dir := a.applicationsDir() + if dir == "" { + return nil + } + ids, err := config.ListCustomApplications(dir) + if err != nil { + slog.Warn("list application profiles failed", "error", err, "at", time.Now()) + } + return ids +} + +func (a *application) customApplicationExists(id string) bool { + if valid, err := config.ValidApplicationName(id); err != nil || valid != id { + return false + } + path := a.applicationProfilePath(id) + if path == "" { + return false + } + info, err := os.Stat(path) + return err == nil && info.Mode().IsRegular() +} + +// applicationIDs lists Default, the built-in overrides, then user profiles. +func (a *application) applicationIDs() (ids, items []string) { + ids, items = []string{"default"}, []string{i18n.T("Default")} + for _, id := range config.BuiltinApplications { + ids, items = append(ids, id), append(items, builtinApplicationLabel(id)) + } + for _, id := range a.customApplications() { + ids, items = append(ids, id), append(items, id) + } + return ids, items +} + +// profileSettings returns the saved main settings and the current settings a +// new or updated profile records the differences between. +func (a *application) profileSettings() (base, current config.Settings) { + current = a.settingsToSave() + current.Reading.Automatic = a.engine.AutomaticReading() + current.Reading.Mode = a.engine.TrackingMode() + base = a.settings.resetBase + if a.overrideCurrent != nil { + base = a.overrideCurrent.underlying.settings.resetBase + } + return base, current +} + +func (a *application) profilesUnavailable() bool { + return a.applicationsDir() == "" || a.saver.busy || a.speechPending || a.overrideTransition || a.overrideRestoreFailed || a.overrideFailed != nil || a.profileBusy +} + +// showApplications installs the Applications list in the open menu. +func (a *application) showApplications(selectID string) { + ids, items := a.applicationIDs() + position := max(slices.Index(ids, selectID), 0) + session, err := newInternalUISession(internalui.Form{Type: internalui.TabForm, Title: "Applications", Tabs: []internalui.Tab{{ID: "applications", Label: "Applications", Controls: []internalui.Control{ + {ID: "application", Label: "Application", Kind: internalui.List, Items: items, Selected: position, Action: "activate"}, + {ID: "new_profile", Label: "New profile", Kind: internalui.Button, Action: "new_profile"}, + {ID: "update_profile", Label: "Update profile", Kind: internalui.Button, Action: "update_profile"}, + {ID: "delete_profile", Label: "Delete profile", Kind: internalui.Button, Action: "delete_profile"}, + {ID: "copy_alias", Label: "Copy alias to clipboard", Kind: internalui.Button, Action: "copy_alias"}, + {ID: "cancel", Label: "Cancel", Kind: internalui.Button, Action: "cancel"}, + }}}}) + if err != nil { + a.ui.close() + a.ui.failed("Could not open Applications: {0}", err) + return + } + session.Handle(internalui.Key{Name: "tab"}) // Start on the list, not its tab strip. + if a.ui.session != nil { + a.ui.session.Close() + } + a.ui.session, a.ui.returnToParent, a.ui.changed = session, nil, nil + a.ui.action = func(action string, session *internalui.Session) { + id := ids[session.Values()["applications.application"].Selected] + switch action { + case "cancel": + a.ui.close() + case "activate": + a.ui.close() + a.selectOverride(id) + case "copy_alias": + text := applicationAlias(id, a.settings.live.Remote.SocketFile) + if text == "" { + a.voice.Say(i18n.T("Default has no application alias")) + return + } + if a.clipboards.add(text, true) { + a.present(i18n.T("Application alias copied to clipboard"), presentation.CopyToClipboard) + } + case "new_profile": + a.showNewProfile(id) + case "update_profile": + a.updateProfile(id) + case "delete_profile": + a.confirmDeleteProfile(id) + } + } + a.voice.Say(session.Open()) +} + +func (a *application) showNewProfile(returnID string) { + if a.profilesUnavailable() { + a.voice.Say(i18n.T("Settings are busy")) + return + } + session, err := newInternalUISession(internalui.Form{Type: internalui.TabForm, Title: "New application profile", Tabs: []internalui.Tab{{ID: "profile", Label: "Profile", Controls: []internalui.Control{ + {ID: "name", Label: "Profile name", Kind: internalui.Entry, Action: "create"}, + {ID: "create", Label: "Create", Kind: internalui.Button, Action: "create"}, + {ID: "cancel", Label: "Cancel", Kind: internalui.Button, Action: "cancel"}, + }}}}) + if err != nil { + a.ui.failed("Could not open Applications: {0}", err) + return + } + session.Handle(internalui.Key{Name: "tab"}) // Start in the name field. + a.ui.session.Close() + a.ui.session = session + a.ui.returnToParent = func() { a.showApplications(returnID) } + a.ui.action = func(action string, session *internalui.Session) { + if action != "create" { + return + } + id, err := config.ValidApplicationName(session.Values()["profile.name"].Text) + if err != nil { + a.voice.Say(i18n.Format("Invalid profile name: {0}", err.Error())) + return + } + if a.customApplicationExists(id) { + a.voice.Say(i18n.Format("Application profile {0} already exists; use Update profile", id)) + return + } + a.writeProfile(id, false, func() { + a.voice.Say(i18n.Format("Application profile {0} created", id)) + }) + } + a.voice.Say(session.Open()) +} + +func (a *application) updateProfile(id string) { + if id == "default" { + a.voice.Say(i18n.T("Default has no application profile")) + return + } + a.writeProfile(id, true, func() { + a.voice.Say(i18n.Format("Application profile {0} updated", id)) + }) +} + +// writeProfile saves off the event loop. The menu holds no session while the +// write is pending, so keys cannot start a second profile operation. +func (a *application) writeProfile(id string, merge bool, done func()) { + if a.profilesUnavailable() { + a.voice.Say(i18n.T("Settings are busy")) + return + } + path := a.applicationProfilePath(id) + base, current := a.profileSettings() + active := a.overrideCurrent + if active != nil && active.id != id { + active = nil + } + a.beginProfileOperation(func() error { + if merge && active != nil { + // The active profile's current values are authoritative, including + // fields changed back to the ordinary setting. Keep explicit fields + // when saving, instead of merging their old values back in. + doc, err := config.OpenApplicationDocument(path, base) + if err != nil { + return err + } + return doc.Save(current) + } + return config.SaveApplicationProfile(path, base, current, merge) + }, func(err error, menuOpen bool) { + if err != nil { + a.voice.Say(i18n.Format("Could not save application profile: {0}", err.Error())) + } else { + if merge && active != nil { + a.settings.resetBase = current + } + a.refreshLoadedProfile(id) + done() + } + if menuOpen { + a.showApplications(id) + } + }) +} + +// refreshLoadedProfile drops a selected but not yet activated override so its +// next activation reads the saved file. An active override keeps its session. +func (a *application) refreshLoadedProfile(id string) { + for _, selected := range a.overrides { + if selected.id == id && selected != a.overrideCurrent && !selected.initialized { + selected.profile = nil + } + } +} + +func (a *application) confirmDeleteProfile(id string) { + if id == "default" || config.BuiltinApplication(id) { + a.voice.Say(i18n.T("Built-in applications cannot be deleted")) + return + } + if a.profilesUnavailable() { + a.voice.Say(i18n.T("Settings are busy")) + return + } + session, err := newInternalUISession(internalui.Form{Type: internalui.TabForm, Title: i18n.Format("Delete application profile {0}?", id), Tabs: []internalui.Tab{{ID: "confirm", Label: "Confirm", Controls: []internalui.Control{ + {ID: "no", Label: "No", Kind: internalui.Button, Action: "cancel"}, + {ID: "yes", Label: "Yes", Kind: internalui.Button, Action: "delete"}, + }}}}) + if err != nil { + a.ui.failed("Could not open Applications: {0}", err) + return + } + session.Handle(internalui.Key{Name: "tab"}) + a.ui.session.Close() + a.ui.session = session + a.ui.returnToParent = func() { a.showApplications(id) } + a.ui.action = func(action string, _ *internalui.Session) { + if action == "delete" { + a.deleteProfile(id) + } + } + a.voice.Say(session.Open()) +} + +func (a *application) deleteProfile(id string) { + if a.profilesUnavailable() { + a.voice.Say(i18n.T("Settings are busy")) + return + } + remove := func() { + for terminal, selected := range a.overrides { + if selected.id == id && selected != a.overrideCurrent { + selected.adapter.Close() + delete(a.overrides, terminal) + } + } + path := a.applicationProfilePath(id) + a.beginProfileOperation(func() error { + err := os.Remove(path) + if errors.Is(err, os.ErrNotExist) { + return nil + } + return err + }, func(err error, menuOpen bool) { + selectID := "default" + if err != nil { + a.voice.Say(i18n.Format("Could not delete application profile: {0}", err.Error())) + selectID = id + } else { + a.voice.Say(i18n.Format("Application profile {0} deleted", id)) + } + if menuOpen { + a.showApplications(selectID) + } + }) + } + if selected := a.overrides[a.lastTerminal]; selected != nil && selected.id == id && a.lastActive { + // Restoring Default closes the menu; the deletion continues after it. + a.selectOverrideResult("default", func(response string) { + if response != "" { + a.voice.Say(response) + return + } + remove() + }) + return + } + remove() +} + +// beginProfileOperation runs work off the event loop and completes on it, +// inside the Applications menu when that menu is still open. +func (a *application) beginProfileOperation(work func() error, done func(err error, menuOpen bool)) { + a.profileBusy = true + generation := a.ui.generation + if a.ui.active { + if a.ui.session != nil { + a.ui.session.Close() + } + a.ui.session, a.ui.action, a.ui.returnToParent = nil, nil, nil + } + go func() { + err := work() + select { + case a.overrideLoads <- func() { + a.profileBusy = false + done(err, a.ui.active && a.ui.generation == generation) + a.overrideDirty = true // Resume any screen/context change held during the write. + a.quitting = a.quitAfterSave && !a.saver.busy + }: + case <-a.ctx.Done(): + } + }() +} diff --git a/internal/app/application_profiles_test.go b/internal/app/application_profiles_test.go new file mode 100644 index 00000000..d5858ba6 --- /dev/null +++ b/internal/app/application_profiles_test.go @@ -0,0 +1,260 @@ +// Copyright (c) 2026 Storm Dragon +// SPDX-License-Identifier: GPL-3.0-or-later + +package app + +import ( + "os" + "path/filepath" + "slices" + "strings" + "testing" + "time" + + "git.stormux.org/storm/fenrir/internal/command" + "git.stormux.org/storm/fenrir/internal/config" + "git.stormux.org/storm/screenreader-common/internalui" +) + +func finishProfileOperation(t *testing.T, a *application) { + t.Helper() + if !a.profileBusy { + t.Fatal("no profile operation started") + } + select { + case done := <-a.overrideLoads: + done() + case <-time.After(time.Second): + t.Fatal("profile operation stalled") + } +} + +func pressKeys(a *application, name string, count int) { + for range count { + a.ui.handle(internalui.Key{Name: name}) + } +} + +func typeText(a *application, text string) { + for _, character := range text { + a.ui.handle(internalui.Key{Text: string(character)}) + } +} + +func spoken(voice *fakeVoice, text string) bool { + return slices.Contains(voice.messages, text) +} + +func TestApplicationsMenuCreatesSelectsAndDeletesCustomProfile(t *testing.T) { + a, voice := persistenceApplication(t, true) + overrideRead(t, a, overrideScreen(1, "mutt")) + mainRate := a.settings.resetBase.Presentation.Speech.Rate + a.settings.live.Presentation.Speech.Rate = mainRate + 20 + a.openApplications() + pressKeys(a, "tab", 1) // New profile + a.ui.handle(internalui.Key{Name: "enter"}) + if got := voice.messages[len(voice.messages)-1]; !strings.Contains(got, "Profile name") { + t.Fatal("name field not focused", got) + } + typeText(a, "Mutt") + a.ui.handle(internalui.Key{Name: "enter"}) + finishProfileOperation(t, a) + if !spoken(voice, "Application profile mutt created") { + t.Fatal(voice.messages) + } + path := filepath.Join(filepath.Dir(a.options.ConfigPath), "applications", "mutt.toml") + doc, err := config.OpenApplicationDocument(path, a.settings.resetBase) + if err != nil || doc.Settings.Presentation.Speech.Rate != mainRate+20 { + t.Fatal("profile not saved", err) + } + if !a.ui.active || a.ui.session.Values()["applications.application"].Selected != 5 { + t.Fatal("menu did not return with the new profile selected") + } + // Creating the same name again is refused without overwriting. + pressKeys(a, "tab", 1) + a.ui.handle(internalui.Key{Name: "enter"}) + typeText(a, "mutt") + a.ui.handle(internalui.Key{Name: "enter"}) + if a.profileBusy || !strings.Contains(voice.messages[len(voice.messages)-1], "already exists") { + t.Fatal(voice.messages[len(voice.messages)-1]) + } + a.ui.handle(internalui.Key{Name: "escape"}) + if !a.ui.active || a.ui.session == nil { + t.Fatal("Escape did not return to Applications") + } + + // Select it, as the list would, and confirm the application uses it. + a.settings.live.Presentation.Speech.Rate = mainRate + a.ui.handle(internalui.Key{Name: "enter"}) + if a.overrides[1] == nil || a.overrides[1].id != "mutt" || !spoken(voice, "mutt application override selected") { + t.Fatal("custom profile not selected") + } + overrideRead(t, a, overrideScreen(1, "mutt")) + if a.overrideCurrent == nil || a.settings.live.Presentation.Speech.Rate != mainRate+20 { + t.Fatal("custom profile not applied") + } + + // Deleting the active profile restores Default first. + a.openApplications() + if a.ui.session.Values()["applications.application"].Selected != 5 { + t.Fatal("active custom profile not selected") + } + pressKeys(a, "tab", 3) // Delete profile + a.ui.handle(internalui.Key{Name: "enter"}) + a.ui.handle(internalui.Key{Name: "enter"}) // No is focused first. + if a.profileBusy || a.overrides[1] == nil { + t.Fatal("No deleted the profile") + } + pressKeys(a, "tab", 3) + a.ui.handle(internalui.Key{Name: "enter"}) + pressKeys(a, "tab", 1) // Yes + a.ui.handle(internalui.Key{Name: "enter"}) + finishProfileOperation(t, a) + if _, err := os.Stat(path); !os.IsNotExist(err) { + t.Fatal("profile file remains", err) + } + if a.overrideCurrent != nil || a.overrides[1] != nil || a.settings.live.Presentation.Speech.Rate != mainRate || !spoken(voice, "Application profile mutt deleted") { + t.Fatal("Default not restored after delete", voice.messages) + } +} + +func TestApplicationsMenuUpdateMergesAndProtectsBuiltins(t *testing.T) { + a, voice := persistenceApplication(t, true) + overrideRead(t, a, overrideScreen(1, "irssi")) + mainRate := a.settings.resetBase.Presentation.Speech.Rate + path := filepath.Join(filepath.Dir(a.options.ConfigPath), "applications", "irssi.toml") + current := a.settings.resetBase + current.Presentation.Speech.Rate = mainRate + 5 + if err := config.SaveApplicationProfile(path, a.settings.resetBase, current, false); err != nil { + t.Fatal(err) + } + a.openApplications() + pressKeys(a, "tab", 2) // Update profile, with Default selected + a.ui.handle(internalui.Key{Name: "enter"}) + if a.profileBusy || voice.messages[len(voice.messages)-1] != "Default has no application profile" { + t.Fatal(voice.messages[len(voice.messages)-1]) + } + pressKeys(a, "tab", 1) // Delete profile, with Default selected + a.ui.handle(internalui.Key{Name: "enter"}) + if voice.messages[len(voice.messages)-1] != "Built-in applications cannot be deleted" { + t.Fatal(voice.messages[len(voice.messages)-1]) + } + a.ui.close() + + a.settings.live.Keyboard.WordEcho = !a.settings.resetBase.Keyboard.WordEcho + a.settings.saveDraft.Keyboard.WordEcho = a.settings.live.Keyboard.WordEcho + a.openApplications() + a.ui.handle(internalui.Key{Name: "end"}) + pressKeys(a, "tab", 2) + a.ui.handle(internalui.Key{Name: "enter"}) + finishProfileOperation(t, a) + if !spoken(voice, "Application profile irssi updated") { + t.Fatal(voice.messages) + } + doc, err := config.OpenApplicationDocument(path, a.settings.resetBase) + if err != nil || doc.Settings.Presentation.Speech.Rate != mainRate+5 || doc.Settings.Keyboard.WordEcho == a.settings.resetBase.Keyboard.WordEcho { + t.Fatal("update did not merge", err) + } +} + +func TestRemoteAndAliasSelectCustomProfile(t *testing.T) { + a, _ := persistenceApplication(t, true) + overrideRead(t, a, overrideScreen(1, "mutt")) + if got := runtimeRequest(a, "COMMAND APPLICATION mutt"); !strings.Contains(got, "default") { + t.Fatal("missing profile accepted", got) + } + path := filepath.Join(filepath.Dir(a.options.ConfigPath), "applications", "mutt.toml") + if err := config.SaveApplicationProfile(path, a.settings.resetBase, a.settings.resetBase, false); err != nil { + t.Fatal(err) + } + if got := runtimeRequest(a, "COMMAND APPLICATION unknown"); !strings.Contains(got, "mutt") { + t.Fatal("custom profile not listed", got) + } + if got := runtimeRequest(a, "COMMAND APPLICATION Mutt"); got != "" || a.overrides[1] == nil || a.overrides[1].id != "mutt" { + t.Fatal("custom profile not selected", got) + } + if alias := applicationAlias("mutt", ""); !strings.HasPrefix(alias, "alias mutt=") || !strings.Contains(alias, "command application mutt") { + t.Fatal(alias) + } +} + +func TestUpdateActiveProfileCanRestoreOrdinaryValue(t *testing.T) { + a, _ := persistenceApplication(t, true) + overrideRead(t, a, overrideScreen(1, "mutt")) + base := a.settings.resetBase + current := base + current.Presentation.Speech.Rate += 10 + path := a.applicationProfilePath("mutt") + if err := config.SaveApplicationProfile(path, base, current, false); err != nil { + t.Fatal(err) + } + a.selectOverride("mutt") + overrideRead(t, a, overrideScreen(1, "mutt")) + a.settings.live.Presentation.Speech.Rate = base.Presentation.Speech.Rate + a.openApplications() + a.updateProfile("mutt") + finishProfileOperation(t, a) + doc, err := config.OpenApplicationDocument(path, base) + if err != nil { + t.Fatal(err) + } + if doc.Settings.Presentation.Speech.Rate != base.Presentation.Speech.Rate { + t.Fatal("update retained the old application rate", doc.Settings.Presentation.Speech.Rate) + } + if a.settings.resetBase.Presentation.Speech.Rate != base.Presentation.Speech.Rate { + t.Fatal("RESET still uses the old application rate") + } +} + +func TestPendingProfileOperationBlocksOtherWritesAndSelection(t *testing.T) { + a, _ := persistenceApplication(t, true) + overrideRead(t, a, overrideScreen(1, "mutt")) + a.profileBusy = true // Model a slow filesystem operation after Escape. + if got := runtimeRequest(a, "COMMAND APPLICATION ninjam"); !strings.Contains(got, "busy") { + t.Fatal("application selection allowed during a profile write", got) + } + persistenceReply(t, persistenceRequest(a, "SAVE"), true) + a.saveSettings() + if a.saver.busy { + t.Fatal("settings write allowed during a profile operation") + } + if got := runtimeRequest(a, "SETTING SET speech#rate=10"); !strings.Contains(got, "busy") { + t.Fatal("settings changed during a profile operation", got) + } + a.openSettings() + if a.ui.active { + t.Fatal("settings menu opened during a profile operation") + } + a.profileBusy = false + a.selectOverride("ninjam") + a.profileBusy = true + if _, ready := a.observeOverride(overrideScreen(1, "ninjam")); ready || a.overrideCurrent != nil || a.overrideTransition { + t.Fatal("profile activation raced a profile operation") + } + a.handleCommand(command.Quit) + if a.quitting || !a.quitAfterSave { + t.Fatal("quit abandoned a pending profile write") + } +} + +func TestProfileOperationCompletesAfterEscapeBeforeQuitting(t *testing.T) { + a, _ := persistenceApplication(t, true) + a.openApplications() + completed := false + a.beginProfileOperation(func() error { return nil }, func(err error, menuOpen bool) { + if err != nil || menuOpen { + t.Fatal("completion reopened the closed menu", err, menuOpen) + } + completed = true + }) + a.ui.handle(internalui.Key{Name: "escape"}) + a.handleCommand(command.Quit) + if a.quitting { + t.Fatal("quit before the write completed") + } + a.overrideDirty = false + finishProfileOperation(t, a) + if !completed || !a.quitting || !a.overrideDirty || a.ui.active { + t.Fatal("completion did not finish the operation and quit") + } +} diff --git a/internal/app/commands.go b/internal/app/commands.go index 5c2c977d..f582c18c 100644 --- a/internal/app/commands.go +++ b/internal/app/commands.go @@ -120,7 +120,7 @@ func (a *application) announceLock(change input.LockChange) { } func (a *application) handleCommand(id command.ID) { - if a.overrideTransition && id != "" && id != command.Quit && id != command.Mute { + if (a.overrideTransition || a.profileBusy) && id != "" && id != command.Quit && id != command.Mute { a.voice.Say(i18n.T("Settings are busy")) return } @@ -147,7 +147,7 @@ func (a *application) handleCommand(id command.ID) { text, _ := datetime.FormatDate(a.settings.live.Presentation.DateTime.DateFormat, time.Now()) a.present(text, "") case command.Quit: - if a.saver.busy { + if a.saver.busy || a.profileBusy { a.quitAfterSave = true } else { a.quitting = true diff --git a/internal/app/remote_application.go b/internal/app/remote_application.go index 899ed2fb..dfe7c56b 100644 --- a/internal/app/remote_application.go +++ b/internal/app/remote_application.go @@ -6,19 +6,20 @@ package app import ( "strings" + "git.stormux.org/storm/fenrir/internal/config" "git.stormux.org/storm/fenrir/internal/control" ) // Runs after the command authorization and enablement gates. func (a *application) remoteApplication(parameter string, request control.Request) { id := strings.ToLower(strings.TrimSpace(parameter)) - switch id { - case "default", "networkmanager", "ninjam", "rogue", "codex": - default: - remoteReply(request.Reply, "APPLICATION requires one ID: default, networkmanager, ninjam, rogue, codex") + if id != "default" && !config.BuiltinApplication(id) && !a.customApplicationExists(id) { + ids := append([]string{"default"}, config.BuiltinApplications...) + ids = append(ids, a.customApplications()...) + remoteReply(request.Reply, "APPLICATION requires one ID: "+strings.Join(ids, ", ")) return } - if a.saver.busy || a.speechPending || a.overrideTransition { + if a.saver.busy || a.speechPending || a.overrideTransition || a.profileBusy { remoteReply(request.Reply, "Settings are busy; try again after the current operation") return } diff --git a/internal/app/remote_persistence.go b/internal/app/remote_persistence.go index cd59145c..5026640e 100644 --- a/internal/app/remote_persistence.go +++ b/internal/app/remote_persistence.go @@ -21,7 +21,7 @@ func (a *application) remoteSettingsRequest(text string, request control.Request if a.savesUnavailable() && (verb == "SAVE" || verb == "SAVEAS") { return "Save unavailable.", false } - if a.overrideTransition { + if a.overrideTransition || a.profileBusy { return "Settings are busy; try again after the current operation", false } if a.speechPending { @@ -128,7 +128,7 @@ func (a *application) settingsSaveResult(err error) { remoteReply(reply, response) } else if a.overrideCurrent != nil && err == nil { a.saver.busy = false - a.voice.Say(i18n.Format("{0} application settings saved.", i18n.T(a.overrideCurrent.adapter.Name()))) + a.voice.Say(i18n.Format("{0} application settings saved.", overrideName(a.overrideCurrent.adapter))) } else { a.saver.result(err, a.voice) } diff --git a/internal/app/runtime_settings.go b/internal/app/runtime_settings.go index d53ac0c0..e408437e 100644 --- a/internal/app/runtime_settings.go +++ b/internal/app/runtime_settings.go @@ -162,7 +162,7 @@ func (a *application) applyQuickSettings() { } func (a *application) openSettings() { - if a.saver.busy || a.speechPending { + if a.saver.busy || a.speechPending || a.profileBusy { a.ui.failed("Could not open Fenrir Menu: {0}", fmt.Errorf("settings save in progress")) return } @@ -173,7 +173,7 @@ func (a *application) openSettings() { a.ui.speechOverride = &selected } if selected := a.overrideCurrent; selected != nil { - a.ui.openApplicationSettings(a.settingsToSave(), selected.path, selected.base, i18n.T(selected.adapter.Name())) + a.ui.openApplicationSettings(a.settingsToSave(), selected.path, selected.base, overrideName(selected.adapter)) return } if a.quick.changed { diff --git a/internal/applicationoverrides/custom/custom.go b/internal/applicationoverrides/custom/custom.go new file mode 100644 index 00000000..eb9543ea --- /dev/null +++ b/internal/applicationoverrides/custom/custom.go @@ -0,0 +1,30 @@ +// Copyright (c) 2026 Storm Dragon +// SPDX-License-Identifier: GPL-3.0-or-later + +// Package custom is the adapter for user-created application profiles. It +// recognizes every screen; the shell-prompt detector ends the override. +package custom + +import ( + "git.stormux.org/storm/fenrir/internal/applicationoverrides" + "git.stormux.org/storm/fenrir/internal/command" + "git.stormux.org/storm/fenrir/internal/config" + "git.stormux.org/storm/fenrir/internal/presentation" + "git.stormux.org/storm/fenrir/internal/screen" +) + +type Adapter struct { + ID string +} + +// Name is the user's profile ID, which is not a translatable message. +func (a *Adapter) Name() string { return a.ID } +func (*Adapter) Configure(*config.Settings) {} +func (*Adapter) Reset() {} +func (*Adapter) Close() {} +func (*Adapter) Observe(screen.Snapshot) applicationoverrides.Frame { + return applicationoverrides.Frame{Recognized: true} +} +func (*Adapter) Command(command.ID) (presentation.CommandResult, bool) { + return presentation.CommandResult{}, false +} diff --git a/internal/config/application.go b/internal/config/application.go index 124777c4..d7f095e8 100644 --- a/internal/config/application.go +++ b/internal/config/application.go @@ -37,14 +37,20 @@ func ApplicationSetting(path string) bool { // OpenApplicationDocument overlays a sparse, current-schema profile on the // application's inherited settings. Missing files inherit everything. func OpenApplicationDocument(path string, base Settings) (*Document, error) { - doc := &Document{Settings: base, path: path, applicationBase: &base, applicationFields: make(map[string]bool)} data, err := readDocument(path) if errors.Is(err, os.ErrNotExist) { - return doc, nil + return &Document{Settings: base, path: path, applicationBase: &base, applicationFields: make(map[string]bool)}, nil } if err != nil { return nil, err } + return parseApplicationDocument(path, data, base) +} + +// parseApplicationDocument strictly decodes profile data already read by the +// caller, which may have used a confined directory handle. +func parseApplicationDocument(path string, data []byte, base Settings) (*Document, error) { + doc := &Document{Settings: base, path: path, applicationBase: &base, applicationFields: make(map[string]bool)} var fields map[string]any if err := toml.Unmarshal(data, &fields); err != nil { return nil, err @@ -88,6 +94,14 @@ func (d *Document) ApplyApplication(base Settings) Settings { } func (d *Document) saveApplication(settings Settings) error { + data, err := d.applicationData(settings) + if err != nil { + return err + } + return saveData(d.path, data) +} + +func (d *Document) applicationData(settings Settings) ([]byte, error) { fields := make(map[string]any) selectionChanged := false for _, path := range []string{"presentation.speech.module", "presentation.speech.language", "presentation.speech.voice"} { @@ -118,11 +132,7 @@ func (d *Document) saveApplication(settings Settings) error { } } visit(reflect.ValueOf(settings), reflect.ValueOf(*d.applicationBase), "") - data, err := toml.Marshal(fields) - if err != nil { - return err - } - return saveData(d.path, data) + return toml.Marshal(fields) } // ApplyApplicationSettings copies the supported live settings only. Inherited diff --git a/internal/config/application_profiles.go b/internal/config/application_profiles.go new file mode 100644 index 00000000..e0732eef --- /dev/null +++ b/internal/config/application_profiles.go @@ -0,0 +1,218 @@ +// Copyright (c) 2026 Storm Dragon +// SPDX-License-Identifier: GPL-3.0-or-later + +package config + +import ( + "errors" + "fmt" + "io" + "os" + "path/filepath" + "reflect" + "regexp" + "slices" + "strings" + "syscall" + + "github.com/pelletier/go-toml/v2" +) + +// BuiltinApplications are the overrides with dedicated adapters. Their profile +// files live beside user-created profiles but cannot be created or deleted. +var BuiltinApplications = []string{"networkmanager", "ninjam", "rogue", "codex"} + +// maxApplicationProfileSize bounds imported profiles, which hold only a few +// dozen scalar settings. +const maxApplicationProfileSize = 64 << 10 + +var applicationNamePattern = regexp.MustCompile(`^[a-z0-9][a-z0-9._+-]{0,63}$`) + +// ApplicationsDir returns the profile directory beside a settings file. +func ApplicationsDir(settingsPath string) string { + return filepath.Join(filepath.Dir(settingsPath), "applications") +} + +// BuiltinApplication reports whether id names an override with an adapter. +func BuiltinApplication(id string) bool { + return slices.Contains(BuiltinApplications, id) +} + +// ValidApplicationName normalizes a user-entered profile name to its ID. The +// ID is also the profile file name and the program name in its shell alias. +func ValidApplicationName(name string) (string, error) { + id := strings.ToLower(strings.TrimSpace(name)) + if id == "" { + return "", errors.New("profile name is empty") + } + if !applicationNamePattern.MatchString(id) { + return "", errors.New("use letters, numbers, dot, plus, underscore or hyphen, starting with a letter or number") + } + if id == "default" || BuiltinApplication(id) { + return "", fmt.Errorf("%s is a built-in application", id) + } + return id, nil +} + +// ListCustomApplications returns the user-created profile IDs in dir, sorted. +// A missing directory has no profiles. +func ListCustomApplications(dir string) ([]string, error) { + entries, err := os.ReadDir(dir) + if errors.Is(err, os.ErrNotExist) { + return nil, nil + } + if err != nil { + return nil, err + } + var ids []string + for _, entry := range entries { + id, ok := strings.CutSuffix(entry.Name(), ".toml") + if !ok || !entry.Type().IsRegular() { + continue + } + if valid, err := ValidApplicationName(id); err == nil && valid == id { + ids = append(ids, id) + } + } + slices.Sort(ids) + return ids, nil +} + +// SaveApplicationProfile writes the application settings where current +// differs from base. With merge, settings already in the profile are kept +// unless current also differs from base for that setting. Without merge, it +// creates a new profile and refuses to overwrite any existing file. +func SaveApplicationProfile(path string, base, current Settings, merge bool) error { + doc := &Document{Settings: base, path: path, applicationBase: &base, applicationFields: make(map[string]bool)} + if merge { + var err error + if doc, err = OpenApplicationDocument(path, base); err != nil { + return err + } + // Module, language and voice are one selection. Preserving individual + // fields could attach the previous profile's voice to a new module. + currentSpeech, baseSpeech := current.Presentation.Speech, base.Presentation.Speech + selectionChanged := currentSpeech.Module != baseSpeech.Module || currentSpeech.Language != baseSpeech.Language || currentSpeech.Voice != baseSpeech.Voice + for field := range doc.applicationFields { + if selectionChanged && (field == "presentation.speech.module" || field == "presentation.speech.language" || field == "presentation.speech.voice") { + continue + } + currentValue := settingValue(reflect.ValueOf(¤t).Elem(), field) + if reflect.DeepEqual(currentValue.Interface(), settingValue(reflect.ValueOf(base), field).Interface()) { + currentValue.Set(settingValue(reflect.ValueOf(doc.Settings), field)) + } + } + } + if err := current.Validate(); err != nil { + return err + } + if merge { + return doc.Save(current) + } + data, err := doc.applicationData(current) + if err != nil { + return err + } + return saveNewData(path, data) +} + +// ImportResult lists profile IDs by outcome. Invalid entries name the file and +// a parse reason, never its contents. +type ImportResult struct { + Imported, Skipped, Invalid []string +} + +// ImportApplications copies profiles from source to destination. The source +// may belong to another, untrusted account: reads are confined to source by +// os.Root, limited to small regular files, strictly validated and re-encoded +// rather than copied. Existing destination profiles are skipped. +func ImportApplications(source, destination string) (ImportResult, error) { + var result ImportResult + root, err := os.OpenRoot(source) + if err != nil { + return result, err + } + defer root.Close() + directory, err := root.Open(".") + if err != nil { + return result, err + } + entries, err := directory.ReadDir(-1) + _ = directory.Close() // Read-only handle; entries are already read. + if err != nil { + return result, err + } + slices.SortFunc(entries, func(a, b os.DirEntry) int { return strings.Compare(a.Name(), b.Name()) }) + for _, entry := range entries { + id, ok := strings.CutSuffix(entry.Name(), ".toml") + if !ok || strings.HasPrefix(entry.Name(), ".") { + continue + } + if valid, err := ValidApplicationName(id); !BuiltinApplication(id) && (err != nil || valid != id) { + result.Invalid = append(result.Invalid, entry.Name()+" (invalid profile name)") + continue + } + data, err := readConfinedProfile(root, entry.Name()) + if err != nil { + result.Invalid = append(result.Invalid, fmt.Sprintf("%s (%v)", entry.Name(), err)) + continue + } + target := filepath.Join(destination, entry.Name()) + _, err = parseApplicationDocument(target, data, Defaults()) + if err != nil { + result.Invalid = append(result.Invalid, entry.Name()+" (not a valid application profile)") + continue + } + if _, err := os.Lstat(target); err == nil { + result.Skipped = append(result.Skipped, id) + continue + } else if !errors.Is(err, os.ErrNotExist) { + return result, err + } + // Import preserves exactly the validated source fields. Saving an + // effective settings snapshot would fill missing speech-selection + // fields with defaults, breaking inheritance at the destination. + var fields map[string]any + if err := toml.Unmarshal(data, &fields); err != nil { + return result, err + } + data, err = toml.Marshal(fields) + if err != nil { + return result, err + } + if err := saveNewData(target, data); errors.Is(err, os.ErrExist) { + result.Skipped = append(result.Skipped, id) + continue + } else if err != nil { + return result, err + } + result.Imported = append(result.Imported, id) + } + return result, nil +} + +func readConfinedProfile(root *os.Root, name string) ([]byte, error) { + info, err := root.Lstat(name) + if err != nil { + return nil, err + } + if !info.Mode().IsRegular() { + return nil, errors.New("not a regular file") + } + file, err := root.OpenFile(name, os.O_RDONLY|syscall.O_NONBLOCK, 0) + if err != nil { + return nil, err + } + defer file.Close() + if info, err = file.Stat(); err != nil { + return nil, err + } + if !info.Mode().IsRegular() { + return nil, errors.New("not a regular file") + } + data, err := io.ReadAll(io.LimitReader(file, maxApplicationProfileSize+1)) + if err == nil && len(data) > maxApplicationProfileSize { + err = errors.New("file exceeds 64 KiB") + } + return data, err +} diff --git a/internal/config/application_test.go b/internal/config/application_test.go index 6417b3ef..1939975c 100644 --- a/internal/config/application_test.go +++ b/internal/config/application_test.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" "strings" + "sync" "testing" ) @@ -115,3 +116,195 @@ func TestApplicationVoiceSelectionSavedTogether(t *testing.T) { t.Fatal("coupled voice selection changed", doc, err) } } + +func TestValidApplicationName(t *testing.T) { + for name, want := range map[string]string{" Mutt ": "mutt", "irssi-2": "irssi-2", "w3m.x": "w3m.x"} { + if got, err := ValidApplicationName(name); err != nil || got != want { + t.Fatal(name, got, err) + } + } + for _, name := range []string{"", "default", "Codex", "../x", ".hidden", "a b", "a/b", strings.Repeat("a", 65)} { + if _, err := ValidApplicationName(name); err == nil { + t.Fatal("accepted", name) + } + } +} + +func TestSaveApplicationProfileDifferencesAndMerge(t *testing.T) { + dir := t.TempDir() + path := filepath.Join(dir, "mutt.toml") + base := Defaults() + current := base + current.Presentation.Speech.Rate = base.Presentation.Speech.Rate + 10 + current.Keyboard.Devices = []string{"/dev/input/event9"} // Not an application setting. + if err := SaveApplicationProfile(path, base, current, false); err != nil { + t.Fatal(err) + } + data, _ := os.ReadFile(path) + if !strings.Contains(string(data), "rate") || strings.Contains(string(data), "devices") || strings.Contains(string(data), "pitch") { + t.Fatal(string(data)) + } + // Merge keeps the saved rate when the current rate is the main setting, + // and adds the newly changed echo. + current = base + current.Keyboard.WordEcho = !base.Keyboard.WordEcho + if err := SaveApplicationProfile(path, base, current, true); err != nil { + t.Fatal(err) + } + doc, err := OpenApplicationDocument(path, base) + if err != nil || doc.Settings.Presentation.Speech.Rate != base.Presentation.Speech.Rate+10 || doc.Settings.Keyboard.WordEcho == base.Keyboard.WordEcho { + t.Fatal(doc.Settings.Presentation.Speech, err) + } + ids, err := ListCustomApplications(dir) + if err != nil || len(ids) != 1 || ids[0] != "mutt" { + t.Fatal(ids, err) + } + if ids, err := ListCustomApplications(filepath.Join(dir, "missing")); err != nil || len(ids) != 0 { + t.Fatal(ids, err) + } +} + +func TestImportApplicationsConfinedValidatedAndSkipsExisting(t *testing.T) { + source, destination, outside := t.TempDir(), t.TempDir(), t.TempDir() + write := func(dir, name, data string) { + if err := os.WriteFile(filepath.Join(dir, name), []byte(data), 0600); err != nil { + t.Fatal(err) + } + } + write(source, "mutt.toml", "[presentation.speech]\nrate = 20\n") + write(source, "codex.toml", "[keyboard]\nword_echo = true\n") + write(source, "broken.toml", "root:x:0:0:secret\n") + write(source, "notes.txt", "ignored") + write(outside, "secret.toml", "[presentation.speech]\nrate = 33\n") + if err := os.Symlink(filepath.Join(outside, "secret.toml"), filepath.Join(source, "escape.toml")); err != nil { + t.Fatal(err) + } + write(destination, "codex.toml", "[keyboard]\nword_echo = false\n") + result, err := ImportApplications(source, destination) + if err != nil { + t.Fatal(err) + } + if strings.Join(result.Imported, ",") != "mutt" || strings.Join(result.Skipped, ",") != "codex" || len(result.Invalid) != 2 { + t.Fatalf("%+v", result) + } + for _, invalid := range result.Invalid { + if strings.Contains(invalid, "secret") && !strings.HasPrefix(invalid, "escape.toml") { + t.Fatal("file contents reported", invalid) + } + } + if _, err := os.Stat(filepath.Join(destination, "escape.toml")); err == nil { + t.Fatal("symlink outside the source was imported") + } + data, _ := os.ReadFile(filepath.Join(destination, "codex.toml")) + if !strings.Contains(string(data), "false") { + t.Fatal("existing profile overwritten") + } + doc, err := OpenApplicationDocument(filepath.Join(destination, "mutt.toml"), Defaults()) + if err != nil || doc.Settings.Presentation.Speech.Rate != 20 { + t.Fatal(err) + } +} + +func TestSaveApplicationProfileMergesSpeechSelectionTogether(t *testing.T) { + path := filepath.Join(t.TempDir(), "mutt.toml") + base := Defaults() + current := base + current.Presentation.Speech.Module = "old-module" + current.Presentation.Speech.Voice = "Old voice" + if err := SaveApplicationProfile(path, base, current, false); err != nil { + t.Fatal(err) + } + current = base + current.Presentation.Speech.Module = "new-module" + if err := SaveApplicationProfile(path, base, current, true); err != nil { + t.Fatal(err) + } + doc, err := OpenApplicationDocument(path, base) + if err != nil { + t.Fatal(err) + } + if got := doc.Settings.Presentation.Speech; got.Module != "new-module" || got.Voice != "" { + t.Fatal("old voice merged into a new module", got) + } +} + +func TestCreateApplicationProfileNeverOverwritesExisting(t *testing.T) { + path := filepath.Join(t.TempDir(), "mutt.toml") + original := []byte("[presentation.speech]\nrate = 13\n") + if err := os.WriteFile(path, original, 0600); err != nil { + t.Fatal(err) + } + if err := SaveApplicationProfile(path, Defaults(), Defaults(), false); !os.IsExist(err) { + t.Fatal("creation did not report an existing profile", err) + } + data, err := os.ReadFile(path) + if err != nil || string(data) != string(original) { + t.Fatal("existing profile overwritten", string(data), err) + } +} + +func TestConcurrentProfileImportsKeepOneCompleteProfile(t *testing.T) { + destination := t.TempDir() + sources := []string{t.TempDir(), t.TempDir()} + for index, source := range sources { + data := "[presentation.speech]\nrate = 13\n" + if index == 1 { + data = "[presentation.speech]\nrate = 27\n" + } + if err := os.WriteFile(filepath.Join(source, "mutt.toml"), []byte(data), 0600); err != nil { + t.Fatal(err) + } + } + var workers sync.WaitGroup + results := make(chan ImportResult, len(sources)) + start := make(chan struct{}) + for _, source := range sources { + workers.Go(func() { + <-start + result, err := ImportApplications(source, destination) + if err != nil { + t.Error(err) + } + results <- result + }) + } + close(start) + workers.Wait() + close(results) + imported, skipped := 0, 0 + for result := range results { + imported += len(result.Imported) + skipped += len(result.Skipped) + } + if imported != 1 || skipped != 1 { + t.Fatal("concurrent imports overwrote a profile", imported, skipped) + } + doc, err := OpenApplicationDocument(filepath.Join(destination, "mutt.toml"), Defaults()) + if err != nil { + t.Fatal(err) + } + if rate := doc.Settings.Presentation.Speech.Rate; rate != 13 && rate != 27 { + t.Fatal("import produced an incomplete profile", rate) + } +} + +func TestImportApplicationsPreservesSparseSpeechInheritance(t *testing.T) { + source, destination := t.TempDir(), t.TempDir() + if err := os.WriteFile(filepath.Join(source, "mutt.toml"), []byte("[presentation.speech]\nlanguage = 'fr'\n"), 0600); err != nil { + t.Fatal(err) + } + if _, err := ImportApplications(source, destination); err != nil { + t.Fatal(err) + } + base := Defaults() + base.Presentation.Speech.Module = "ordinary-module" + base.Presentation.Speech.Voice = "Ordinary voice" + doc, err := OpenApplicationDocument(filepath.Join(destination, "mutt.toml"), base) + if err != nil { + t.Fatal(err) + } + got := doc.ApplyApplication(base).Presentation.Speech + if got.Module != base.Presentation.Speech.Module || got.Voice != base.Presentation.Speech.Voice || got.Language != "fr" { + t.Fatal("import filled omitted fields instead of inheriting them", got) + } +} diff --git a/internal/config/config.go b/internal/config/config.go index dd9f1ae6..f3b7250f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -353,6 +353,17 @@ func saveData(path string, data []byte) error { } func saveDataWithPermissions(path string, data []byte, fileMode, dirMode os.FileMode) error { + return publishData(path, data, fileMode, dirMode, os.Rename) +} + +// saveNewData publishes a complete private file without replacing an existing +// destination, including one created concurrently. The temporary file is on +// the same filesystem, so linking it is an atomic exclusive create. +func saveNewData(path string, data []byte) error { + return publishData(path, data, 0600, 0700, os.Link) +} + +func publishData(path string, data []byte, fileMode, dirMode os.FileMode, publish func(string, string) error) error { dir := filepath.Dir(path) if err := os.MkdirAll(dir, dirMode); err != nil { return err @@ -361,7 +372,7 @@ func saveDataWithPermissions(path string, data []byte, fileMode, dirMode os.File if err != nil { return err } - // After a successful rename the temporary name no longer exists. + // A rename consumes the temporary name; a link leaves it to be removed. defer func() { _ = os.Remove(file.Name()) }() if _, err := file.Write(data); err != nil { file.Close() @@ -380,5 +391,5 @@ func saveDataWithPermissions(path string, data []byte, fileMode, dirMode os.File if err := file.Close(); err != nil { return err } - return os.Rename(file.Name(), path) + return publish(file.Name(), path) } diff --git a/internal/i18n/locale/de/LC_MESSAGES/fenrir.po b/internal/i18n/locale/de/LC_MESSAGES/fenrir.po index f74a53fa..89e980bc 100644 --- a/internal/i18n/locale/de/LC_MESSAGES/fenrir.po +++ b/internal/i18n/locale/de/LC_MESSAGES/fenrir.po @@ -155,15 +155,32 @@ msgstr "Apostroph" msgid "Apple" msgstr "Apfel" -#: internal/app/application_overrides.go:366 +#: internal/app/application_profiles.go:118 msgid "Application" msgstr "Anwendung" -#: internal/app/application_overrides.go:398 +#: internal/app/application_profiles.go:150 msgid "Application alias copied to clipboard" msgstr "Anwendungsalias in die Zwischenablage kopiert" -#: internal/app/application_overrides.go:365 +#: internal/app/application_profiles.go:191 +msgid "Application profile {0} already exists; use Update profile" +msgstr "" +"Anwendungsprofil {0} existiert bereits; verwenden Sie Profil aktualisieren" + +#: internal/app/application_profiles.go:195 +msgid "Application profile {0} created" +msgstr "Anwendungsprofil {0} erstellt" + +#: internal/app/application_profiles.go:316 +msgid "Application profile {0} deleted" +msgstr "Anwendungsprofil {0} gelöscht" + +#: internal/app/application_profiles.go:207 +msgid "Application profile {0} updated" +msgstr "Anwendungsprofil {0} aktualisiert" + +#: internal/app/application_profiles.go:117 msgid "Applications" msgstr "Anwendungen" @@ -408,6 +425,10 @@ msgstr "Benachrichtigungen mit ihren Empfangszeiten durchsehen" msgid "Bug" msgstr "Raupe" +#: internal/app/application_profiles.go:264 +msgid "Built-in applications cannot be deleted" +msgstr "Integrierte Anwendungen können nicht gelöscht werden" + #: screenreader-common/emoji/catalog.go msgid "Bunny" msgstr "Häschen" @@ -448,7 +469,8 @@ msgstr "Fotoapparat mit blitz" msgid "Canada" msgstr "Kanada" -#: internal/app/application_overrides.go:368 +#: internal/app/application_profiles.go:123 +#: internal/app/application_profiles.go:171 #: internal/preferences/settings.go:105 internal/preferences/settings.go:98 #: screenreader-common/voiceprofiles/editor.go msgid "Cancel" @@ -610,7 +632,7 @@ msgstr "Sektgläser" msgid "Clipboard" msgstr "Zwischenablage" -#: internal/app/application.go:169 internal/app/application.go:172 +#: internal/app/application.go:170 internal/app/application.go:173 #: internal/app/clipboard.go:226 internal/app/clipboard.go:382 msgid "Clipboard import failed" msgstr "Import aus der Zwischenablage fehlgeschlagen" @@ -647,7 +669,7 @@ msgstr "Cocktailglas" msgid "Coconut" msgstr "Kokosnuss" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:32 msgid "Codex" msgstr "Codex" @@ -715,6 +737,10 @@ msgstr "Computermaus" msgid "Confetti ball" msgstr "Konfettiball" +#: internal/app/application_profiles.go:271 +msgid "Confirm" +msgstr "Bestätigen" + #: internal/applicationoverrides/ninjam/ninjam.go:159 msgid "Connection, tempo and interval" msgstr "Verbindung, Tempo und Intervall" @@ -739,7 +765,7 @@ msgstr "Cool" msgid "Copied" msgstr "Kopiert" -#: internal/app/application_overrides.go:367 +#: internal/app/application_profiles.go:122 msgid "Copy alias to clipboard" msgstr "Alias in die Zwischenablage kopieren" @@ -759,17 +785,23 @@ msgstr "Mais" msgid "Could not check spelling: {0}" msgstr "Rechtschreibung konnte nicht geprüft werden: {0}" +#: internal/app/application_profiles.go:313 +msgid "Could not delete application profile: {0}" +msgstr "Anwendungsprofil konnte nicht gelöscht werden: {0}" + #: internal/app/fenrir_menu.go:185 internal/app/voice_profiles.go:68 msgid "Could not edit voice profiles: {0}" msgstr "Stimmprofile konnten nicht bearbeitet werden: {0}" -#: internal/app/application_overrides.go:319 -#: internal/app/application_overrides.go:86 +#: internal/app/application_overrides.go:318 +#: internal/app/application_overrides.go:83 msgid "Could not load application settings: {0}" msgstr "Anwendungseinstellungen konnten nicht geladen werden: {0}" -#: internal/app/application_overrides.go:371 -#: internal/app/application_overrides.go:375 +#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:127 +#: internal/app/application_profiles.go:174 +#: internal/app/application_profiles.go:276 msgid "Could not open Applications: {0}" msgstr "Anwendungen konnten nicht geöffnet werden: {0}" @@ -791,11 +823,15 @@ msgstr "Benachrichtigungen konnten nicht geöffnet werden: {0}" msgid "Could not open Spellcheck Menu: {0}" msgstr "Rechtschreibmenü konnte nicht geöffnet werden: {0}" -#: internal/app/application_overrides.go:172 -#: internal/app/application_overrides.go:337 +#: internal/app/application_overrides.go:169 +#: internal/app/application_overrides.go:336 msgid "Could not restore application settings: {0}" msgstr "Anwendungseinstellungen konnten nicht wiederhergestellt werden: {0}" +#: internal/app/application_profiles.go:238 +msgid "Could not save application profile: {0}" +msgstr "Anwendungsprofil konnte nicht gespeichert werden: {0}" + #: internal/app/spellcheck_menu.go:156 msgid "Could not save exceptions: {0}" msgstr "Ausnahmen konnten nicht gespeichert werden: {0}" @@ -825,6 +861,10 @@ msgstr "Kuhgesicht" msgid "Cowboy hat face" msgstr "Cowboyhut-Gesicht" +#: internal/app/application_profiles.go:170 +msgid "Create" +msgstr "Erstellen" + #: screenreader-common/emoji/catalog.go msgid "Cricket" msgstr "Grille" @@ -901,17 +941,21 @@ msgstr "Datumsformat" msgid "Deer" msgstr "Hirsch" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:86 #: screenreader-common/voiceprofiles/editor.go msgid "Default" msgstr "Standard" -#: internal/app/application_overrides.go:394 +#: internal/app/application_profiles.go:146 msgid "Default has no application alias" msgstr "Standard hat keinen Anwendungsalias" -#: internal/app/application_overrides.go:216 -#: internal/app/application_overrides.go:280 +#: internal/app/application_profiles.go:203 +msgid "Default has no application profile" +msgstr "Standard hat kein Anwendungsprofil" + +#: internal/app/application_overrides.go:213 +#: internal/app/application_overrides.go:279 msgid "Default settings restored" msgstr "Standardeinstellungen wiederhergestellt" @@ -923,10 +967,18 @@ msgstr "Unterbrechungstasten festlegen" msgid "Defined interruption keys" msgstr "Festgelegte Unterbrechungstasten" +#: internal/app/application_profiles.go:271 +msgid "Delete application profile {0}?" +msgstr "Anwendungsprofil {0} löschen?" + #: internal/applicationoverrides/ninjam/ninjam.go:279 msgid "Delete channel" msgstr "Kanal löschen" +#: internal/app/application_profiles.go:121 +msgid "Delete profile" +msgstr "Profil löschen" + #: screenreader-common/internalui msgid "Deleted {0}" msgstr "Gelöscht: {0}" @@ -1559,6 +1611,10 @@ msgstr "Interne Benutzeroberfläche" msgid "Interval position {0} of {1}" msgstr "Intervallposition {0} von {1}" +#: internal/app/application_profiles.go:187 +msgid "Invalid profile name: {0}" +msgstr "Ungültiger Profilname: {0}" + #: screenreader-common/internalui msgid "Invalid text" msgstr "Ungültiger Text" @@ -1993,7 +2049,7 @@ msgstr "Strebergesicht" msgid "Netherlands" msgstr "Niederlande" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:26 msgid "NetworkManager" msgstr "NetworkManager" @@ -2001,11 +2057,19 @@ msgstr "NetworkManager" msgid "New Moon" msgstr "Neumond" +#: internal/app/application_profiles.go:168 +msgid "New application profile" +msgstr "Neues Anwendungsprofil" + #: internal/applicationoverrides/ninjam/ninjam.go:282 msgid "New channel" msgstr "Neuer Kanal" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:119 +msgid "New profile" +msgstr "Neues Profil" + +#: internal/app/application_profiles.go:28 msgid "Ninjam" msgstr "Ninjam" @@ -2021,6 +2085,10 @@ msgstr "" "Ninjam-Bereiche: 1 letzte Chatnachricht; 2 ausgewählter Kanal oder " "Bedienelement; 3 Verbindung, Tempo und Intervall" +#: internal/app/application_profiles.go:272 +msgid "No" +msgstr "Nein" + #: internal/applicationoverrides/codex/codex.go:139 msgid "No Codex message received" msgstr "Keine Codex-Nachricht empfangen" @@ -2439,6 +2507,14 @@ msgstr "Druck" msgid "Printer" msgstr "Drucker" +#: internal/app/application_profiles.go:168 +msgid "Profile" +msgstr "Profil" + +#: internal/app/application_profiles.go:169 +msgid "Profile name" +msgstr "Profilname" + #: internal/app/commands.go:173 msgid "Progress monitoring disabled" msgstr "Fortschrittsüberwachung deaktiviert" @@ -2696,7 +2772,7 @@ msgstr "Rock-Geste" msgid "Rocket" msgstr "Rakete" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:30 msgid "Rogue" msgstr "Rogue" @@ -2884,8 +2960,12 @@ msgstr "Live-Bereich aus einer oder zwei Markierungen festlegen" msgid "Set window begin and end marks" msgstr "Setze Fensteranfangs- und -endmarken" -#: internal/app/application_overrides.go:183 -#: internal/app/application_overrides.go:356 internal/app/commands.go:124 +#: internal/app/application_overrides.go:180 +#: internal/app/application_overrides.go:355 +#: internal/app/application_profiles.go:165 +#: internal/app/application_profiles.go:215 +#: internal/app/application_profiles.go:268 +#: internal/app/application_profiles.go:293 internal/app/commands.go:124 msgid "Settings are busy" msgstr "Einstellungen sind beschäftigt" @@ -3426,6 +3506,10 @@ msgstr "Nicht sichtbar" msgid "Up Arrow" msgstr "Pfeil auf" +#: internal/app/application_profiles.go:120 +msgid "Update profile" +msgstr "Profil aktualisieren" + #: screenreader-common/emoji/catalog.go msgid "Upside Down Face" msgstr "Umgekehrtes gesicht" @@ -3628,6 +3712,10 @@ msgstr "Gähnendes Gesicht" msgid "Yellow heart" msgstr "Gelbes Herz" +#: internal/app/application_profiles.go:273 +msgid "Yes" +msgstr "Ja" + #: screenreader-common/emoji/catalog.go msgid "Zany Face" msgstr "Irres gesicht" @@ -4565,7 +4653,7 @@ msgstr "Zwinkern" msgid "{0} added to dictionary" msgstr "{0} zum Wörterbuch hinzugefügt" -#: internal/app/application_overrides.go:242 +#: internal/app/application_overrides.go:241 msgid "{0} application override selected" msgstr "Anwendungseinstellungen für {0} ausgewählt" diff --git a/internal/i18n/locale/es/LC_MESSAGES/fenrir.po b/internal/i18n/locale/es/LC_MESSAGES/fenrir.po index 0c4f97cf..e2ee5953 100644 --- a/internal/i18n/locale/es/LC_MESSAGES/fenrir.po +++ b/internal/i18n/locale/es/LC_MESSAGES/fenrir.po @@ -155,15 +155,31 @@ msgstr "Apóstrofo" msgid "Apple" msgstr "Manzana" -#: internal/app/application_overrides.go:366 +#: internal/app/application_profiles.go:118 msgid "Application" msgstr "Aplicación" -#: internal/app/application_overrides.go:398 +#: internal/app/application_profiles.go:150 msgid "Application alias copied to clipboard" msgstr "Alias de la aplicación copiado al portapapeles" -#: internal/app/application_overrides.go:365 +#: internal/app/application_profiles.go:191 +msgid "Application profile {0} already exists; use Update profile" +msgstr "El perfil de aplicación {0} ya existe; use Actualizar perfil" + +#: internal/app/application_profiles.go:195 +msgid "Application profile {0} created" +msgstr "Perfil de aplicación {0} creado" + +#: internal/app/application_profiles.go:316 +msgid "Application profile {0} deleted" +msgstr "Perfil de aplicación {0} eliminado" + +#: internal/app/application_profiles.go:207 +msgid "Application profile {0} updated" +msgstr "Perfil de aplicación {0} actualizado" + +#: internal/app/application_profiles.go:117 msgid "Applications" msgstr "Aplicaciones" @@ -408,6 +424,10 @@ msgstr "Explorar las notificaciones con sus horas de recepción" msgid "Bug" msgstr "Bicho" +#: internal/app/application_profiles.go:264 +msgid "Built-in applications cannot be deleted" +msgstr "Las aplicaciones integradas no se pueden eliminar" + #: screenreader-common/emoji/catalog.go msgid "Bunny" msgstr "Conejo" @@ -448,7 +468,8 @@ msgstr "Cámara con flash" msgid "Canada" msgstr "Canadá" -#: internal/app/application_overrides.go:368 +#: internal/app/application_profiles.go:123 +#: internal/app/application_profiles.go:171 #: internal/preferences/settings.go:105 internal/preferences/settings.go:98 #: screenreader-common/voiceprofiles/editor.go msgid "Cancel" @@ -610,7 +631,7 @@ msgstr "Copas brindando" msgid "Clipboard" msgstr "Portapapeles" -#: internal/app/application.go:169 internal/app/application.go:172 +#: internal/app/application.go:170 internal/app/application.go:173 #: internal/app/clipboard.go:226 internal/app/clipboard.go:382 msgid "Clipboard import failed" msgstr "Error al importar el portapapeles" @@ -647,7 +668,7 @@ msgstr "Copa de cóctel" msgid "Coconut" msgstr "Coco" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:32 msgid "Codex" msgstr "Codex" @@ -717,6 +738,10 @@ msgstr "Ratón de computadora" msgid "Confetti ball" msgstr "Bola de confeti" +#: internal/app/application_profiles.go:271 +msgid "Confirm" +msgstr "Confirmar" + #: internal/applicationoverrides/ninjam/ninjam.go:159 msgid "Connection, tempo and interval" msgstr "Conexión, tempo e intervalo" @@ -741,7 +766,7 @@ msgstr "Genial" msgid "Copied" msgstr "Copiado" -#: internal/app/application_overrides.go:367 +#: internal/app/application_profiles.go:122 msgid "Copy alias to clipboard" msgstr "Copiar alias al portapapeles" @@ -761,17 +786,23 @@ msgstr "Maíz" msgid "Could not check spelling: {0}" msgstr "No se pudo revisar la ortografía: {0}" +#: internal/app/application_profiles.go:313 +msgid "Could not delete application profile: {0}" +msgstr "No se pudo eliminar el perfil de aplicación: {0}" + #: internal/app/fenrir_menu.go:185 internal/app/voice_profiles.go:68 msgid "Could not edit voice profiles: {0}" msgstr "No se pudieron editar los perfiles de voz: {0}" -#: internal/app/application_overrides.go:319 -#: internal/app/application_overrides.go:86 +#: internal/app/application_overrides.go:318 +#: internal/app/application_overrides.go:83 msgid "Could not load application settings: {0}" msgstr "No se pudo cargar la configuración de la aplicación: {0}" -#: internal/app/application_overrides.go:371 -#: internal/app/application_overrides.go:375 +#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:127 +#: internal/app/application_profiles.go:174 +#: internal/app/application_profiles.go:276 msgid "Could not open Applications: {0}" msgstr "No se pudo abrir Aplicaciones: {0}" @@ -793,11 +824,15 @@ msgstr "No se pudieron abrir las notificaciones: {0}" msgid "Could not open Spellcheck Menu: {0}" msgstr "No se pudo abrir el menú de ortografía: {0}" -#: internal/app/application_overrides.go:172 -#: internal/app/application_overrides.go:337 +#: internal/app/application_overrides.go:169 +#: internal/app/application_overrides.go:336 msgid "Could not restore application settings: {0}" msgstr "No se pudo restaurar la configuración de la aplicación: {0}" +#: internal/app/application_profiles.go:238 +msgid "Could not save application profile: {0}" +msgstr "No se pudo guardar el perfil de aplicación: {0}" + #: internal/app/spellcheck_menu.go:156 msgid "Could not save exceptions: {0}" msgstr "No se pudieron guardar las excepciones: {0}" @@ -827,6 +862,10 @@ msgstr "Cara de vaca" msgid "Cowboy hat face" msgstr "Cara con sombrero de vaquero" +#: internal/app/application_profiles.go:170 +msgid "Create" +msgstr "Crear" + #: screenreader-common/emoji/catalog.go msgid "Cricket" msgstr "Grillo" @@ -903,17 +942,21 @@ msgstr "Formato de fecha" msgid "Deer" msgstr "Ciervo" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:86 #: screenreader-common/voiceprofiles/editor.go msgid "Default" msgstr "Predeterminado" -#: internal/app/application_overrides.go:394 +#: internal/app/application_profiles.go:146 msgid "Default has no application alias" msgstr "Predeterminado no tiene un alias de aplicación" -#: internal/app/application_overrides.go:216 -#: internal/app/application_overrides.go:280 +#: internal/app/application_profiles.go:203 +msgid "Default has no application profile" +msgstr "Predeterminado no tiene perfil de aplicación" + +#: internal/app/application_overrides.go:213 +#: internal/app/application_overrides.go:279 msgid "Default settings restored" msgstr "Configuración predeterminada restaurada" @@ -925,10 +968,18 @@ msgstr "Definir teclas de interrupción" msgid "Defined interruption keys" msgstr "Teclas de interrupción definidas" +#: internal/app/application_profiles.go:271 +msgid "Delete application profile {0}?" +msgstr "¿Eliminar el perfil de aplicación {0}?" + #: internal/applicationoverrides/ninjam/ninjam.go:279 msgid "Delete channel" msgstr "Eliminar canal" +#: internal/app/application_profiles.go:121 +msgid "Delete profile" +msgstr "Eliminar perfil" + #: screenreader-common/internalui msgid "Deleted {0}" msgstr "Eliminado: {0}" @@ -1562,6 +1613,10 @@ msgstr "Interfaz interna" msgid "Interval position {0} of {1}" msgstr "Posición del intervalo {0} de {1}" +#: internal/app/application_profiles.go:187 +msgid "Invalid profile name: {0}" +msgstr "Nombre de perfil no válido: {0}" + #: screenreader-common/internalui msgid "Invalid text" msgstr "Texto no válido" @@ -2003,7 +2058,7 @@ msgstr "Cara de empollón" msgid "Netherlands" msgstr "Países Bajos" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:26 msgid "NetworkManager" msgstr "NetworkManager" @@ -2011,11 +2066,19 @@ msgstr "NetworkManager" msgid "New Moon" msgstr "Luna nueva" +#: internal/app/application_profiles.go:168 +msgid "New application profile" +msgstr "Nuevo perfil de aplicación" + #: internal/applicationoverrides/ninjam/ninjam.go:282 msgid "New channel" msgstr "Nuevo canal" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:119 +msgid "New profile" +msgstr "Nuevo perfil" + +#: internal/app/application_profiles.go:28 msgid "Ninjam" msgstr "Ninjam" @@ -2031,6 +2094,10 @@ msgstr "" "Regiones de Ninjam: 1 último mensaje de chat; 2 canal o control " "seleccionado; 3 conexión, tempo e intervalo" +#: internal/app/application_profiles.go:272 +msgid "No" +msgstr "No" + #: internal/applicationoverrides/codex/codex.go:139 msgid "No Codex message received" msgstr "No se ha recibido ningún mensaje de Codex" @@ -2446,6 +2513,14 @@ msgstr "Imprimir pantalla" msgid "Printer" msgstr "Impresora" +#: internal/app/application_profiles.go:168 +msgid "Profile" +msgstr "Perfil" + +#: internal/app/application_profiles.go:169 +msgid "Profile name" +msgstr "Nombre del perfil" + #: internal/app/commands.go:173 msgid "Progress monitoring disabled" msgstr "Seguimiento del progreso desactivado" @@ -2702,7 +2777,7 @@ msgstr "Gesto de rock" msgid "Rocket" msgstr "Cohete" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:30 msgid "Rogue" msgstr "Rogue" @@ -2890,8 +2965,12 @@ msgstr "Definir una región dinámica a partir de una o dos marcas" msgid "Set window begin and end marks" msgstr "Establece una marca de principio y otra para el final de la ventana" -#: internal/app/application_overrides.go:183 -#: internal/app/application_overrides.go:356 internal/app/commands.go:124 +#: internal/app/application_overrides.go:180 +#: internal/app/application_overrides.go:355 +#: internal/app/application_profiles.go:165 +#: internal/app/application_profiles.go:215 +#: internal/app/application_profiles.go:268 +#: internal/app/application_profiles.go:293 internal/app/commands.go:124 msgid "Settings are busy" msgstr "La configuración está ocupada" @@ -3431,6 +3510,10 @@ msgstr "No visible" msgid "Up Arrow" msgstr "Flecha arriba" +#: internal/app/application_profiles.go:120 +msgid "Update profile" +msgstr "Actualizar perfil" + #: screenreader-common/emoji/catalog.go msgid "Upside Down Face" msgstr "Cara al revés" @@ -3632,6 +3715,10 @@ msgstr "Cara bostezando" msgid "Yellow heart" msgstr "Corazón amarillo" +#: internal/app/application_profiles.go:273 +msgid "Yes" +msgstr "Sí" + #: screenreader-common/emoji/catalog.go msgid "Zany Face" msgstr "Cara de loco" @@ -4570,7 +4657,7 @@ msgstr "guiño" msgid "{0} added to dictionary" msgstr "{0} añadido al diccionario" -#: internal/app/application_overrides.go:242 +#: internal/app/application_overrides.go:241 msgid "{0} application override selected" msgstr "Ajustes de aplicación seleccionados para {0}" diff --git a/internal/i18n/locale/fenrir.pot b/internal/i18n/locale/fenrir.pot index c9f78a74..c4454dea 100644 --- a/internal/i18n/locale/fenrir.pot +++ b/internal/i18n/locale/fenrir.pot @@ -145,15 +145,31 @@ msgstr "" msgid "Apple" msgstr "" -#: internal/app/application_overrides.go:366 +#: internal/app/application_profiles.go:118 msgid "Application" msgstr "" -#: internal/app/application_overrides.go:398 +#: internal/app/application_profiles.go:150 msgid "Application alias copied to clipboard" msgstr "" -#: internal/app/application_overrides.go:365 +#: internal/app/application_profiles.go:191 +msgid "Application profile {0} already exists; use Update profile" +msgstr "" + +#: internal/app/application_profiles.go:195 +msgid "Application profile {0} created" +msgstr "" + +#: internal/app/application_profiles.go:316 +msgid "Application profile {0} deleted" +msgstr "" + +#: internal/app/application_profiles.go:207 +msgid "Application profile {0} updated" +msgstr "" + +#: internal/app/application_profiles.go:117 msgid "Applications" msgstr "" @@ -397,6 +413,10 @@ msgstr "" msgid "Bug" msgstr "" +#: internal/app/application_profiles.go:264 +msgid "Built-in applications cannot be deleted" +msgstr "" + #: screenreader-common/emoji/catalog.go msgid "Bunny" msgstr "" @@ -437,7 +457,7 @@ msgstr "" msgid "Canada" msgstr "" -#: internal/app/application_overrides.go:368 internal/preferences/settings.go:105 internal/preferences/settings.go:98 screenreader-common/voiceprofiles/editor.go +#: internal/app/application_profiles.go:123 internal/app/application_profiles.go:171 internal/preferences/settings.go:105 internal/preferences/settings.go:98 screenreader-common/voiceprofiles/editor.go msgid "Cancel" msgstr "" @@ -597,7 +617,7 @@ msgstr "" msgid "Clipboard" msgstr "" -#: internal/app/application.go:169 internal/app/application.go:172 internal/app/clipboard.go:226 internal/app/clipboard.go:382 +#: internal/app/application.go:170 internal/app/application.go:173 internal/app/clipboard.go:226 internal/app/clipboard.go:382 msgid "Clipboard import failed" msgstr "" @@ -633,7 +653,7 @@ msgstr "" msgid "Coconut" msgstr "" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:32 msgid "Codex" msgstr "" @@ -701,6 +721,10 @@ msgstr "" msgid "Confetti ball" msgstr "" +#: internal/app/application_profiles.go:271 +msgid "Confirm" +msgstr "" + #: internal/applicationoverrides/ninjam/ninjam.go:159 msgid "Connection, tempo and interval" msgstr "" @@ -725,7 +749,7 @@ msgstr "" msgid "Copied" msgstr "" -#: internal/app/application_overrides.go:367 +#: internal/app/application_profiles.go:122 msgid "Copy alias to clipboard" msgstr "" @@ -745,15 +769,19 @@ msgstr "" msgid "Could not check spelling: {0}" msgstr "" +#: internal/app/application_profiles.go:313 +msgid "Could not delete application profile: {0}" +msgstr "" + #: internal/app/fenrir_menu.go:185 internal/app/voice_profiles.go:68 msgid "Could not edit voice profiles: {0}" msgstr "" -#: internal/app/application_overrides.go:319 internal/app/application_overrides.go:86 +#: internal/app/application_overrides.go:318 internal/app/application_overrides.go:83 msgid "Could not load application settings: {0}" msgstr "" -#: internal/app/application_overrides.go:371 internal/app/application_overrides.go:375 +#: internal/app/application_overrides.go:359 internal/app/application_profiles.go:127 internal/app/application_profiles.go:174 internal/app/application_profiles.go:276 msgid "Could not open Applications: {0}" msgstr "" @@ -773,10 +801,14 @@ msgstr "" msgid "Could not open Spellcheck Menu: {0}" msgstr "" -#: internal/app/application_overrides.go:172 internal/app/application_overrides.go:337 +#: internal/app/application_overrides.go:169 internal/app/application_overrides.go:336 msgid "Could not restore application settings: {0}" msgstr "" +#: internal/app/application_profiles.go:238 +msgid "Could not save application profile: {0}" +msgstr "" + #: internal/app/spellcheck_menu.go:156 msgid "Could not save exceptions: {0}" msgstr "" @@ -805,6 +837,10 @@ msgstr "" msgid "Cowboy hat face" msgstr "" +#: internal/app/application_profiles.go:170 +msgid "Create" +msgstr "" + #: screenreader-common/emoji/catalog.go msgid "Cricket" msgstr "" @@ -881,15 +917,19 @@ msgstr "" msgid "Deer" msgstr "" -#: internal/app/application_overrides.go:359 screenreader-common/voiceprofiles/editor.go +#: internal/app/application_profiles.go:86 screenreader-common/voiceprofiles/editor.go msgid "Default" msgstr "" -#: internal/app/application_overrides.go:394 +#: internal/app/application_profiles.go:146 msgid "Default has no application alias" msgstr "" -#: internal/app/application_overrides.go:216 internal/app/application_overrides.go:280 +#: internal/app/application_profiles.go:203 +msgid "Default has no application profile" +msgstr "" + +#: internal/app/application_overrides.go:213 internal/app/application_overrides.go:279 msgid "Default settings restored" msgstr "" @@ -901,10 +941,18 @@ msgstr "" msgid "Defined interruption keys" msgstr "" +#: internal/app/application_profiles.go:271 +msgid "Delete application profile {0}?" +msgstr "" + #: internal/applicationoverrides/ninjam/ninjam.go:279 msgid "Delete channel" msgstr "" +#: internal/app/application_profiles.go:121 +msgid "Delete profile" +msgstr "" + #: screenreader-common/internalui msgid "Deleted {0}" msgstr "" @@ -1525,6 +1573,10 @@ msgstr "" msgid "Interval position {0} of {1}" msgstr "" +#: internal/app/application_profiles.go:187 +msgid "Invalid profile name: {0}" +msgstr "" + #: screenreader-common/internalui msgid "Invalid text" msgstr "" @@ -1957,7 +2009,7 @@ msgstr "" msgid "Netherlands" msgstr "" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:26 msgid "NetworkManager" msgstr "" @@ -1965,11 +2017,19 @@ msgstr "" msgid "New Moon" msgstr "" +#: internal/app/application_profiles.go:168 +msgid "New application profile" +msgstr "" + #: internal/applicationoverrides/ninjam/ninjam.go:282 msgid "New channel" msgstr "" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:119 +msgid "New profile" +msgstr "" + +#: internal/app/application_profiles.go:28 msgid "Ninjam" msgstr "" @@ -1981,6 +2041,10 @@ msgstr "" msgid "Ninjam regions: 1 latest chat message; 2 selected channel or control; 3 connection, tempo and interval" msgstr "" +#: internal/app/application_profiles.go:272 +msgid "No" +msgstr "" + #: internal/applicationoverrides/codex/codex.go:139 msgid "No Codex message received" msgstr "" @@ -2385,6 +2449,14 @@ msgstr "" msgid "Printer" msgstr "" +#: internal/app/application_profiles.go:168 +msgid "Profile" +msgstr "" + +#: internal/app/application_profiles.go:169 +msgid "Profile name" +msgstr "" + #: internal/app/commands.go:173 msgid "Progress monitoring disabled" msgstr "" @@ -2641,7 +2713,7 @@ msgstr "" msgid "Rocket" msgstr "" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:30 msgid "Rogue" msgstr "" @@ -2829,7 +2901,7 @@ msgstr "" msgid "Set window begin and end marks" msgstr "" -#: internal/app/application_overrides.go:183 internal/app/application_overrides.go:356 internal/app/commands.go:124 +#: internal/app/application_overrides.go:180 internal/app/application_overrides.go:355 internal/app/application_profiles.go:165 internal/app/application_profiles.go:215 internal/app/application_profiles.go:268 internal/app/application_profiles.go:293 internal/app/commands.go:124 msgid "Settings are busy" msgstr "" @@ -3361,6 +3433,10 @@ msgstr "" msgid "Up Arrow" msgstr "" +#: internal/app/application_profiles.go:120 +msgid "Update profile" +msgstr "" + #: screenreader-common/emoji/catalog.go msgid "Upside Down Face" msgstr "" @@ -3557,6 +3633,10 @@ msgstr "" msgid "Yellow heart" msgstr "" +#: internal/app/application_profiles.go:273 +msgid "Yes" +msgstr "" + #: screenreader-common/emoji/catalog.go msgid "Zany Face" msgstr "" @@ -4437,7 +4517,7 @@ msgstr "" msgid "{0} added to dictionary" msgstr "" -#: internal/app/application_overrides.go:242 +#: internal/app/application_overrides.go:241 msgid "{0} application override selected" msgstr "" diff --git a/internal/i18n/locale/pl/LC_MESSAGES/fenrir.po b/internal/i18n/locale/pl/LC_MESSAGES/fenrir.po index 7df9e0d6..8e96fcda 100644 --- a/internal/i18n/locale/pl/LC_MESSAGES/fenrir.po +++ b/internal/i18n/locale/pl/LC_MESSAGES/fenrir.po @@ -156,15 +156,31 @@ msgstr "Apostrof" msgid "Apple" msgstr "Jabłko" -#: internal/app/application_overrides.go:366 +#: internal/app/application_profiles.go:118 msgid "Application" msgstr "Aplikacja" -#: internal/app/application_overrides.go:398 +#: internal/app/application_profiles.go:150 msgid "Application alias copied to clipboard" msgstr "Alias aplikacji skopiowany do schowka" -#: internal/app/application_overrides.go:365 +#: internal/app/application_profiles.go:191 +msgid "Application profile {0} already exists; use Update profile" +msgstr "Profil aplikacji {0} już istnieje; użyj Aktualizuj profil" + +#: internal/app/application_profiles.go:195 +msgid "Application profile {0} created" +msgstr "Utworzono profil aplikacji {0}" + +#: internal/app/application_profiles.go:316 +msgid "Application profile {0} deleted" +msgstr "Usunięto profil aplikacji {0}" + +#: internal/app/application_profiles.go:207 +msgid "Application profile {0} updated" +msgstr "Zaktualizowano profil aplikacji {0}" + +#: internal/app/application_profiles.go:117 msgid "Applications" msgstr "Aplikacje" @@ -409,6 +425,10 @@ msgstr "Przeglądaj powiadomienia z godzinami ich otrzymania" msgid "Bug" msgstr "gąsienica" +#: internal/app/application_profiles.go:264 +msgid "Built-in applications cannot be deleted" +msgstr "Nie można usunąć wbudowanych aplikacji" + #: screenreader-common/emoji/catalog.go msgid "Bunny" msgstr "Królik" @@ -449,7 +469,8 @@ msgstr "aparat fotograficzny z lampą błyskową" msgid "Canada" msgstr "Kanada" -#: internal/app/application_overrides.go:368 +#: internal/app/application_profiles.go:123 +#: internal/app/application_profiles.go:171 #: internal/preferences/settings.go:105 internal/preferences/settings.go:98 #: screenreader-common/voiceprofiles/editor.go msgid "Cancel" @@ -611,7 +632,7 @@ msgstr "stukające się kieliszki" msgid "Clipboard" msgstr "Schowek" -#: internal/app/application.go:169 internal/app/application.go:172 +#: internal/app/application.go:170 internal/app/application.go:173 #: internal/app/clipboard.go:226 internal/app/clipboard.go:382 msgid "Clipboard import failed" msgstr "Importowanie schowka nie powiodło się" @@ -648,7 +669,7 @@ msgstr "kieliszek z koktajlem" msgid "Coconut" msgstr "Orzech kokosowy" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:32 msgid "Codex" msgstr "Codex" @@ -717,6 +738,10 @@ msgstr "Mysz komputerowa" msgid "Confetti ball" msgstr "Kula konfetti" +#: internal/app/application_profiles.go:271 +msgid "Confirm" +msgstr "Potwierdź" + #: internal/applicationoverrides/ninjam/ninjam.go:159 msgid "Connection, tempo and interval" msgstr "Połączenie, tempo i interwał" @@ -741,7 +766,7 @@ msgstr "Wyluzowanie" msgid "Copied" msgstr "Skopiowano" -#: internal/app/application_overrides.go:367 +#: internal/app/application_profiles.go:122 msgid "Copy alias to clipboard" msgstr "Kopiuj alias do schowka" @@ -761,17 +786,23 @@ msgstr "Kukurydza" msgid "Could not check spelling: {0}" msgstr "Nie można sprawdzić pisowni: {0}" +#: internal/app/application_profiles.go:313 +msgid "Could not delete application profile: {0}" +msgstr "Nie można usunąć profilu aplikacji: {0}" + #: internal/app/fenrir_menu.go:185 internal/app/voice_profiles.go:68 msgid "Could not edit voice profiles: {0}" msgstr "Nie można edytować profili głosu: {0}" -#: internal/app/application_overrides.go:319 -#: internal/app/application_overrides.go:86 +#: internal/app/application_overrides.go:318 +#: internal/app/application_overrides.go:83 msgid "Could not load application settings: {0}" msgstr "Nie można wczytać ustawień aplikacji: {0}" -#: internal/app/application_overrides.go:371 -#: internal/app/application_overrides.go:375 +#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:127 +#: internal/app/application_profiles.go:174 +#: internal/app/application_profiles.go:276 msgid "Could not open Applications: {0}" msgstr "Nie można otworzyć menu aplikacji: {0}" @@ -793,11 +824,15 @@ msgstr "Nie można otworzyć powiadomień: {0}" msgid "Could not open Spellcheck Menu: {0}" msgstr "Nie można otworzyć menu sprawdzania pisowni: {0}" -#: internal/app/application_overrides.go:172 -#: internal/app/application_overrides.go:337 +#: internal/app/application_overrides.go:169 +#: internal/app/application_overrides.go:336 msgid "Could not restore application settings: {0}" msgstr "Nie można przywrócić ustawień aplikacji: {0}" +#: internal/app/application_profiles.go:238 +msgid "Could not save application profile: {0}" +msgstr "Nie można zapisać profilu aplikacji: {0}" + #: internal/app/spellcheck_menu.go:156 msgid "Could not save exceptions: {0}" msgstr "Nie można zapisać wyjątków: {0}" @@ -827,6 +862,10 @@ msgstr "Twarz krowy" msgid "Cowboy hat face" msgstr "Twarz w kapeluszu kowbojskim" +#: internal/app/application_profiles.go:170 +msgid "Create" +msgstr "Utwórz" + #: screenreader-common/emoji/catalog.go msgid "Cricket" msgstr "świerszcz" @@ -903,17 +942,21 @@ msgstr "Format daty" msgid "Deer" msgstr "Jeleń" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:86 #: screenreader-common/voiceprofiles/editor.go msgid "Default" msgstr "Domyślne" -#: internal/app/application_overrides.go:394 +#: internal/app/application_profiles.go:146 msgid "Default has no application alias" msgstr "Ustawienia domyślne nie mają aliasu aplikacji" -#: internal/app/application_overrides.go:216 -#: internal/app/application_overrides.go:280 +#: internal/app/application_profiles.go:203 +msgid "Default has no application profile" +msgstr "Domyślne nie ma profilu aplikacji" + +#: internal/app/application_overrides.go:213 +#: internal/app/application_overrides.go:279 msgid "Default settings restored" msgstr "Przywrócono ustawienia domyślne" @@ -925,10 +968,18 @@ msgstr "Zdefiniuj klawisze przerywania" msgid "Defined interruption keys" msgstr "Zdefiniowane klawisze przerywania" +#: internal/app/application_profiles.go:271 +msgid "Delete application profile {0}?" +msgstr "Usunąć profil aplikacji {0}?" + #: internal/applicationoverrides/ninjam/ninjam.go:279 msgid "Delete channel" msgstr "Usuń kanał" +#: internal/app/application_profiles.go:121 +msgid "Delete profile" +msgstr "Usuń profil" + #: screenreader-common/internalui msgid "Deleted {0}" msgstr "Usunięto: {0}" @@ -1561,6 +1612,10 @@ msgstr "Interfejs wewnętrzny" msgid "Interval position {0} of {1}" msgstr "Pozycja interwału {0} z {1}" +#: internal/app/application_profiles.go:187 +msgid "Invalid profile name: {0}" +msgstr "Nieprawidłowa nazwa profilu: {0}" + #: screenreader-common/internalui msgid "Invalid text" msgstr "Nieprawidłowy tekst" @@ -1998,7 +2053,7 @@ msgstr "kujon" msgid "Netherlands" msgstr "Holandia" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:26 msgid "NetworkManager" msgstr "NetworkManager" @@ -2006,11 +2061,19 @@ msgstr "NetworkManager" msgid "New Moon" msgstr "nów" +#: internal/app/application_profiles.go:168 +msgid "New application profile" +msgstr "Nowy profil aplikacji" + #: internal/applicationoverrides/ninjam/ninjam.go:282 msgid "New channel" msgstr "Nowy kanał" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:119 +msgid "New profile" +msgstr "Nowy profil" + +#: internal/app/application_profiles.go:28 msgid "Ninjam" msgstr "Ninjam" @@ -2026,6 +2089,10 @@ msgstr "" "Regiony Ninjam: 1 ostatnia wiadomość czatu; 2 wybrany kanał lub element " "sterujący; 3 połączenie, tempo i interwał" +#: internal/app/application_profiles.go:272 +msgid "No" +msgstr "Nie" + #: internal/applicationoverrides/codex/codex.go:139 msgid "No Codex message received" msgstr "Nie otrzymano wiadomości od Codex" @@ -2441,6 +2508,14 @@ msgstr "Print Screen" msgid "Printer" msgstr "Drukarka" +#: internal/app/application_profiles.go:168 +msgid "Profile" +msgstr "Profil" + +#: internal/app/application_profiles.go:169 +msgid "Profile name" +msgstr "Nazwa profilu" + #: internal/app/commands.go:173 msgid "Progress monitoring disabled" msgstr "Monitorowanie postępu wyłączone" @@ -2698,7 +2773,7 @@ msgstr "Gest rockowy" msgid "Rocket" msgstr "Rakieta" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:30 msgid "Rogue" msgstr "Rogue" @@ -2886,8 +2961,12 @@ msgstr "Ustaw obszar dynamiczny za pomocą jednego lub dwóch znaczników" msgid "Set window begin and end marks" msgstr "Ustaw początek i koniec okna." -#: internal/app/application_overrides.go:183 -#: internal/app/application_overrides.go:356 internal/app/commands.go:124 +#: internal/app/application_overrides.go:180 +#: internal/app/application_overrides.go:355 +#: internal/app/application_profiles.go:165 +#: internal/app/application_profiles.go:215 +#: internal/app/application_profiles.go:268 +#: internal/app/application_profiles.go:293 internal/app/commands.go:124 msgid "Settings are busy" msgstr "Ustawienia są zajęte" @@ -3428,6 +3507,10 @@ msgstr "Niewidoczne" msgid "Up Arrow" msgstr "Strzałka w górę" +#: internal/app/application_profiles.go:120 +msgid "Update profile" +msgstr "Aktualizuj profil" + #: screenreader-common/emoji/catalog.go msgid "Upside Down Face" msgstr "odwrócona twarz" @@ -3629,6 +3712,10 @@ msgstr "Ziewająca twarz" msgid "Yellow heart" msgstr "Żółte serce" +#: internal/app/application_profiles.go:273 +msgid "Yes" +msgstr "Tak" + #: screenreader-common/emoji/catalog.go msgid "Zany Face" msgstr "szalona twarz" @@ -4563,7 +4650,7 @@ msgstr "mrugnięcie" msgid "{0} added to dictionary" msgstr "Dodano {0} do słownika" -#: internal/app/application_overrides.go:242 +#: internal/app/application_overrides.go:241 msgid "{0} application override selected" msgstr "Wybrano ustawienia aplikacji {0}" diff --git a/internal/i18n/locale/pt/LC_MESSAGES/fenrir.po b/internal/i18n/locale/pt/LC_MESSAGES/fenrir.po index 4391e545..82517399 100644 --- a/internal/i18n/locale/pt/LC_MESSAGES/fenrir.po +++ b/internal/i18n/locale/pt/LC_MESSAGES/fenrir.po @@ -154,15 +154,31 @@ msgstr "Apóstrofo" msgid "Apple" msgstr "Maçã" -#: internal/app/application_overrides.go:366 +#: internal/app/application_profiles.go:118 msgid "Application" msgstr "Aplicativo" -#: internal/app/application_overrides.go:398 +#: internal/app/application_profiles.go:150 msgid "Application alias copied to clipboard" msgstr "Alias da aplicação copiado para a área de transferência" -#: internal/app/application_overrides.go:365 +#: internal/app/application_profiles.go:191 +msgid "Application profile {0} already exists; use Update profile" +msgstr "O perfil de aplicação {0} já existe; use Atualizar perfil" + +#: internal/app/application_profiles.go:195 +msgid "Application profile {0} created" +msgstr "Perfil de aplicação {0} criado" + +#: internal/app/application_profiles.go:316 +msgid "Application profile {0} deleted" +msgstr "Perfil de aplicação {0} excluído" + +#: internal/app/application_profiles.go:207 +msgid "Application profile {0} updated" +msgstr "Perfil de aplicação {0} atualizado" + +#: internal/app/application_profiles.go:117 msgid "Applications" msgstr "Aplicativos" @@ -407,6 +423,10 @@ msgstr "Explorar notificações com as horas de receção" msgid "Bug" msgstr "Inseto" +#: internal/app/application_profiles.go:264 +msgid "Built-in applications cannot be deleted" +msgstr "Aplicações integradas não podem ser excluídas" + #: screenreader-common/emoji/catalog.go msgid "Bunny" msgstr "Coelho" @@ -447,7 +467,8 @@ msgstr "Câmera com flash" msgid "Canada" msgstr "Canadá" -#: internal/app/application_overrides.go:368 +#: internal/app/application_profiles.go:123 +#: internal/app/application_profiles.go:171 #: internal/preferences/settings.go:105 internal/preferences/settings.go:98 #: screenreader-common/voiceprofiles/editor.go msgid "Cancel" @@ -609,7 +630,7 @@ msgstr "Taças brindando" msgid "Clipboard" msgstr "Área de transferência" -#: internal/app/application.go:169 internal/app/application.go:172 +#: internal/app/application.go:170 internal/app/application.go:173 #: internal/app/clipboard.go:226 internal/app/clipboard.go:382 msgid "Clipboard import failed" msgstr "Falha ao importar a área de transferência" @@ -646,7 +667,7 @@ msgstr "Coquetel" msgid "Coconut" msgstr "Coco" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:32 msgid "Codex" msgstr "Codex" @@ -715,6 +736,10 @@ msgstr "Mouse de computador" msgid "Confetti ball" msgstr "Bola de confete" +#: internal/app/application_profiles.go:271 +msgid "Confirm" +msgstr "Confirmar" + #: internal/applicationoverrides/ninjam/ninjam.go:159 msgid "Connection, tempo and interval" msgstr "Conexão, andamento e intervalo" @@ -739,7 +764,7 @@ msgstr "Legal" msgid "Copied" msgstr "Copiado" -#: internal/app/application_overrides.go:367 +#: internal/app/application_profiles.go:122 msgid "Copy alias to clipboard" msgstr "Copiar alias para a área de transferência" @@ -759,17 +784,23 @@ msgstr "Milho" msgid "Could not check spelling: {0}" msgstr "Não foi possível verificar a ortografia: {0}" +#: internal/app/application_profiles.go:313 +msgid "Could not delete application profile: {0}" +msgstr "Não foi possível excluir o perfil de aplicação: {0}" + #: internal/app/fenrir_menu.go:185 internal/app/voice_profiles.go:68 msgid "Could not edit voice profiles: {0}" msgstr "Não foi possível editar os perfis de voz: {0}" -#: internal/app/application_overrides.go:319 -#: internal/app/application_overrides.go:86 +#: internal/app/application_overrides.go:318 +#: internal/app/application_overrides.go:83 msgid "Could not load application settings: {0}" msgstr "Não foi possível carregar as configurações do aplicativo: {0}" -#: internal/app/application_overrides.go:371 -#: internal/app/application_overrides.go:375 +#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:127 +#: internal/app/application_profiles.go:174 +#: internal/app/application_profiles.go:276 msgid "Could not open Applications: {0}" msgstr "Não foi possível abrir Aplicativos: {0}" @@ -791,11 +822,15 @@ msgstr "Não foi possível abrir as notificações: {0}" msgid "Could not open Spellcheck Menu: {0}" msgstr "Não foi possível abrir o menu de ortografia: {0}" -#: internal/app/application_overrides.go:172 -#: internal/app/application_overrides.go:337 +#: internal/app/application_overrides.go:169 +#: internal/app/application_overrides.go:336 msgid "Could not restore application settings: {0}" msgstr "Não foi possível restaurar as configurações do aplicativo: {0}" +#: internal/app/application_profiles.go:238 +msgid "Could not save application profile: {0}" +msgstr "Não foi possível salvar o perfil de aplicação: {0}" + #: internal/app/spellcheck_menu.go:156 msgid "Could not save exceptions: {0}" msgstr "Não foi possível salvar as exceções: {0}" @@ -825,6 +860,10 @@ msgstr "Cara de vaca" msgid "Cowboy hat face" msgstr "Cara com chapéu de cowboy" +#: internal/app/application_profiles.go:170 +msgid "Create" +msgstr "Criar" + #: screenreader-common/emoji/catalog.go msgid "Cricket" msgstr "Grilo" @@ -901,17 +940,21 @@ msgstr "Formato da data" msgid "Deer" msgstr "Cervo" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:86 #: screenreader-common/voiceprofiles/editor.go msgid "Default" msgstr "Padrão" -#: internal/app/application_overrides.go:394 +#: internal/app/application_profiles.go:146 msgid "Default has no application alias" msgstr "Padrão não tem um alias de aplicação" -#: internal/app/application_overrides.go:216 -#: internal/app/application_overrides.go:280 +#: internal/app/application_profiles.go:203 +msgid "Default has no application profile" +msgstr "Padrão não tem perfil de aplicação" + +#: internal/app/application_overrides.go:213 +#: internal/app/application_overrides.go:279 msgid "Default settings restored" msgstr "Configurações padrão restauradas" @@ -923,10 +966,18 @@ msgstr "Definir teclas de interrupção" msgid "Defined interruption keys" msgstr "Teclas de interrupção definidas" +#: internal/app/application_profiles.go:271 +msgid "Delete application profile {0}?" +msgstr "Excluir o perfil de aplicação {0}?" + #: internal/applicationoverrides/ninjam/ninjam.go:279 msgid "Delete channel" msgstr "Excluir canal" +#: internal/app/application_profiles.go:121 +msgid "Delete profile" +msgstr "Excluir perfil" + #: screenreader-common/internalui msgid "Deleted {0}" msgstr "Excluído: {0}" @@ -1561,6 +1612,10 @@ msgstr "Interface interna" msgid "Interval position {0} of {1}" msgstr "Posição do intervalo {0} de {1}" +#: internal/app/application_profiles.go:187 +msgid "Invalid profile name: {0}" +msgstr "Nome de perfil inválido: {0}" + #: screenreader-common/internalui msgid "Invalid text" msgstr "Texto inválido" @@ -2000,7 +2055,7 @@ msgstr "Rosto de nerd" msgid "Netherlands" msgstr "Países Baixos" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:26 msgid "NetworkManager" msgstr "NetworkManager" @@ -2008,11 +2063,19 @@ msgstr "NetworkManager" msgid "New Moon" msgstr "Lua nova" +#: internal/app/application_profiles.go:168 +msgid "New application profile" +msgstr "Novo perfil de aplicação" + #: internal/applicationoverrides/ninjam/ninjam.go:282 msgid "New channel" msgstr "Novo canal" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:119 +msgid "New profile" +msgstr "Novo perfil" + +#: internal/app/application_profiles.go:28 msgid "Ninjam" msgstr "Ninjam" @@ -2028,6 +2091,10 @@ msgstr "" "Regiões do Ninjam: 1 última mensagem do chat; 2 canal ou controle " "selecionado; 3 conexão, andamento e intervalo" +#: internal/app/application_profiles.go:272 +msgid "No" +msgstr "Não" + #: internal/applicationoverrides/codex/codex.go:139 msgid "No Codex message received" msgstr "Nenhuma mensagem do Codex recebida" @@ -2444,6 +2511,14 @@ msgstr "Print Screen" msgid "Printer" msgstr "Impressora" +#: internal/app/application_profiles.go:168 +msgid "Profile" +msgstr "Perfil" + +#: internal/app/application_profiles.go:169 +msgid "Profile name" +msgstr "Nome do perfil" + #: internal/app/commands.go:173 msgid "Progress monitoring disabled" msgstr "Monitoramento de progresso desativado" @@ -2700,7 +2775,7 @@ msgstr "Gesto de rock" msgid "Rocket" msgstr "Foguete" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:30 msgid "Rogue" msgstr "Rogue" @@ -2888,8 +2963,12 @@ msgstr "Definir uma região dinâmica a partir de uma ou duas marcas" msgid "Set window begin and end marks" msgstr "Definir marcas de início e fim da janela" -#: internal/app/application_overrides.go:183 -#: internal/app/application_overrides.go:356 internal/app/commands.go:124 +#: internal/app/application_overrides.go:180 +#: internal/app/application_overrides.go:355 +#: internal/app/application_profiles.go:165 +#: internal/app/application_profiles.go:215 +#: internal/app/application_profiles.go:268 +#: internal/app/application_profiles.go:293 internal/app/commands.go:124 msgid "Settings are busy" msgstr "As configurações estão ocupadas" @@ -3430,6 +3509,10 @@ msgstr "Não visível" msgid "Up Arrow" msgstr "Seta para cima" +#: internal/app/application_profiles.go:120 +msgid "Update profile" +msgstr "Atualizar perfil" + #: screenreader-common/emoji/catalog.go msgid "Upside Down Face" msgstr "Rosto de cabeça para baixo" @@ -3632,6 +3715,10 @@ msgstr "Cara bocejando" msgid "Yellow heart" msgstr "Coração amarelo" +#: internal/app/application_profiles.go:273 +msgid "Yes" +msgstr "Sim" + #: screenreader-common/emoji/catalog.go msgid "Zany Face" msgstr "Rosto bizarro" @@ -4574,7 +4661,7 @@ msgstr "piscadela" msgid "{0} added to dictionary" msgstr "{0} adicionado ao dicionário" -#: internal/app/application_overrides.go:242 +#: internal/app/application_overrides.go:241 msgid "{0} application override selected" msgstr "Configurações do aplicativo {0} selecionadas" diff --git a/internal/i18n/locale/ru/LC_MESSAGES/fenrir.po b/internal/i18n/locale/ru/LC_MESSAGES/fenrir.po index b0b7ac74..fbafd4dd 100644 --- a/internal/i18n/locale/ru/LC_MESSAGES/fenrir.po +++ b/internal/i18n/locale/ru/LC_MESSAGES/fenrir.po @@ -153,15 +153,31 @@ msgstr "Апостроф" msgid "Apple" msgstr "Яблоко" -#: internal/app/application_overrides.go:366 +#: internal/app/application_profiles.go:118 msgid "Application" msgstr "Приложение" -#: internal/app/application_overrides.go:398 +#: internal/app/application_profiles.go:150 msgid "Application alias copied to clipboard" msgstr "Псевдоним приложения скопирован в буфер обмена" -#: internal/app/application_overrides.go:365 +#: internal/app/application_profiles.go:191 +msgid "Application profile {0} already exists; use Update profile" +msgstr "Профиль приложения {0} уже существует; используйте Обновить профиль" + +#: internal/app/application_profiles.go:195 +msgid "Application profile {0} created" +msgstr "Профиль приложения {0} создан" + +#: internal/app/application_profiles.go:316 +msgid "Application profile {0} deleted" +msgstr "Профиль приложения {0} удалён" + +#: internal/app/application_profiles.go:207 +msgid "Application profile {0} updated" +msgstr "Профиль приложения {0} обновлён" + +#: internal/app/application_profiles.go:117 msgid "Applications" msgstr "Приложения" @@ -406,6 +422,10 @@ msgstr "Просмотр уведомлений со временем получ msgid "Bug" msgstr "Гусеница" +#: internal/app/application_profiles.go:264 +msgid "Built-in applications cannot be deleted" +msgstr "Встроенные приложения нельзя удалить" + #: screenreader-common/emoji/catalog.go msgid "Bunny" msgstr "Кролик" @@ -446,7 +466,8 @@ msgstr "Фотоаппарат со вспышкой" msgid "Canada" msgstr "Канада" -#: internal/app/application_overrides.go:368 +#: internal/app/application_profiles.go:123 +#: internal/app/application_profiles.go:171 #: internal/preferences/settings.go:105 internal/preferences/settings.go:98 #: screenreader-common/voiceprofiles/editor.go msgid "Cancel" @@ -608,7 +629,7 @@ msgstr "Чокающиеся бокалы" msgid "Clipboard" msgstr "Буфер обмена" -#: internal/app/application.go:169 internal/app/application.go:172 +#: internal/app/application.go:170 internal/app/application.go:173 #: internal/app/clipboard.go:226 internal/app/clipboard.go:382 msgid "Clipboard import failed" msgstr "Не удалось импортировать буфер обмена" @@ -645,7 +666,7 @@ msgstr "Коктейль" msgid "Coconut" msgstr "Кокос" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:32 msgid "Codex" msgstr "Codex" @@ -714,6 +735,10 @@ msgstr "Компьютерная мышь" msgid "Confetti ball" msgstr "Шар с конфетти" +#: internal/app/application_profiles.go:271 +msgid "Confirm" +msgstr "Подтверждение" + #: internal/applicationoverrides/ninjam/ninjam.go:159 msgid "Connection, tempo and interval" msgstr "Соединение, темп и интервал" @@ -738,7 +763,7 @@ msgstr "Круто" msgid "Copied" msgstr "Скопировано" -#: internal/app/application_overrides.go:367 +#: internal/app/application_profiles.go:122 msgid "Copy alias to clipboard" msgstr "Копировать псевдоним в буфер обмена" @@ -758,17 +783,23 @@ msgstr "Кукуруза" msgid "Could not check spelling: {0}" msgstr "Не удалось проверить правописание: {0}" +#: internal/app/application_profiles.go:313 +msgid "Could not delete application profile: {0}" +msgstr "Не удалось удалить профиль приложения: {0}" + #: internal/app/fenrir_menu.go:185 internal/app/voice_profiles.go:68 msgid "Could not edit voice profiles: {0}" msgstr "Не удалось изменить голосовые профили: {0}" -#: internal/app/application_overrides.go:319 -#: internal/app/application_overrides.go:86 +#: internal/app/application_overrides.go:318 +#: internal/app/application_overrides.go:83 msgid "Could not load application settings: {0}" msgstr "Не удалось загрузить настройки приложения: {0}" -#: internal/app/application_overrides.go:371 -#: internal/app/application_overrides.go:375 +#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:127 +#: internal/app/application_profiles.go:174 +#: internal/app/application_profiles.go:276 msgid "Could not open Applications: {0}" msgstr "Не удалось открыть меню приложений: {0}" @@ -790,11 +821,15 @@ msgstr "Не удалось открыть уведомления: {0}" msgid "Could not open Spellcheck Menu: {0}" msgstr "Не удалось открыть меню проверки правописания: {0}" -#: internal/app/application_overrides.go:172 -#: internal/app/application_overrides.go:337 +#: internal/app/application_overrides.go:169 +#: internal/app/application_overrides.go:336 msgid "Could not restore application settings: {0}" msgstr "Не удалось восстановить настройки приложения: {0}" +#: internal/app/application_profiles.go:238 +msgid "Could not save application profile: {0}" +msgstr "Не удалось сохранить профиль приложения: {0}" + #: internal/app/spellcheck_menu.go:156 msgid "Could not save exceptions: {0}" msgstr "Не удалось сохранить исключения: {0}" @@ -824,6 +859,10 @@ msgstr "Голова коровы" msgid "Cowboy hat face" msgstr "Лицо в ковбойской шляпе" +#: internal/app/application_profiles.go:170 +msgid "Create" +msgstr "Создать" + #: screenreader-common/emoji/catalog.go msgid "Cricket" msgstr "Сверчок" @@ -900,17 +939,21 @@ msgstr "Формат даты" msgid "Deer" msgstr "Олень" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:86 #: screenreader-common/voiceprofiles/editor.go msgid "Default" msgstr "По умолчанию" -#: internal/app/application_overrides.go:394 +#: internal/app/application_profiles.go:146 msgid "Default has no application alias" msgstr "Для настроек по умолчанию нет псевдонима приложения" -#: internal/app/application_overrides.go:216 -#: internal/app/application_overrides.go:280 +#: internal/app/application_profiles.go:203 +msgid "Default has no application profile" +msgstr "У варианта По умолчанию нет профиля приложения" + +#: internal/app/application_overrides.go:213 +#: internal/app/application_overrides.go:279 msgid "Default settings restored" msgstr "Настройки по умолчанию восстановлены" @@ -922,10 +965,18 @@ msgstr "Задать клавиши прерывания речи" msgid "Defined interruption keys" msgstr "Заданные клавиши прерывания речи" +#: internal/app/application_profiles.go:271 +msgid "Delete application profile {0}?" +msgstr "Удалить профиль приложения {0}?" + #: internal/applicationoverrides/ninjam/ninjam.go:279 msgid "Delete channel" msgstr "Удалить канал" +#: internal/app/application_profiles.go:121 +msgid "Delete profile" +msgstr "Удалить профиль" + #: screenreader-common/internalui msgid "Deleted {0}" msgstr "Удалено: {0}" @@ -1557,6 +1608,10 @@ msgstr "Внутренний интерфейс" msgid "Interval position {0} of {1}" msgstr "Позиция интервала {0} из {1}" +#: internal/app/application_profiles.go:187 +msgid "Invalid profile name: {0}" +msgstr "Недопустимое имя профиля: {0}" + #: screenreader-common/internalui msgid "Invalid text" msgstr "Недопустимый текст" @@ -1993,7 +2048,7 @@ msgstr "Очкарик" msgid "Netherlands" msgstr "Нидерланды" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:26 msgid "NetworkManager" msgstr "NetworkManager" @@ -2001,11 +2056,19 @@ msgstr "NetworkManager" msgid "New Moon" msgstr "Новолуние" +#: internal/app/application_profiles.go:168 +msgid "New application profile" +msgstr "Новый профиль приложения" + #: internal/applicationoverrides/ninjam/ninjam.go:282 msgid "New channel" msgstr "Новый канал" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:119 +msgid "New profile" +msgstr "Новый профиль" + +#: internal/app/application_profiles.go:28 msgid "Ninjam" msgstr "Ninjam" @@ -2021,6 +2084,10 @@ msgstr "" "Области Ninjam: 1 последнее сообщение чата; 2 выбранный канал или элемент " "управления; 3 соединение, темп и интервал" +#: internal/app/application_profiles.go:272 +msgid "No" +msgstr "Нет" + #: internal/applicationoverrides/codex/codex.go:139 msgid "No Codex message received" msgstr "Сообщений от Codex не получено" @@ -2436,6 +2503,14 @@ msgstr "Print Screen" msgid "Printer" msgstr "Принтер" +#: internal/app/application_profiles.go:168 +msgid "Profile" +msgstr "Профиль" + +#: internal/app/application_profiles.go:169 +msgid "Profile name" +msgstr "Имя профиля" + #: internal/app/commands.go:173 msgid "Progress monitoring disabled" msgstr "Отслеживание хода выполнения отключено" @@ -2692,7 +2767,7 @@ msgstr "Рокерский жест" msgid "Rocket" msgstr "Ракета" -#: internal/app/application_overrides.go:359 +#: internal/app/application_profiles.go:30 msgid "Rogue" msgstr "Rogue" @@ -2880,8 +2955,12 @@ msgstr "Задать динамическую область по одной и msgid "Set window begin and end marks" msgstr "Установка начала и конца окна" -#: internal/app/application_overrides.go:183 -#: internal/app/application_overrides.go:356 internal/app/commands.go:124 +#: internal/app/application_overrides.go:180 +#: internal/app/application_overrides.go:355 +#: internal/app/application_profiles.go:165 +#: internal/app/application_profiles.go:215 +#: internal/app/application_profiles.go:268 +#: internal/app/application_profiles.go:293 internal/app/commands.go:124 msgid "Settings are busy" msgstr "Настройки заняты" @@ -3422,6 +3501,10 @@ msgstr "Не видно" msgid "Up Arrow" msgstr "Стрелка вверх" +#: internal/app/application_profiles.go:120 +msgid "Update profile" +msgstr "Обновить профиль" + #: screenreader-common/emoji/catalog.go msgid "Upside Down Face" msgstr "Вверх тормашками" @@ -3624,6 +3707,10 @@ msgstr "Зевающее лицо" msgid "Yellow heart" msgstr "Жёлтое сердце" +#: internal/app/application_profiles.go:273 +msgid "Yes" +msgstr "Да" + #: screenreader-common/emoji/catalog.go msgid "Zany Face" msgstr "Сумасшедшее лицо" @@ -4558,7 +4645,7 @@ msgstr "подмигивание" msgid "{0} added to dictionary" msgstr "{0} добавлено в словарь" -#: internal/app/application_overrides.go:242 +#: internal/app/application_overrides.go:241 msgid "{0} application override selected" msgstr "Выбраны настройки приложения {0}"