Repository navigation
Closed
Description
Feature 10 of the 11 features of ResXLocalization 2.0.0, parent issue #29. "Feature NN" in this
issue means an entry of the numbered feature list in the parent issue.
Why
- XAML previewers use the machine's UI culture unless designer-executed initialization selects another.
WPF ignores a culture set inApp.OnStartup; there is no XAML setting to select the preview language. - Rider's WPF previewer passes the wrong target property to markup extensions (JetBrains RIDER-143207),
so every localized element renders nothing there.
What changes
<Window ... l:DesignTime.Culture="de"> <!-- previewers show German; no effect at run time -->- New attached property
DesignTime.Culturein both UI packages. - WPF only: in a designer whose target property is not a dependency property (and is not a style
setter or trigger),{l:Localize}returns a lookup without arguments instead of a binding: the raw
resource value ({0} people invited) under the default formatter, or ICU output/failure text when ICU
is installed. Texts whose key Rider does not pass on, bound keys and bound enum values render empty.
Visual Studio and the Avalonia previewer keep live bindings, in style setters too. - New guide "Design time and previewers", with an honest section on the defects in Rider's previewer.
Acceptance criteria
-
DesignTime.Culturechanges the language in the Avalonia previewer and in the Visual Studio WPF
designer, and has no effect at run time. - Rider's WPF previewer renders localized elements without errors.
- The Visual Studio WPF designer keeps live bindings in style setters.
- The fallback never applies at run time, where WPF also passes a CLR property for
Style
setters: localized setters keep updating live. - Design-time guide and changelog updated.
Details
- Depends on: Register the generated resource managers and reject missing resources #35 (04), Take format arguments on the binding instead of LocalizeArgs #36 (05), Add format arguments to the enum localizer #37 (06), Accept a bound key in the localize extension #38 (07), Add the opt-in ResXLocalization.MessageFormat package for ICU plural and select #39 (08).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
feat: add DesignTime.Culture and a fallback for Rider's WPF previewer (…