From patchwork Mon Feb 18 23:57:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 221571 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BD0C72C0294 for ; Tue, 19 Feb 2013 11:06:33 +1100 (EST) Received: from localhost ([::1]:40631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7abK-00079I-5T for incoming@patchwork.ozlabs.org; Mon, 18 Feb 2013 18:58:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7aae-00060E-L8 for qemu-devel@nongnu.org; Mon, 18 Feb 2013 18:57:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7aaZ-0003aU-VZ for qemu-devel@nongnu.org; Mon, 18 Feb 2013 18:57:44 -0500 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:34488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7aaZ-0003Za-EG for qemu-devel@nongnu.org; Mon, 18 Feb 2013 18:57:39 -0500 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Feb 2013 05:25:12 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp04.in.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 19 Feb 2013 05:25:09 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 437B0125804E for ; Tue, 19 Feb 2013 05:28:20 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r1INvWcJ33620124 for ; Tue, 19 Feb 2013 05:27:32 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r1INvYeR014498 for ; Tue, 19 Feb 2013 10:57:34 +1100 Received: from titi.austin.rr.com (sig-9-49-157-221.mts.ibm.com [9.49.157.221]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r1INv8Ev013654; Tue, 19 Feb 2013 10:57:28 +1100 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2013 17:57:03 -0600 Message-Id: <1361231825-12037-8-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1361231825-12037-1-git-send-email-aliguori@us.ibm.com> References: <1361231825-12037-1-git-send-email-aliguori@us.ibm.com> MIME-Version: 1.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13021823-5564-0000-0000-000006A8203B X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.4 Cc: Kevin Wolf , Paolo Bonzini , Anthony Liguori , Stefan Hajnoczi Subject: [Qemu-devel] =?utf-8?q?=5BPATCH_7/9=5D_gtk=3A_add_translation_sup?= =?utf-8?b?cG9ydCAodjQp?= X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This includes a de_DE translation from Kevin Wolf and an it translation from Paolo Bonzini. Cc: Paolo Bonzini Cc: Kevin Wolf Cc: Stefan Hajnoczi Signed-off-by: Anthony Liguori --- v1 -> v4 - Don't use '|| exit 1' with sub-invocation of make - Actually include Kevin's translation Both translations are missing a few things because of refactorings I've done. For 'it', we're missing: - Zoom to Fit - Grab on Hover - File I think the last one is a borrowed word though. Paolo (or someone else that speaks Italian), could you provide the translations for the above and I will incorporate? 'de_DE' is only missing: - Zoom to Fit - Grab on Hover Kevin/Stefan/et al, could you provide translations for these? Thanks! merge into basic ui --- Makefile | 3 +++ configure | 4 +++- po/Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++ po/de_DE.po | 45 +++++++++++++++++++++++++++++++++++++++++++++ po/it.po | 37 +++++++++++++++++++++++++++++++++++++ po/messages.po | 45 +++++++++++++++++++++++++++++++++++++++++++++ ui/gtk.c | 22 +++++++++++++++------- 7 files changed, 191 insertions(+), 8 deletions(-) create mode 100644 po/Makefile create mode 100644 po/de_DE.po create mode 100644 po/it.po create mode 100644 po/messages.po diff --git a/Makefile b/Makefile index 0d9099a..2262410 100644 --- a/Makefile +++ b/Makefile @@ -314,6 +314,9 @@ ifneq ($(BLOBS),) $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \ done endif +ifeq ($(CONFIG_GTK),y) + $(MAKE) -C po $@ +endif $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps" set -e; for x in $(KEYMAPS); do \ $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \ diff --git a/configure b/configure index b0595b1..cd7ea5d 100755 --- a/configure +++ b/configure @@ -3235,6 +3235,7 @@ fi qemu_confdir=$sysconfdir$confsuffix qemu_datadir=$datadir$confsuffix +qemu_localedir="$datadir/locale" tools="" if test "$want_tools" = "yes" ; then @@ -3408,6 +3409,7 @@ echo "qemu_localstatedir=$local_statedir" >> $config_host_mak echo "qemu_helperdir=$libexecdir" >> $config_host_mak echo "extra_cflags=$EXTRA_CFLAGS" >> $config_host_mak echo "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak +echo "qemu_localedir=$qemu_localedir" >> $config_host_mak echo "ARCH=$ARCH" >> $config_host_mak if test "$debug_tcg" = "yes" ; then @@ -4328,7 +4330,7 @@ DIRS="$DIRS roms/seabios roms/vgabios" DIRS="$DIRS qapi-generated" FILES="Makefile tests/tcg/Makefile qdict-test-data.txt" FILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" -FILES="$FILES tests/tcg/lm32/Makefile" +FILES="$FILES tests/tcg/lm32/Makefile po/Makefile" FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" FILES="$FILES pc-bios/spapr-rtas/Makefile" FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" diff --git a/po/Makefile b/po/Makefile new file mode 100644 index 0000000..047b785 --- /dev/null +++ b/po/Makefile @@ -0,0 +1,43 @@ +# This makefile is very special as it's meant to build as part of the build +# process and also within the source tree to update the translation files. + +VERSION=$(shell cat ../VERSION) +TRANSLATIONS=de_DE it +SRCS=$(addsuffix .po, $(TRANSLATIONS)) +OBJS=$(addsuffix .mo, $(TRANSLATIONS)) + +SRC_PATH=.. + +-include ../config-host.mak + +vpath %.po $(SRC_PATH)/po + +all: + @echo Use 'make update' to update translation files + @echo or us 'make build' or 'make install' to build and install + @echo the translation files + +update: $(SRCS) + +build: $(OBJS) + +clean: + $(RM) $(OBJS) + +install: $(OBJS) + for obj in $(OBJS); do \ + base=`basename $$obj .mo`; \ + $(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES; \ + $(INSTALL) -m644 $$obj $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES/qemu.mo; \ + done + +%.mo: + @msgfmt -o $@ $(SRC_PATH)/po/`basename $@ .mo`.po + +messages.po: $(SRC_PATH)/ui/gtk.c + @xgettext -o $@ --foreign-user --package-name=QEMU --package-version=1.0.50 --msgid-bugs-address=qemu-devel@nongnu.org -k_ -C $< + +de_DE.po: messages.po $(SRC_PATH)/ui/gtk.c + @msgmerge $@ $< > $@.bak && mv $@.bak $@ + +.PHONY: $(SRCS) clean all diff --git a/po/de_DE.po b/po/de_DE.po new file mode 100644 index 0000000..7982df8 --- /dev/null +++ b/po/de_DE.po @@ -0,0 +1,45 @@ +# German translation for QEMU. +# This file is put in the public domain. +# Kevin Wolf , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: QEMU 1.4.50\n" +"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n" +"POT-Creation-Date: 2013-02-08 09:21-0600\n" +"PO-Revision-Date: 2012-02-28 16:00+0100\n" +"Last-Translator: Kevin Wolf \n" +"Language-Team: Deutsch \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" + +#: ../ui/gtk.c:990 +msgid "_File" +msgstr "_Datei" + +#: ../ui/gtk.c:1000 +msgid "_View" +msgstr "_Ansicht" + +#: ../ui/gtk.c:1002 +msgid "_Full Screen" +msgstr "Voll_bild" + +#: ../ui/gtk.c:1029 +msgid "Zoom To _Fit" +msgstr "" + +#: ../ui/gtk.c:1035 +msgid "Grab On _Hover" +msgstr "" + +#: ../ui/gtk.c:1038 +msgid "_Grab Input" +msgstr "_Eingabegeräte einfangen" + +#: ../ui/gtk.c:1064 +msgid "Show _Tabs" +msgstr "_Tableiste anzeigen" diff --git a/po/it.po b/po/it.po new file mode 100644 index 0000000..e4bacde --- /dev/null +++ b/po/it.po @@ -0,0 +1,37 @@ +# Italian translation for QEMU. +# This file is put in the public domain. +# Paolo Bonzini , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: QEMU 1.4.50\n" +"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n" +"POT-Creation-Date: 2012-02-26 11:30-0600\n" +"PO-Revision-Date: 2012-02-27 08:23+0100\n" +"Last-Translator: Paolo Bonzini \n" +"Language-Team: Italian \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#: ../ui/gtk.c:769 +msgid "_File" +msgstr "_File" + +#: ../ui/gtk.c:779 +msgid "_View" +msgstr "_Visualizza" + +#: ../ui/gtk.c:781 +msgid "_Full Screen" +msgstr "_Schermo intero" + +#: ../ui/gtk.c:805 +msgid "_Grab Input" +msgstr "_Cattura input" + +#: ../ui/gtk.c:831 +msgid "Show _Tabs" +msgstr "Mostra _tab" diff --git a/po/messages.po b/po/messages.po new file mode 100644 index 0000000..a90cd6f --- /dev/null +++ b/po/messages.po @@ -0,0 +1,45 @@ +# SOME DESCRIPTIVE TITLE. +# This file is put in the public domain. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: QEMU 1.4.50\n" +"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n" +"POT-Creation-Date: 2013-02-08 09:21-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../ui/gtk.c:990 +msgid "_File" +msgstr "" + +#: ../ui/gtk.c:1000 +msgid "_View" +msgstr "" + +#: ../ui/gtk.c:1002 +msgid "_Full Screen" +msgstr "" + +#: ../ui/gtk.c:1029 +msgid "Zoom To _Fit" +msgstr "" + +#: ../ui/gtk.c:1035 +msgid "Grab On _Hover" +msgstr "" + +#: ../ui/gtk.c:1038 +msgid "_Grab Input" +msgstr "" + +#: ../ui/gtk.c:1064 +msgid "Show _Tabs" +msgstr "" diff --git a/ui/gtk.c b/ui/gtk.c index 2eaa3a8..8ef6e46 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -31,8 +31,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#define GETTEXT_PACKAGE "qemu" +#define LOCALEDIR "po" + #include #include +#include #include #include #include @@ -953,7 +957,7 @@ static void gd_create_menus(GtkDisplayState *s) accel_group = gtk_accel_group_new(); s->file_menu = gtk_menu_new(); gtk_menu_set_accel_group(GTK_MENU(s->file_menu), accel_group); - s->file_menu_item = gtk_menu_item_new_with_mnemonic("_File"); + s->file_menu_item = gtk_menu_item_new_with_mnemonic(_("_File")); s->quit_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL); gtk_stock_lookup(GTK_STOCK_QUIT, &item); @@ -963,9 +967,9 @@ static void gd_create_menus(GtkDisplayState *s) s->view_menu = gtk_menu_new(); gtk_menu_set_accel_group(GTK_MENU(s->view_menu), accel_group); - s->view_menu_item = gtk_menu_item_new_with_mnemonic("_View"); + s->view_menu_item = gtk_menu_item_new_with_mnemonic(_("_View")); - s->full_screen_item = gtk_check_menu_item_new_with_mnemonic("_Full Screen"); + s->full_screen_item = gtk_check_menu_item_new_with_mnemonic(_("_Full Screen")); gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->full_screen_item), "/View/Full Screen"); gtk_accel_map_add_entry("/View/Full Screen", GDK_KEY_f, GDK_CONTROL_MASK | GDK_MOD1_MASK); @@ -992,16 +996,16 @@ static void gd_create_menus(GtkDisplayState *s) gtk_accel_map_add_entry("/View/Zoom Fixed", GDK_KEY_0, GDK_CONTROL_MASK | GDK_MOD1_MASK); gtk_menu_append(GTK_MENU(s->view_menu), s->zoom_fixed_item); - s->zoom_fit_item = gtk_check_menu_item_new_with_mnemonic("Zoom To _Fit"); + s->zoom_fit_item = gtk_check_menu_item_new_with_mnemonic(_("Zoom To _Fit")); gtk_menu_append(GTK_MENU(s->view_menu), s->zoom_fit_item); separator = gtk_separator_menu_item_new(); gtk_menu_append(GTK_MENU(s->view_menu), separator); - s->grab_on_hover_item = gtk_check_menu_item_new_with_mnemonic("Grab On _Hover"); + s->grab_on_hover_item = gtk_check_menu_item_new_with_mnemonic(_("Grab On _Hover")); gtk_menu_append(GTK_MENU(s->view_menu), s->grab_on_hover_item); - s->grab_item = gtk_check_menu_item_new_with_mnemonic("_Grab Input"); + s->grab_item = gtk_check_menu_item_new_with_mnemonic(_("_Grab Input")); gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->grab_item), "/View/Grab Input"); gtk_accel_map_add_entry("/View/Grab Input", GDK_KEY_g, GDK_CONTROL_MASK | GDK_MOD1_MASK); @@ -1027,7 +1031,7 @@ static void gd_create_menus(GtkDisplayState *s) separator = gtk_separator_menu_item_new(); gtk_menu_append(GTK_MENU(s->view_menu), separator); - s->show_tabs_item = gtk_check_menu_item_new_with_mnemonic("Show _Tabs"); + s->show_tabs_item = gtk_check_menu_item_new_with_mnemonic(_("Show _Tabs")); gtk_menu_append(GTK_MENU(s->view_menu), s->show_tabs_item); g_object_set_data(G_OBJECT(s->window), "accel_group", accel_group); @@ -1063,6 +1067,10 @@ void gtk_display_init(DisplayState *ds) s->scale_y = 1.0; s->free_scale = FALSE; + setlocale(LC_ALL, ""); + bindtextdomain("qemu", CONFIG_QEMU_LOCALEDIR); + textdomain("qemu"); + s->null_cursor = gdk_cursor_new(GDK_BLANK_CURSOR); s->mouse_mode_notifier.notify = gd_mouse_mode_change;