Summary
mur loc extract treats Segoe Fluent icon glyphs as user-visible text and extracts them into .resw. With --rewrite they are routed through t.Message(...), making a decorative icon depend on a resource lookup — and making it eligible for AI translation.
Repro
samples/TodoApp/Program.cs uses Private Use Area glyphs from the Segoe Fluent icon font as button/label content:
Button("\uE74D", () => structural(new DeleteItem(item.Id))) // trash can
.FontFamily((FontFamily)Application.Current.Resources["SymbolThemeFontFamily"])
TextBlock("\uE73A") // decorative checkbox
mur loc extract --source samples/TodoApp --output <out> --rewrite
Produces:
<data name="Text" xml:space="preserve"><value></value></data>
<data name="Text2" xml:space="preserve"><value></value></data>
Verified code points (they are not empty strings — they render as blanks in most terminals):
Text len=1 U+E74D
Text2 len=1 U+E73A
And rewrites the source to:
Button(t.Message(Loc.TodoApp.Text), ...)
TextBlock(t.Message(Loc.TodoApp.Text2))
Why this is wrong
- A PUA glyph is not linguistic content. There is nothing to translate.
mur loc translate would hand U+E74D to an LLM and ask for a French version.
- It's a translation-corruption risk. A machine or human translation pass over a
.resw containing a lone PUA character can easily mangle or drop it, silently breaking the icon.
- It converts a constant into a lookup. After
--rewrite the glyph resolves through IStringResourceProvider; a missing key in some locale degrades or breaks the icon rather than falling back to a glyph that never should have varied.
- Spec 005 §10.3 says it shouldn't happen. The extractor is documented to ignore "strings that are clearly not user-visible."
- The generated keys are meaningless.
Text / Text2 carry no information about what the glyph is.
Suggested fix
Skip string literals that consist wholly of Private Use Area code points (U+E000–U+F8FF, plus the supplementary PUA planes) — optionally only when the call site also sets a symbol font, though the PUA test alone should be safe and is much simpler.
A stronger version of the same idea: skip any literal containing no letter or digit in any script, which also covers punctuation-only and separator strings.
Notes
Not a systematic false-positive: the samples/ReactorGallery run produced 561 keys with 0 empty or glyph-only values. This is specific to the icon-glyph idiom, which the Gallery happens not to use in extractable positions — but the idiom is common in real WinUI apps and is used in the repo's own sample.
Reproduced with mur built from 88ef6db4.
Summary
mur loc extracttreats Segoe Fluent icon glyphs as user-visible text and extracts them into.resw. With--rewritethey are routed throught.Message(...), making a decorative icon depend on a resource lookup — and making it eligible for AI translation.Repro
samples/TodoApp/Program.csuses Private Use Area glyphs from the Segoe Fluent icon font as button/label content:Produces:
Verified code points (they are not empty strings — they render as blanks in most terminals):
And rewrites the source to:
Why this is wrong
mur loc translatewould handU+E74Dto an LLM and ask for a French version..reswcontaining a lone PUA character can easily mangle or drop it, silently breaking the icon.--rewritethe glyph resolves throughIStringResourceProvider; a missing key in some locale degrades or breaks the icon rather than falling back to a glyph that never should have varied.Text/Text2carry no information about what the glyph is.Suggested fix
Skip string literals that consist wholly of Private Use Area code points (U+E000–U+F8FF, plus the supplementary PUA planes) — optionally only when the call site also sets a symbol font, though the PUA test alone should be safe and is much simpler.
A stronger version of the same idea: skip any literal containing no letter or digit in any script, which also covers punctuation-only and separator strings.
Notes
Not a systematic false-positive: the
samples/ReactorGalleryrun produced 561 keys with 0 empty or glyph-only values. This is specific to the icon-glyph idiom, which the Gallery happens not to use in extractable positions — but the idiom is common in real WinUI apps and is used in the repo's own sample.Reproduced with
murbuilt from88ef6db4.