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

Support unicode in xaml `msgId`s #20

Closed D-Bullock closed 5 years ago

D-Bullock commented 6 years ago

Currently if one is using unicode characters (say ™) then it's replaced with a ? in the xamlmessages.pot file

I think XGetText-Xaml.ps1:61 is to blame

robert-j-engdahl commented 6 years ago

According to https://www.gnu.org/software/gettext/manual/gettext.html#Preparing-Strings there is nothing that prevents us from using Unicode in our msgId and here https://www.gnu.org/software/gettext/manual/gettext.html#Names it is even encouraged.

Years ago, when source code would be ASCII, special characters would be written out in the msgId, in your case the source code would be "say^TM". And the translater would then be responsible for using the ™ symbol if it was available in his particular character set. But nowadays everyone should use UTF-8, and at least some form of Unicode so that is not really an issue (outside East Asia at least).

robert-j-engdahl commented 6 years ago

The task is to change 'ascii' to 'utf-8' and make tests and examples that ensures the result works.

robert-j-engdahl commented 6 years ago

Failing tests are on the new https://github.com/robert-j-engdahl/ngettext-wpf/tree/msgid-unicode-support branch.