GNOME Bugzilla – Bug 689601
Use Unicode
Last modified: 2012-12-11 12:44:46 UTC
Use unicode in strings instead of their ASCII equivalents. See http://tecnocode.co.uk/2009/10/01/unicode-in-gnome/ for details
Created attachment 230639 [details] [review] Use proper ellipses instead of their ASCII equivalents
Review of attachment 230639 [details] [review]: Did you test this? SpiderMonkey has issues with raw UTF-8 in strings. You need to use the proper Unicode escapes ("\uXXXX"). I'd also prefer if you didn't do the replacements inside of just comments.
Good catch. No, I had not tested it. It was a fly by patch before I did the same for gnome-photos. However I am not sure how to do this? eg., we have _("Loading…"). Replacing it with _("Loading") + String.fromCharCode(0x2026) sounds wrong, with respect to splitting translatable strings.
Try "Loading\u2026"
Thanks, that worked.
Created attachment 231023 [details] [review] Use proper ellipses instead of their ASCII equivalents
(In reply to comment #2) > Review of attachment 230639 [details] [review]: > > Did you test this? SpiderMonkey has issues with raw UTF-8 in strings. You need > to use the proper Unicode escapes ("\uXXXX"). I'd also prefer if you didn't do > the replacements inside of just comments. Or did you test this? I just tested it, and it works fine. Test code: #!/usr/bin/gjs const Gtk = imports.gi.Gtk; Gtk.init(null); dialog = new Gtk.MessageDialog({ text: "àò€¢ðđŋ¶€ß»ŧŋ←ŧ½" }); dialog.run();
(In reply to comment #7) > (In reply to comment #2) > > Review of attachment 230639 [details] [review] [details]: > > > > Did you test this? SpiderMonkey has issues with raw UTF-8 in strings. You need > > to use the proper Unicode escapes ("\uXXXX"). I'd also prefer if you didn't do > > the replacements inside of just comments. > > Or did you test this? > I just tested it, and it works fine. I did test my first patch and it showed some garbage instead of the ellipses in the button. However this works fine: gjs> print ("…") … gjs>
As gcampax pointed out, this is fixed in gjs git master (ie. c614834).
I am fine with depending on gjs master for gnome-documents master. Can you update the patch to use the unicode characters instead of the escaped character code?
Created attachment 231244 [details] [review] Use proper ellipses instead of their ASCII equivalents I have left the comments as ASCII-only as Jasper suggested. If you want it the other way, then you can just use my first patch which has since been obsoleted.
Review of attachment 231244 [details] [review]: Thanks!