---
bug_id: BUG-2026-07-27T120657
status: open
severity: medium
scope: i18n
title: Spawned tasks fall back to English (thread-local set_locale)
---
# BUG-2026-07-27T120657: Spawned tasks fall back to English (thread-local set_locale)
## Problem
**Actual:** When the user's locale is non-English (e.g. `LANG=ru_RU.UTF-8`),
messages emitted from inside `tokio::spawn` worker tasks render in English
(the fallback), not the user's locale.
**Expected:** All user-facing messages — including those from spawned
parallel tasks (serve, before_serve, after_stop, power, health, etc.) —
render in the locale set via `LANG`.
**Reproduce:**
```
LANG=ru_RU.UTF-8 cargo run -- -d serve --recipe test-composed
# → "[dry-run] would build composed model dir ... 3 sources, 1 file"
# (English; should be Russian: "3 источника, 1 файл")
```
Main-thread `t!` calls DO render in the user's locale (verified: a
main-thread `t!("composed-dir-built", ...)` with `set_locale("ru-RU")`
prints "3 источника, 1 файл"). Only spawned tasks are affected.
## Root Cause Analysis
**Code path:** `main.rs` calls `fluent_i18n::set_locale(locale)` during
startup. `t!` macro calls read the current locale. Spawned tasks call
`t!` from worker threads.
**Why it fails:** `fluent_i18n::set_locale` writes to a `thread_local!`
`RefCell