Repository navigation
feat: add an English interface, Colony themes and fonts, and a Preferences page - #18
Merged
Merged
Conversation
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.
Brings Shift onto the Colony design system with colony-ui 0.1.6.
What changes for the user
LANGUAGE,LC_ALL,LC_MESSAGES,LANGon Linux, the display language on Windows and macOS), or the language picked in Preferences. Sizes use B/KB/MB in English and o/Ko/Mo with a decimal comma in French; relative dates read naturally in both.Typography, so the dyslexia font swaps the whole window, and every size goes throughsz(), so both text-size preferences reach it. The previous and next buttons are Nerd Font chevrons with a tooltip.Escclose it. General (with a Language section: Automatic, English, Français), Appearance and Accessibility come from the colony-ui kit (themes with the "Theme applied." toast, accents with auto accent off by default, font size, effects, preview, high contrast, dyslexia font, reduced motion, text size), then About (version, licence, source, preferences file path). While the page is open the viewer keys and wheel zoom are off; a control-bar button goes back to the viewer.<config>/Colony/Shift/preferences/preferences.json(LocalAppData on Windows, Application Support on macOS). The write goes to a temporary file in the same folder, is synced, then renamed over the old file. A missing file is the defaults; an unreadable or invalid file falls back to the defaults, is reported in the status line and is left untouched until the user changes something. A bad value for one key falls back on its own and keeps the rest.Code
src/main.rsis only the entry point: the--versioncheck, font registration and the iced application. The viewer moved toapp.rs, folder listing and natural sort togallery.rs(is_supported_imagenow readsSUPPORTED_EXTENSIONSinstead of repeating it), status and details text toformat.rs, the palette styles tostyle.rs, the preferences file and page topreferences.rs, and the strings toi18n/(mod.rs,en.rs,fr.rs). Shared labels come fromcolony_ui::i18nand are not copied.colony-ui0.1.6,serde,serde_json, andsys-locale, which was already in the tree through iced.Tests
39 unit tests, up from 19: key parity between
en.rsandfr.rs, no empty string and identical placeholders in both locales, one-pass placeholder filling, sizes and relative dates in both locales, preferences round trip with no temporary file left behind, replacing an existing file, missing, corrupt and partly invalid files, the Colony key names in the file, one message opening and closing Preferences (the Shift button and Close send the same one), viewer keys and wheel zoom off while Preferences is open andEscclosing it, a control-bar button returning to the viewer, a change being saved at once, and a source check that no text size is a raw number and no colour is a literal. The existingupdate()tests now assert the English strings.The window was not launched while making this change, so the layout at 0.7225x and 1.68x text scale was checked by reading it: every row of the control bar wraps, and the category list grows with the scale.
The README now says the interface ships in English and French, lists Preferences under What it does, adds
Escto the shortcuts, and names the preferences file per platform in Privacy.