Skip to content

wasi: embedded all the locales + add the support in the binary#11631

Merged
sylvestre merged 3 commits intouutils:mainfrom
sylvestre:wasm-l10n
Apr 4, 2026
Merged

wasi: embedded all the locales + add the support in the binary#11631
sylvestre merged 3 commits intouutils:mainfrom
sylvestre:wasm-l10n

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

No description provided.

When cross-compiling for wasm32-wasip1, embed every available .ftl
file instead of just en-US + the host LANG. This allows the
playground to switch languages at runtime.
Add a WASI-specific function that builds a FluentBundle from embedded
.ftl files for any locale. Uses Box::leak instead of the global
OnceLock cache so multiple locale bundles can coexist.
In setup_localization(), use create_wasi_bundle_from_embedded() on
WASI to set up the requested locale with English fallback, enabling
runtime language switching in the playground.
where
F: Fn(&str) -> PathBuf,
{
if is_wasi_target() {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we are in the build.rs
we can't use #cfg here

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)
Skip an intermittent issue tests/pr/bounded-memory (was skipped on 'main', now failing)

@sylvestre sylvestre merged commit a1371a8 into uutils:main Apr 4, 2026
165 checks passed
@sylvestre
Copy link
Copy Markdown
Contributor Author

automerging as i need it for a new project

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.

1 participant