Repository navigation
feat: add French, a Preferences page saved under Colony/Collector, and the Colony themes and accents with high contrast - #13
Merged
Conversation
Every string the user reads goes through src/i18n (en.rs, fr.rs), with French units and decimal commas. The quit hint moves to a full-width footer so it fits in French. --version stays exactly 'collector X.Y.Z'. Tests: identical key sets, placeholders and non-empty values in both locales, every key used in the code exists, and an 80x24 render in both locales with no label cut off.
…er the Colony folder
…rast and reduced motion config/themes.json is a byte copy of Resources generated/themes.json, embedded and read once; a CI job fails with the refresh command when it falls behind. src/theme.rs resolves a family and variant with the Gruvbox dark fallback, ports colony-ui's high-contrast derivation and contrast_on, and maps colours to the nearest xterm 256 when the terminal does not advertise truecolor. Every widget now draws from the palette; no colour literal is left outside theme.rs. Preferences gains Appearance (theme cards per family, the eight accent swatches, auto accent, a live preview) and Accessibility (high contrast, reduce motion), with colony-ui's shared strings in English and French. A theme change shows the theme_applied toast in the footer. The mouse wheel moves through the open category, and a click on a card or swatch picks it.
…nces-themes # Conflicts: # README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Collector now speaks English or French, has a Preferences page, and draws in the Colony themes and accents.
Language
t/tf, with French units and decimal commas.--helpand error messages.collector --versionstill prints exactlycollector X.Y.Z.Preferences
p, opens the page in place of the boxes. Close, Esc orpclose it.<config>/Colony/Collector/preferences/preferences.json, saved at once, written atomically. Fields use colony-uiStandardPreferencesnames, pluslanguageandrefresh_interval.preferences.json.invalidand never overwritten.src/paths.rsports the colony-ui path table, including the reservedappsrefusal.Themes
config/themes.jsonis a byte copy of Resourcesgenerated/themes.json, refreshed to Resources main c19a39d, which carries the shared Preferenceslabelsand thecontrastEndsink and paper. A new CI job (themes.json) fails with the refresh command when the copy falls behind Resources main.src/theme.rsports from colony-ui:with_high_contrast, with the same amounts,contrast_on, which takes its ink and paper from thecontrastEndsof themes.json rather than hard-coding them. A test holds those ends to colony-ui's INK and PAPER.COLORTERM, orWT_SESSION), otherwise the nearest of the xterm 256.theme.rs.theme_appliedtoast in the footer.colony-ui itself is not a dependency: it pulls in iced, which would break the Linux crate and binary-size budgets. Its contract is mirrored by hand instead: field names, shared en/fr strings, category order and theme maths. A test holds every copied
settings_*andtheme_appliedstring, in both locales, to thelabelsin themes.json, so a reworded shared label fails CI here.README: the Privacy table, Preferences, key tables, themes and the truecolor note are updated. Merged with #12: its Status and roadmap are kept, with the 0.3.0 features marked as tested in CI only. The binary size line now says about 1.3 MB.
Verification
StandardPreferencesfield names, per-field lenient reading, andselected_accentleft out when unset.contrast_on, now read fromcontrastEnds.cargo test: 45 unit tests passed, including render tests at 80 columns in en and fr, the labels test and thecontrastEndstest, plus 7 CLI tests and 3 pseudo-terminal tests.cargo fmt --checkis clean.