qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ui/gtk: fix gettext message's charset.
@ 2019-11-16  3:10 yanminhui
       [not found] ` <20191120133222.ssfo63bdimopwqhe@sirius.home.kraxel.org>
  0 siblings, 1 reply; 2+ messages in thread
From: yanminhui @ 2019-11-16  3:10 UTC (permalink / raw)
  To: 565101222; +Cc: yanminhui

Signed-off-by: yanminhui <yanminhui163@163.com>
---
 po/zh_CN.po | 2 +-
 ui/gtk.c    | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/po/zh_CN.po b/po/zh_CN.po
index b25e8e3c02..38de6a4f2a 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -66,7 +66,7 @@ msgid "Detach Tab"
 msgstr "分离标签页"
 
 msgid "Show Menubar"
-msgstr ""
+msgstr "显示菜单栏"
 
 msgid "_Machine"
 msgstr "虚拟机(_M)"
diff --git a/ui/gtk.c b/ui/gtk.c
index 2f23922afc..692ccc7bbb 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2215,6 +2215,7 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
     setlocale(LC_MESSAGES, "");
     setlocale(LC_CTYPE, "C.UTF-8");
     bindtextdomain("qemu", CONFIG_QEMU_LOCALEDIR);
+    bind_textdomain_codeset("qemu", "UTF-8");
     textdomain("qemu");
 
     window_display = gtk_widget_get_display(s->window);
-- 
2.22.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ui/gtk: fix gettext message's charset.
       [not found]   ` <55efa019.40fa.16e8bcc1531.Coremail.yanminhui163@163.com>
@ 2019-11-21 10:16     ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2019-11-21 10:16 UTC (permalink / raw)
  To: yanminhui163; +Cc: qemu-devel, 565101222

On Thu, Nov 21, 2019 at 10:30:38AM +0800, yanminhui163 wrote:
> I had compiled on NeoKylin (i18n LANG=zh_CN.UTF-8), but gtk menu's text is wrong.

Please keep the qemu-devel mailing list Cc'ed (reply-to-all should do this).

So qemu doesn't do a full locate setup, to avoid confusing non-gtk parts
of qemu (see longish comments in ui/gtk.c).  Which is probably the
reason why the menus are not working properly, any non-ascii characters
are not displayed as question marks.  Explicitly calling
bind_textdomain_codeset() does indeed fix that.

It might not work for non-utf8 locales (latin1, big5, ...), but is still
a clear improvement over the current situation.  Unlike setlocale() it
should not have unwanted side effects elsewhere, so lets go with it.

Queued up for 4.2.

thanks,
  Gerd



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-21 10:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-16  3:10 [PATCH] ui/gtk: fix gettext message's charset yanminhui
     [not found] ` <20191120133222.ssfo63bdimopwqhe@sirius.home.kraxel.org>
     [not found]   ` <55efa019.40fa.16e8bcc1531.Coremail.yanminhui163@163.com>
2019-11-21 10:16     ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).