Open mwpowellhtx opened 4 months ago
This one was kind of an icing on the cake issue. In the code base we inherited from the original author, the preview of msgId
text, some of which included a context|msgId
, was not hundred percent passing through in every instance.
The following capture is how design mode operated in the baseline code base.
As compared and contrasted with what we have been able to accomplish moving forward.
Which you can already see the difference from base line to Ellumination picking it up from there.
The number and current time elements, not sure exactly what we can do with that just yet, but there are format strings intermediate between the view and the backing view model. But it is miles better showing at least that as contrasted with nothing whatsoever.
That said, we see the improvements involving singular plural use cases, the string format design modes, as well the GNOME
use case involving the Example|...
context.
The trick is where, how, when, along these lines, to make use of it. Eventually, I think the goal has to be, we yield an appropriately behaving design mode ICatalog
instance, contained by a host ILocalizer
instance. In practice, we want to avoid many instances of InDesignMode
appearing further away from Bootstrapper
. The best possible positioning is to be resolving an ILocalizer
design mode instance, if at all possible; or at least to be yielding the full msgId
as close as possible to that resolution.
Bottom line, we can make use of the DesignerProperties.GetIsInDesignMode(...)
method. Which we position as an this DependencyObject dependencyObject
extension method, first off. Secondly, we also make it available as a static Bootstrapper.InDesignMode
property, for many of the same reasons.
The default passthrough is to simply treat a
msgId
as the thing itself you want to display. However, when that thing includes a context, for example"Menu|Tools|Options"
, we only want the"Options"
portion in the resulting display.Possibly can and should be contained in a default
Localizer
instance. Need to investigate it a bit further.