robert-j-engdahl / ngettext-wpf

Proper internationalization support for WPF (via NGettext)
GNU Lesser General Public License v3.0
10 stars 12 forks source link

XGettext.Xaml.ps1 does not trim white space consistently with XAML extension #32

Open robert-j-engdahl opened 5 years ago

robert-j-engdahl commented 5 years ago

For example

<TextBlock Text="{wpf:Gettext Some text with trailing white space      }"/>

is extracted as

msgid "Some text with trailing white space      "

but evaluates to the string "Some text with trailing white space" and as such is mysteriously not translated.

We should trim the trailing white space, and issue a warning when doing so. The trailing white space might be intended as part of formatting but the XAML parser is not passing it to us, so there is nothing we can do about it.