Expand description
The strings egui-pop shows (Cancel, Retry, accessibility
descriptions, the titles of what plugins declare), by key with English
fallbacks. An application installs a Strings provider (the
egui-pop-i18n plugin, for instance); without one, the fallbacks are
used.
Keys are Fluent message ids, with an optional attribute
(egui-pop-retry, command-app-quit.title), so a provider can read
them from .ftl catalogues as they are. Placeholders are written as
Fluent writes them, { $name }, and filled by tr_args with text
kept as given (a folder named “2026” stays “2026”), or by tr_with
with typed Args, where a number (Arg::Num) is written as the
language writes numbers (“1,234”, “1 234”).
What plugins declare (commands, panels, menus, settings, plugins, the context stack’s frames) is translated through keys derived from its stable id, never from its English, so rewording English keeps the translations:
| What | Key |
|---|---|
| a command’s title, description | command-<id>.title, .description |
| a command’s category | category-<english> (categories have no id) |
| a panel’s title | panel-<id>.title |
| a submenu’s label | menu-<id>.label |
| a setting’s label, description | setting-<id>.label, .description |
| one value of a choice setting | setting-<id>-choice-<value> |
| a plugin’s title (a settings section) | plugin-<id>.title |
| a frame’s title (a crumb, a mode chip) | frame-<id>.title |
where every id is written with slug (a category’s English in
lower case).
use std::sync::Arc;
use egui_pop_core::strings::{self, MapStrings, RETRY};
let ctx = egui::Context::default();
assert_eq!(strings::tr(&ctx, &RETRY), "Retry");
strings::install(&ctx, Arc::new(MapStrings::new("fr").with(RETRY.key, "Réessayer")));
assert_eq!(strings::tr(&ctx, &RETRY), "Réessayer");
assert_eq!(strings::command_title(&ctx, "app.quit", "Quit"), "Quit");Modules§
- kind
- The kinds of declarations translated by derived keys.
Structs§
- English
- No translations: every string is its English fallback.
- MapStrings
- Translations from a map, for tests and small applications.
- Panel
Command - A command derived from a panel (
<panel>.focus,<panel>.toggle): its title and description are shared texts with a{ $panel }placeholder, filled with the panel’s title in the interface’s language, so a catalogue translates them once for every panel. A translation under the command’s own keys still wins. - StrKey
- A string’s key and its English fallback.
{ $name }placeholders are filled bytr_args.
Enums§
- Arg
- A value placed in a
{ $name }placeholder.
Constants§
- ALL
- Every string egui-pop core shows, for catalogues and tests.
- BUSY
- A busy indicator without a label of its own.
- CANCEL
- CLOSE
- DIALOG_
RESIZE - EXIT_
FULLSCREEN - A full screen window’s button in place of maximize.
- FAULT_
BODY - FAULT_
TITLE - FIELD_
DISABLED - FIELD_
MODIFIED_ DEFAULT - FIELD_
MODIFIED_ SAVED - FIELD_
PENDING - FIELD_
REQUIRED - A field’s states, as markers and assistive technologies say them.
- FIELD_
RESET - FOLD_
TOGGLE - A tree row’s toggle, named after its row (
fold::TreeRow). - HELD_BY
- INDICATOR_
CHANGED - A value’s marks (
indicator::ValueMark). - INDICATOR_
DONE - INDICATOR_
ERROR - INDICATOR_
FAILED - INDICATOR_
HELD - INDICATOR_
INVALID - INDICATOR_
MIXED - INDICATOR_
MODIFIED - INDICATOR_
MOVED - INDICATOR_
NO_ COLOR - INDICATOR_
OFF - What an indicator means, when the application gives it no name of its own: an LED’s state, a flag, a pip, a swatch.
- INDICATOR_
ON - INDICATOR_
PERCENT - INDICATOR_
PINNED - INDICATOR_
REQUIRED - INDICATOR_
WARNING - INPUT_
CHOICES - A decorated input’s dropdown chevron.
- INPUT_
CLEAR - A decorated input’s clear button.
- INPUT_
MORE - A split button’s chevron.
- LATE_
LOADING - A late value’s placeholder, its spinner and its Retry button, as assistive technologies name them.
- LATE_
RETRY - LATE_
UPDATING - LOADING
- A skeleton standing in for content that loads.
- MAXIMIZE
- MINIMIZE
- The window frame’s buttons (the close button says
CLOSE). - NOTE_
COPIED - Said beside a note’s Copy button for a moment after a click.
- NOTE_
COPY - A note’s Copy button: its name and tooltip.
- NOTE_
DETAILS - The title of a note’s folded technical details.
- NOTE_
ERROR - The name and tooltip of an error note’s symbol.
- NOTE_
INFO - The name and tooltip of an information note’s symbol.
- NOTE_
SUCCESS - The name and tooltip of a success note’s symbol.
- NOTE_
WARNING - The name and tooltip of a warning note’s symbol.
- NO_
VALUE - A bound widget’s tooltip when its path holds no value.
- NUMBER_
DECREASE - NUMBER_
INCREASE - A number input’s arrows, as assistive technologies name them.
- NUMBER_
NOT_ A_ NUMBER - Why a number input refused a typed value.
- NUMBER_
OUT_ OF_ RANGE - NUMBER_
WHOLE - OK
- RATING
- Rating stars’ accessible name (
rating::RatingStars). - RATING_
CLEAR - The tooltip and name of the star of the current rating: a click clears it.
- RATING_
SET - A star’s tooltip and name: what a click on it gives.
- RATING_
VALUE - A rating as read aloud, and a shown rating’s name: “3 of 5”.
- READ_
ONLY - RESET
- RESTORE
- RETRY
- SCROLLABLE_
CONTENT - SECTION_
RESIZE - The boundary between two sections of a stack, named after the one
above it (
sections::Sections). - SEGMENTED_
MORE - A segmented control’s button holding the options that do not fit.
- SLIDER_
ENTRY - A slider’s typed entry, open over its bar, as assistive technologies name it.
- SLIDER_
MAXIMUM - SLIDER_
MINIMUM - A range slider’s thumbs, as assistive technologies name them.
- SLIDER_
TYPE_ VALUE - A slider’s or a knob’s menu item opening its typed entry.
Traits§
- Strings
- Gives the text of a key in the current language, if it has one.
Functions§
- application
- The application’s name set for a context (empty when none was).
- category
- A command category.
- category_
key - The key of a command category, derived from its English (categories have no id).
- command_
description - A command’s description (empty stays empty).
- command_
title - A command’s title. A title saying
{ $application }(in English or in its translation) has it filled with the application’s name (set_application). - declared
- A declaration’s text in the current language, else its English.
- declared_
key - The key of a declaration’s text:
<kind>-<slug(id)>, then.<attr>when given. - fill
- Fills
{ $name }(and{$name}) placeholders with text. - fill_
with - Fills
{ $name }(and{$name}) placeholders with typed arguments, numbers written plain (Arg::plain). - frame_
title - A frame’s title (a place’s crumb, a mode’s chip):
frame-<id>.title. - install
- Installs a provider for a context.
- lookup
- The text of any key, with the English to show without a translation
(the key itself when
fallbackis empty). - lookup_
args lookupwith text arguments, placed verbatim.- lookup_
with lookupwith typed arguments (seetr_with).- menu_
label - A submenu’s label.
- number
- A number in the interface’s language, with exactly
decimalsdigits after the separator (slider values, readouts):Strings::number, else as Rust writes it. - panel_
command - The panel a command is derived from, with its shared texts.
- panel_
commands - The commands derived from panels installed for a context.
- panel_
title - A panel’s title.
- plugin_
title - A plugin’s title (the settings form’s section).
- provider
- The installed provider (English when none is).
- provider_
id - Which provider is installed, as an identity that changes when another
one is installed (
None: the built-in English). A cache of translated texts keys on it. - quantity
- A number already written followed by its unit, in the interface’s
language:
Strings::quantity, else with a plain space between them. An empty unit gives the number alone. - set_
application - Sets the application’s name for a context: what
{ $application }says in a command’s title (“About { $application }”). The application does it for each context it is drawn in. - set_
panel_ commands - Installs the commands derived from panels for a context (see
PanelCommand); the application does it for each context it is drawn in. - setting_
choice - One value of a choice setting, as shown (the value itself without a translation).
- setting_
choice_ key - The key of one value of a choice setting.
- setting_
description - A setting’s description (empty stays empty).
- setting_
label - A setting’s label.
- slug
- A stable id written as part of a Fluent identifier: ASCII letters,
digits and
-are kept, every other character becomes-(app.quitgivesapp-quit). Two ids that differ only by those characters share a key. - tr
- The text of a key.
- tr_args
- The text of a key with its
{ $name }placeholders filled with text, placed verbatim even when it looks like a number. A count or a size to write as the language writes numbers goes throughtr_with. - tr_with
- The text of a key with its
{ $name }placeholders filled with typed arguments: text verbatim, numbers formatted for the language. - without_
argument_ hint - A command’s title as a menu, a toolbar or a tray shows it: without the
trailing hint of its arguments (
Open a workspace (`path`)readsOpen a workspace), which only the palette, where arguments are typed, keeps. It works on a translated title as on the English one.
Type Aliases§
- Panel
Commands - The commands derived from panels, by command id.