Skip to content

docs: add basic usage to README#153

Merged
alphaqiu merged 4 commits into
masterfrom
develop
Jun 18, 2026
Merged

docs: add basic usage to README#153
alphaqiu merged 4 commits into
masterfrom
develop

Conversation

@alphaqiu

Copy link
Copy Markdown
Contributor

Summary

  • add Basic Usage to README.md
  • add matching 基本使用 section to README-ZH.md
  • link the new website Docs entry from both READMEs

Verification

  • git diff --check

Notes

  • docs-only README update; Rust tests were not run

alphaqiu and others added 4 commits June 17, 2026 23:22
The process-global rust_i18n locale caused flaky failures under parallel
test execution. Tests such as render_expired_badge_in_list and
sync_indicator_ascii_fallbacks held no locale guard, so they could read
a locale mutated by a concurrent zh-CN guard holder and assert the wrong
localized text.

Root cause: LocaleGuard serialized only guard holders via a std::sync::Mutex.
Tests that depended on the locale without holding a guard raced against
those that did, and the non-reentrant mutex precluded nesting.

Changes:
- i18n: LOCALE_LOCK is now a parking_lot::ReentrantMutex so a manual
  LocaleGuard can nest inside a render-helper guard without deadlocking.
- list tests: render_snapshot/render_buffer gain _locale variants that
  hold an internal LocaleGuard (default delegates to "en"). The two zh-CN
  timestamp tests are migrated to render_buffer_locale(.., "zh-CN").
- Add a deterministic concurrent-isolation test (proves en renders stay
  correct under concurrent zh-CN guard holders) and a localized-helper
  contract test (en "Expired" / zh-CN "已过期").
- Add LocaleGuard::en() to 85 locale-dependent tests across 14 files that
  previously had no guard.

Verified: cargo fmt --check, cargo clippy --all-targets -- -D warnings,
cargo test (2595 + all integration/snapshot/e2e) run 3x, cargo build
--release --bin ok, cargo audit (0 vulnerabilities).
render_expired_badge_in_list and sync_indicator_ascii_fallbacks are now
stable across runs.
fix(tui): isolate i18n locale in tests to eliminate parallel flake
@alphaqiu alphaqiu merged commit baf6d25 into master Jun 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants