From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NHmvH-00080K-7q for mharc-grub-devel@gnu.org; Mon, 07 Dec 2009 18:23:19 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHmvF-0007xk-1r for grub-devel@gnu.org; Mon, 07 Dec 2009 18:23:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHmvA-0007sq-GY for grub-devel@gnu.org; Mon, 07 Dec 2009 18:23:16 -0500 Received: from [199.232.76.173] (port=55279 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHmvA-0007sN-16 for grub-devel@gnu.org; Mon, 07 Dec 2009 18:23:12 -0500 Received: from ey-out-1920.google.com ([74.125.78.147]:49775) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHmv9-0002yf-KO for grub-devel@gnu.org; Mon, 07 Dec 2009 18:23:12 -0500 Received: by ey-out-1920.google.com with SMTP id 5so47796eyb.2 for ; Mon, 07 Dec 2009 15:23:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=UanrPz2dVDx9CGUgQpY14UzYw5l3I+BdMP9EVZrJdjs=; b=lZbfvFicmBG9sUgz6JigmPoce2lpUVP+ULlSnd5B0i1MQZ8FQq5FvmNHlw2vKhHwJe e3/LIFVCLBA7SPGO1H03FxZgaSYFnwQGutsPEVsJ4bTbpH9XqOb3s41Ja9W/X19Ezooe lqoez1rkXgSs8vLrSu6fvsdBYIzt3TFfVdjkI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=pIAWk0vseYWoblQTMiu1uMBZUeAsi7E836wkKj6vferdLRrOKNk4kkVBSEHs3pJuuJ 7FKO/RyOMslcsZW/408kytnHKf1eeRGLCNpimijM9qJLDYfGwgKlpBVbRg9JJ6R/VTmj 2mPl4Ca3QReIBg9DxKqdrJe1I39Wb5kuByr64= Received: by 10.213.102.129 with SMTP id g1mr3226863ebo.41.1260228190504; Mon, 07 Dec 2009 15:23:10 -0800 (PST) Received: from debian.bg45.phnet (gprs01.swisscom-mobile.ch [193.247.250.1]) by mx.google.com with ESMTPS id 13sm3687072ewy.1.2009.12.07.15.23.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Dec 2009 15:23:09 -0800 (PST) Message-ID: <4B1D8E54.5010702@gmail.com> Date: Tue, 08 Dec 2009 00:23:00 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <20091206182228.GA15091@pina.cat> In-Reply-To: <20091206182228.GA15091@pina.cat> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigA90367ADA4B5810948535860" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: gettext: commands/* X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 23:23:17 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA90367ADA4B5810948535860 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Carles Pina i Estany wrote: > Hello, > > I've started to add gettext support in commands/* > > See the attached patch and ChangeLog. > > It's not completely exhaustive (hdparm is not in this patch). > > Comments before committing? > > Notice the the grub_register_command use N_(" ") and then these strings= > gets registered in commands/help.c when they are gonna to be on the > screen. > > I've tried to translate grub_register_command and the obvious > grub_printf. Maybe some more things need to be translated (other string= s > for example). It will be, but I would like to add gettext support to th= e > 90% of the strings soon so the translators can start to work on it (and= > finish everything of course). > > =20 I've spotted some messages which may be unclear. @@ -186,7 +187,7 @@ GRUB_MOD_INIT(boot) { cmd_boot =3D grub_register_command ("boot", grub_cmd_boot, - 0, "boot an operating system"); + 0, N_("boot an operating system")); } This isn't space-constrained anymore. Capitalizing first letter and putti= ng a dot at the will make it nicer and inform translator that it's a whol= e sentence. =20 @@ -40,7 +41,7 @@ grub_cmd_cmp (grub_command_t cmd __attri if (argc !=3D 2) return grub_error (GRUB_ERR_BAD_ARGUMENT, "two arguments required");= =20 - grub_printf ("Compare `%s' and `%s':\n", args[0], + grub_printf (_("Compare `%s' and `%s':\n"), args[0], args[1]); Translator won't know if %s's are files or some other entities. "Compare file '%s' with '%s':\n" would be an improvement. BTW here you ca= n use printf_ too. =20 @@ -49,7 +50,7 @@ grub_cmd_cmp (grub_command_t cmd __attri goto cleanup; =20 if (grub_file_size (file1) !=3D grub_file_size (file2)) - grub_printf ("Differ in size: %llu [%s], %llu [%s]\n", + grub_printf (_("Differ in size: %llu [%s], %llu [%s]\n"), (unsigned long long) grub_file_size (file1), args[0], (unsigned long long) grub_file_size (file2), args[1]); else Same. Message is unclear. @@ -76,7 +77,7 @@ grub_cmd_cmp (grub_command_t cmd __attri { if (buf1[i] !=3D buf2[i]) { - grub_printf ("Differ at the offset %llu: 0x%x [%s], 0x%x [%s]\n", + grub_printf (_("Differ at the offset %llu: 0x%x [%s], 0x%x [%s]\n"),= (unsigned long long) (i + pos), buf1[i], args[0], buf2[i], args[1]); goto cleanup; Same =3D=3D=3D modified file 'commands/efi/fixvideo.c' --- commands/efi/fixvideo.c 2009-05-04 03:49:08 +0000 +++ commands/efi/fixvideo.c 2009-12-06 16:39:59 +0000 @@ -22,6 +22,7 @@ #include #include #include +#include =20 static struct grub_video_patch { @@ -53,24 +54,24 @@ scan_card (int bus, int dev, int func, g { grub_target_addr_t base; =20 - grub_printf ("Found graphic card: %s\n", p->name); + grub_printf (_("Found graphic card: %s\n"), p->name); addr +=3D 8 + p->mmio_bar * 4; base =3D grub_pci_read (addr); if ((! base) || (base & GRUB_PCI_ADDR_SPACE_IO) || (base & GRUB_PCI_ADDR_MEM_PREFETCH)) - grub_printf ("Invalid MMIO bar %d\n", p->mmio_bar); + grub_printf (_("Invalid MMIO bar %d\n"), p->mmio_bar); else { base &=3D GRUB_PCI_ADDR_MEM_MASK; base +=3D p->mmio_reg; =20 if (*((volatile grub_uint32_t *) base) !=3D p->mmio_old) - grub_printf ("Old value don't match\n"); + grub_printf (_("Old value don't match\n")); else { *((volatile grub_uint32_t *) base) =3D 0; if (*((volatile grub_uint32_t *) base)) - grub_printf ("Set MMIO fails\n"); + grub_printf (_("Set MMIO fails\n")); } } =20 @@ -79,7 +80,7 @@ scan_card (int bus, int dev, int func, g p++; } =20 - grub_printf ("Unknown graphic card: %x\n", pciid); + grub_printf (_("Unknown graphic card: %x\n"), pciid); } =20 return 0; This part contains incorrect English. Moreover these strings convey techn= ical data and I don't think they are worth translating. Actually I'll eli= minate fixvideo once we have setpci @@ -99,7 +100,7 @@ static grub_command_t cmd_fixvideo; GRUB_MOD_INIT(fixvideo) { cmd_fixvideo =3D grub_register_command ("fix_video", grub_cmd_fixvideo= , - 0, "Fix video problem."); + 0, _N("Fix video problem.")); =20 Another unclear message. Just let this file be until we remove it. } =20 =3D=3D=3D modified file 'commands/efi/loadbios.c' --- commands/efi/loadbios.c 2009-06-10 23:47:49 +0000 +++ commands/efi/loadbios.c 2009-12-06 16:43:12 +0000 @@ -23,6 +23,7 @@ #include #include #include +#include =20 static grub_efi_guid_t acpi_guid =3D GRUB_EFI_ACPI_TABLE_GUID; static grub_efi_guid_t acpi2_guid =3D GRUB_EFI_ACPI_20_TABLE_GUID; @@ -45,7 +46,7 @@ enable_rom_area (void) rom_ptr =3D (grub_uint32_t *) VBIOS_ADDR; if (*rom_ptr !=3D BLANK_MEM) { - grub_printf ("ROM image present.\n"); + grub_printf (_("ROM image present.\n")); Incorrect English. return 0; } =20 @@ -62,7 +63,7 @@ enable_rom_area (void) *rom_ptr =3D 0; if (*rom_ptr !=3D 0) { - grub_printf ("Can\'t enable rom area.\n"); + grub_printf (_("Can\'t enable rom area.\n")); Unclear=20 return 0; } =20 @@ -199,11 +200,11 @@ static grub_command_t cmd_fakebios, cmd_ GRUB_MOD_INIT(loadbios) { cmd_fakebios =3D grub_register_command ("fakebios", grub_cmd_fakebios,= - 0, "fake bios."); + 0, _N("fake bios.")); =20 Unclear. cmd_loadbios =3D grub_register_command ("loadbios", grub_cmd_loadbios,= - "loadbios BIOS_DUMP [INT10_DUMP]", - "Load bios dump."); + _N("loadbios BIOS_DUMP [INT10_DUMP]"), + _N("Load bios dump.")); } =20 GRUB_MOD_FINI(loadbios) =3D=3D=3D modified file 'commands/handler.c' --- commands/handler.c 2009-05-04 03:49:08 +0000 +++ commands/handler.c 2009-12-06 17:17:28 +0000 @@ -23,6 +23,7 @@ #include #include #include +#include =20 static grub_err_t grub_cmd_handler (struct grub_command *cmd, @@ -95,16 +96,16 @@ GRUB_MOD_INIT(handler) { cmd_handler =3D grub_register_command ("handler", grub_cmd_handler, - "handler [class [handler]]", - "List or select a handler"); + N_("handler [class [handler]]"), + N_("List or select a handler")); cmd_terminal_input =3D grub_register_command ("terminal_input", grub_cmd_handler, - "terminal_input [handler]", - "List or select a handler"); + N_("terminal_input [handler]"), + N_("List or select a handler")); cmd_terminal_output =3D grub_register_command ("terminal_output", grub_cmd_handler, - "terminal_output [handler]", - "List or select a handler"); + N_("terminal_output [handler]"), + N_("List or select a handler")); Help messages are both unclear and in last 2 cases incorrect } =20 GRUB_MOD_FINI(handler) @@ -94,8 +95,8 @@ GRUB_MOD_INIT(help) { cmd =3D grub_register_extcmd ("help", grub_cmd_help, GRUB_COMMAND_FLAG_CMDLINE, - "help [PATTERN ...]", - "Show a help message.", 0); + N_("help [PATTERN ...]"), + N_("Show a help message."), 0); } =20 GRUB_MOD_FINI(help) =3D=3D=3D modified file 'commands/i386/pc/vbeinfo.c' --- commands/i386/pc/vbeinfo.c 2009-06-10 21:04:23 +0000 +++ commands/i386/pc/vbeinfo.c 2009-12-06 17:17:52 +0000 @@ -51,14 +52,15 @@ grub_cmd_vbeinfo (grub_command_t cmd __a if (err !=3D GRUB_ERR_NONE) return err; =20 - grub_printf ("VBE info: version: %d.%d OEM software rev: %d.%d\n", + grub_printf (_("VBE info: version: %d.%d OEM software rev: %d.%d\n"= ), controller_info.version >> 8, controller_info.version & 0xFF, controller_info.oem_software_rev >> 8, controller_info.oem_software_rev & 0xFF); =20 /* The total_memory field is in 64 KiB units. */ - grub_printf (" total memory: %d KiB\n", + grub_printf (" "); + grub_printf (_("total memory: %d KiB\n"), (controller_info.total_memory << 16) / 1024); We may need ngettext for this one @@ -136,7 +138,7 @@ grub_cmd_vbeinfo (grub_command_t cmd __a =20 /* Show mask and position details for direct color modes. */ if (mode_info_tmp.memory_model =3D=3D GRUB_VBE_MEMORY_MODEL_DIRECT= _COLOR) - grub_printf (", mask: %d/%d/%d/%d pos: %d/%d/%d/%d", + grub_printf (_(", mask: %d/%d/%d/%d pos: %d/%d/%d/%d"), Unclear out of context. mode_info_tmp.red_mask_size, mode_info_tmp.green_mask_size, mode_info_tmp.blue_mask_size, @@ -116,7 +117,7 @@ grub_cmd_vbetest (grub_command_t cmd __a mode_info.blue_mask_size, mode_info.blue_field_position); =20 - grub_printf ("Press any key to continue.\n"); + grub_printf (_("Press any key to continue.\n")); We have several "Press any key to continue." with different ending charac= ters. Can you change all them to single form? @@ -29,7 +30,7 @@ grub_cmd_lsmmap (grub_command_t cmd __at auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uin= t32_t); int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, gru= b_uint32_t type) { - grub_printf ("base_addr =3D 0x%llx, length =3D 0x%llx, type =3D 0x= %x\n", + grub_printf (_("base_addr =3D 0x%llx, length =3D 0x%llx, type =3D = 0x%x\n"), (long long) addr, (long long) size, type); return 0; =20 Unclear =3D=3D=3D modified file 'commands/memrw.c' --- commands/memrw.c 2009-05-04 03:49:08 +0000 +++ commands/memrw.c 2009-12-06 17:18:32 +0000 @@ -71,22 +72,22 @@ GRUB_MOD_INIT(memrw) { cmd_read_byte =3D grub_register_command ("read_byte", grub_cmd_read, - "read_byte ADDR", "read byte."); + _("read_byte ADDR"), _("read byte.")); cmd_read_word =3D grub_register_command ("read_word", grub_cmd_read, - "read_word ADDR", "read word."); + _("read_word ADDR"), _("read word.")); cmd_read_dword =3D grub_register_command ("read_dword", grub_cmd_read, - "read_dword ADDR", "read dword."); + _("read_dword ADDR"), _("read dword.")); cmd_write_byte =3D grub_register_command ("write_byte", grub_cmd_write, - "write_byte ADDR VALUE", "write byte."); + _("write_byte ADDR VALUE"), _("write byte.")); cmd_write_word =3D grub_register_command ("write_word", grub_cmd_write, - "write_word ADDR VALUE", "write word."); + _("write_word ADDR VALUE"), _("write word.")); cmd_write_dword =3D grub_register_command ("write_dword", grub_cmd_write, - "write_dword ADDR VALUE", "write dword."); + _("write_dword ADDR VALUE"), _("write dword.")); } Unclear. =3D=3D=3D modified file 'commands/minicmd.c' --- commands/minicmd.c 2009-11-19 10:39:14 +0000 +++ commands/minicmd.c 2009-12-06 17:55:39 +0000 @@ -133,7 +134,7 @@ grub_mini_cmd_root (struct grub_command=20 if (grub_errno =3D=3D GRUB_ERR_UNKNOWN_FS) grub_errno =3D GRUB_ERR_NONE; =20 - grub_printf ("(%s): Filesystem is %s.\n", + grub_printf (_("((%s): Filesystem is %s.\n"), grub_env_get ("root"), fs ? fs->name : "unknown"); =20 grub_device_close (dev); string with unknown has to be separate: if (fs) grub_printf (_("((%s): Filesystem is %s.\n"), grub_env_get ("root"), fs->name); else grub_printf (_("((%s): Filesystem is unknown.\n"), grub_env_get ("root")); @@ -354,28 +355,28 @@ GRUB_MOD_INIT(minicmd) { cmd_cat =3D grub_register_command ("cat", grub_mini_cmd_cat, - "cat FILE", "show the contents of a file"); + N_("cat FILE"), N_("show the contents of a file")); cmd_help =3D grub_register_command ("help", grub_mini_cmd_help, - 0, "show this message"); + 0, N_("show this message")); cmd_root =3D grub_register_command ("root", grub_mini_cmd_root, - "root [DEVICE]", "set the root device"); + N_("root [DEVICE]"), N_("set the root device")); cmd_dump =3D grub_register_command ("dump", grub_mini_cmd_dump, - "dump ADDR", "dump memory"); + N_("dump ADDR"), N_("dump memory")); cmd_rmmod =3D grub_register_command ("rmmod", grub_mini_cmd_rmmod, - "rmmod MODULE", "remove a module"); + N_("rmmod MODULE"), N_("remove a module")); cmd_lsmod =3D grub_register_command ("lsmod", grub_mini_cmd_lsmod, - 0, "show loaded modules"); + 0, N_("show loaded modules")); cmd_exit =3D grub_register_command ("exit", grub_mini_cmd_exit, - 0, "exit from GRUB"); + 0, N_("exit from GRUB")); cmd_clear =3D grub_register_command ("clear", grub_mini_cmd_clear, - 0, "clear the screen"); + 0, N_("clear the screen")); } This part is constrained but I guess we should capitalize first letter an= d add a dot however=20 static char helpmsg[] =3D - "perform COMMANDS on partition.\n" + N_("perform COMMANDS on partition.\n" Missing capitalization and dot (my fault). "Use \"parttool PARTITION help\" for the list " - "of available commands"; + "of available commands"); =20 int grub_parttool_register(const char *part_name, =3D=3D=3D modified file 'commands/reboot.c' --- commands/reboot.c 2009-12-03 23:07:29 +0000 +++ commands/reboot.c 2009-12-06 17:21:03 +0000 @@ -20,6 +20,7 @@ #include #include #include +#include =20 static grub_err_t grub_cmd_reboot (grub_command_t cmd __attribute__ ((unused)), @@ -35,7 +36,7 @@ static grub_command_t cmd; GRUB_MOD_INIT(reboot) { cmd =3D grub_register_command ("reboot", grub_cmd_reboot, - 0, "Reboot the computer"); + 0, N_("Reboot the computer")); Missing dot. I stop reporting missing dots and capitals. =3D=3D=3D modified file 'commands/usbtest.c' --- commands/usbtest.c 2009-06-10 21:04:23 +0000 +++ commands/usbtest.c 2009-12-06 17:33:53 +0000 @@ -24,6 +24,7 @@ #include #include #include +#include =20 static const char *usb_classes[] =3D { @@ -86,14 +87,14 @@ usb_iterate (grub_usb_device_t dev) usb_print_str ("Serial", dev, descdev->strserial); =20 if (descdev->class > 0 && descdev->class <=3D 0x0E) - grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x= \n", + grub_printf (_("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%0= 2x\n"), descdev->class, usb_classes[descdev->class], descdev->subclass, descdev->protocol); - grub_printf ("USB version %d.%d, VendorID: 0x%02x, ProductID: 0x%02x, = #conf: %d\n", + grub_printf (_("USB version %d.%d, VendorID: 0x%02x, ProductID: 0x%02x= , #conf: %d\n"), descdev->usbrel >> 8, (descdev->usbrel >> 4) & 0x0F, descdev->vendorid, descdev->prodid, descdev->configcnt); =20 - grub_printf ("%s speed device\n", usb_devspeed[dev->speed]); + grub_printf (_("%s speed device\n"), usb_devspeed[dev->speed]); I'm not sure it's good to translate this but if you do translate strings = like "Full speed device."=20 --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigA90367ADA4B5810948535860 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAksdjloACgkQNak7dOguQgnW+QEAmwmc5J1oFfq0bM/ESJaIYcjm jH4hlqkbCyPClg5EhaYA/12sJJJNN9nhyexfxBDVCL4mG+GMGTn6YTLkVZfSvAsD =X8SH -----END PGP SIGNATURE----- --------------enigA90367ADA4B5810948535860--