Repository navigation
feat: release 0.1.7 with the locale catalogs every component draws its words from - #115
Merged
Merged
Conversation
…s words from Every string a component draws itself is a message of a Fluent catalog under locales/, embedded at build time by fluent-templates 0.15.1 on both halves with no script. English is the one catalog that ships and the one every lookup falls back to; a language joins as a catalog file with no code change, which a throwaway test catalog proves. The locale is chosen once per render through i18n::provide_locale, a console reads it for <html lang>, and looks its own strings up with Locale::lookup. A stray-literal check in CI fails on a component string outside the catalog, and the gallery gains a language switch and a pseudo-locale that lengthens every library string. Also adds view::layout::keyed_field_row.
|
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.



What changed and why
FerroUI 0.1.7 makes the family ready for more languages, with English the one that ships (owner ruling on #112, 2026-10-19). No Dutch or German catalog is added.
i18n: every string a component draws itself is a message ofcrates/ferrohealth-ui/locales/en/ferrohealth-ui.ftl(Project Fluent syntax), embedded at build time byfluent-templates0.15.1 (static_loader!overlocales/, verified on crates.io today; builds and lints on nativessrand onwasm32hydrateandcsr; no JavaScript).enis the reference: complete, the fallback of every lookup, and held complete byi18n::tests, which also checks any other catalog directory against the full message set, so a new language is a catalog file with no code change.Locale(from a BCP 47 tag;negotiateoverAccept-Language;negotiate_withover a console's catalog with its configured locale as the fallback),provide_localeat the root on both halves,locale()to read it,Locale::tagfor<html lang>,Locale::lookupfor a console's own catalog,Locale::with_catalogfor a catalog the library does not ship. A page that provides none draws English.tests/it/locale.rsrenders the pager and the confirmation dialog with a throwawayqaacatalog undertests/it/locales/and sees the words change with no code change, while a message the catalog lacks falls back to English.scripts/checks/stray-literals.sh, a new CI job (stray-literals, inconclusion): fails on a string a reader sees in a component outside the catalog;scripts/checks/stray-literals.allowlists the literals that are no reader's text (key names, product names, SVG markup), each with its reason. A console runs the same script with a baseline that only shrinks.view::theme_switch::locale_switch: the language switch, each choice named in its own language and marked withlang(WCAG 2.2 SC 3.1.2).view::layout::keyed_field_row: a field row with an id (FerroFED's list rows hand-write the classes today)..claude/rules/leptos-ui.md§0 and §13 and.claude/memory/ferroui.md: no user-visible component string outside the catalogs.qpsdraws every library string accented and two fifths longer;<html lang>follows the cookie.What a console must change:
Theme::label,Density::label,Step::label,Severity::wordandVariant::namereturnStringinstead of&'static str;button::labelandcopy_buttonaccept aStringas well. The English words and their markup are unchanged.The bundle grows to 673607 bytes brotli (+53325 over 0.1.6): the Fluent parser, the CLDR plural rules and the catalog. The budget raise is its own pull request, #113, which merges first.
Left for the next release: the labels a console passes to components are still
&'static strin most places, so a console cannot move its own strings until #114 lands.Screens checked
Library v0.1.7pill at row 10 of the wide shots,v0.1.7in every footer) except the overview (the Language field, 1440 and 390, light and dark, in all four brands) and the skeleton shimmer's frame intables-narrow. No other pixel moved.FERROUI_PSEUDO=1, FerroBRIDGE brand, every page and sign-in card, 1440 and 390, light and dark, read): two defects found and fixed in this PR. The search box's Find button wrapped its word inside the button (it now keeps one line and the input gives way), and the pager's size choices broke with100alone on a new row (the choices now wrap as one group). What remains is graceful wrapping: the document pane's view choice and the theme switch wrap a segment to a second row at 390 px, and the pager's range sentence wraps over several lines, with no overflow and no sideways scroll.Closes #112
Licensing of contributions
Checklist
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings, the wasm32 clippy runs,cargo nextest run --workspace --locked,cargo docwithRUSTDOCFLAGS=-D warnings, andcargo deny check.docs/qa/), and the best one on its merits was restyled to the library's tokens; the winner and the reason are stated below.tests/it/states.rsin every brand, light and dark.shellcheck --severity=style,actionlint,zizmor --min-severity=low .github/.CHANGELOG.mdhas an[Unreleased]entry, if a console sees the change.