Skip to content

Fix localization selection#835

Merged
lhecker merged 2 commits intomainfrom
dev/lhecker/673-localization
Apr 29, 2026
Merged

Fix localization selection#835
lhecker merged 2 commits intomainfrom
dev/lhecker/673-localization

Conversation

@lhecker
Copy link
Copy Markdown
Member

@lhecker lhecker commented Apr 29, 2026

The _ -> - normalization was broken for both Windows and UNIX.
This changes the code to consistently expect "ab-cd" locales.

Closes #673

locales.extend_sloppy(
arena,
val.split(':').filter(|s| !s.is_empty()).map(|s| {
// Replace all underscores with dashes,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wait we already had "replace underscores with dashes"? how did this get broken

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Before we had the localization compiler, my hand-written localizations used dashes and so the sys code worked perfectly. This PR fixes the compiler.

I also simplified this code a bit as a drive-by. It makes no sense to allocate strings one by one. It's much better to do one allocation, split it and store just slices in the resulting vector.

@lhecker lhecker merged commit f7de351 into main Apr 29, 2026
8 checks passed
@lhecker lhecker deleted the dev/lhecker/673-localization branch April 29, 2026 17:15
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.

Translations are not used

2 participants