From 636977b0894738fcafddef279edd0d823cacf43e Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 18 Dec 2013 06:50:24 +0100 Subject: [PATCH] Mark strings for translation and add remaining ones to exclude list. --- ChangeLog | 4 ++++ grub-core/commands/file.c | 2 +- grub-core/net/dns.c | 8 ++++---- grub-core/osdep/basic/compress.c | 6 +++--- grub-core/osdep/basic/no_platform.c | 6 +++--- grub-core/osdep/unix/platform.c | 2 +- grub-core/osdep/windows/blocklist.c | 2 +- grub-core/osdep/windows/platform.c | 12 ++++++------ grub-core/term/xen/xen_kbd.c | 2 +- po/exclude.pot | Bin 130947 -> 134906 bytes tests/gettext_strings_test.in | 2 +- util/grub-file.c | 2 +- util/grub-install-common.c | 8 ++++---- util/grub-install.c | 16 +++++++++------- util/grub-mknetdir.c | 2 +- 15 files changed, 40 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index e696b4f38..a99cb60bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-12-18 Vladimir Serbinenko + + Mark strings for translation and add remaining ones to exclude list. + 2013-12-18 Vladimir Serbinenko * util/grub-file.c (main): Fix sizeof usage. diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c index c27df0c50..474b3fd21 100644 --- a/grub-core/commands/file.c +++ b/grub-core/commands/file.c @@ -630,7 +630,7 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(file) { cmd = grub_register_extcmd ("file", grub_cmd_file, 0, - "OPTIONS FILE", + N_("OPTIONS FILE"), N_("Check if FILE is of specified type."), options); } diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c index 32ee4fd3d..0b771fb10 100644 --- a/grub-core/net/dns.c +++ b/grub-core/net/dns.c @@ -673,19 +673,19 @@ grub_cmd_list_dns (struct grub_command *cmd __attribute__ ((unused)), switch (dns_servers[i].option) { case DNS_OPTION_IPV4: - strtype = "only ipv4"; + strtype = _("only ipv4"); break; case DNS_OPTION_IPV6: - strtype = "only ipv6"; + strtype = _("only ipv6"); break; case DNS_OPTION_PREFER_IPV4: - strtype = "prefer ipv4"; + strtype = _("prefer ipv4"); break; case DNS_OPTION_PREFER_IPV6: - strtype = "prefer ipv6"; + strtype = _("prefer ipv6"); break; } diff --git a/grub-core/osdep/basic/compress.c b/grub-core/osdep/basic/compress.c index 463ce4242..9794640e8 100644 --- a/grub-core/osdep/basic/compress.c +++ b/grub-core/osdep/basic/compress.c @@ -5,17 +5,17 @@ int grub_install_compress_gzip (const char *src, const char *dest) { - grub_util_error ("no compression is available for your platform"); + grub_util_error (_("no compression is available for your platform")); } int grub_install_compress_xz (const char *src, const char *dest) { - grub_util_error ("no compression is available for your platform"); + grub_util_error (_("no compression is available for your platform")); } int grub_install_compress_lzop (const char *src, const char *dest) { - grub_util_error ("no compression is available for your platform"); + grub_util_error (_("no compression is available for your platform")); } diff --git a/grub-core/osdep/basic/no_platform.c b/grub-core/osdep/basic/no_platform.c index ab7652a7f..d76c34c14 100644 --- a/grub-core/osdep/basic/no_platform.c +++ b/grub-core/osdep/basic/no_platform.c @@ -27,7 +27,7 @@ void grub_install_register_ieee1275 (int is_prep, const char *install_device, int partno, const char *relpath) { - grub_util_error ("%s", "no IEEE1275 routines are available for your platform"); + grub_util_error ("%s", _("no IEEE1275 routines are available for your platform")); } void @@ -35,12 +35,12 @@ grub_install_register_efi (grub_device_t efidir_grub_dev, const char *efifile_path, const char *efi_distributor) { - grub_util_error ("%s", "no EFI routines are available for your platform"); + grub_util_error ("%s", _("no EFI routines are available for your platform")); } void grub_install_sgi_setup (const char *install_device, const char *imgfile, const char *destname) { - grub_util_error ("%s", "no SGI routines are available for your platform"); + grub_util_error ("%s", _("no SGI routines are available for your platform")); } diff --git a/grub-core/osdep/unix/platform.c b/grub-core/osdep/unix/platform.c index b2ec6bd8d..a6dc07093 100644 --- a/grub-core/osdep/unix/platform.c +++ b/grub-core/osdep/unix/platform.c @@ -216,7 +216,7 @@ grub_install_register_ieee1275 (int is_prep, const char *install_device, boot_device, NULL })) { char *cmd = xasprintf ("setenv boot-device %s", boot_device); - grub_util_error ("`nvsetenv' failed. \nYou will have to set `boot-device' variable manually. At the IEEE1275 prompt, type:\n %s\n", + grub_util_error (_("`nvsetenv' failed. \nYou will have to set `boot-device' variable manually. At the IEEE1275 prompt, type:\n %s\n"), cmd); free (cmd); } diff --git a/grub-core/osdep/windows/blocklist.c b/grub-core/osdep/windows/blocklist.c index a1a697670..6d0809a48 100644 --- a/grub-core/osdep/windows/blocklist.c +++ b/grub-core/osdep/windows/blocklist.c @@ -81,7 +81,7 @@ grub_install_get_blocklist (grub_device_t root_dev, else if (grub_strcmp (fs->name, "udf") == 0) first_lcn = grub_udf_get_cluster_sector (root_dev->disk, &sec_per_lcn); else - grub_util_error ("unsupported fs for blocklist under windows: %s", + grub_util_error ("unsupported fs for blocklist on windows: %s", fs->name); grub_util_info ("sec_per_lcn = %" GRUB_HOST_PRIuLONG_LONG diff --git a/grub-core/osdep/windows/platform.c b/grub-core/osdep/windows/platform.c index 3f4ad5e24..1046a6ca3 100644 --- a/grub-core/osdep/windows/platform.c +++ b/grub-core/osdep/windows/platform.c @@ -94,7 +94,7 @@ get_platform (void) if (!get_efi_privilegies ()) { - grub_util_warn ("Insufficient privilegies to access firmware, assuming BIOS"); + grub_util_warn (_("Insufficient privilegies to access firmware, assuming BIOS")); platform = PLAT_BIOS; } @@ -222,7 +222,7 @@ grub_install_register_efi (grub_device_t efidir_grub_dev, get_platform (); if (platform != PLAT_EFI) - grub_util_error ("%s", "no EFI routines when running in BIOS mode"); + grub_util_error ("%s", _("no EFI routines are available when running in BIOS mode")); distrib8_len = grub_strlen (efi_distributor); distributor16 = xmalloc ((distrib8_len + 1) * GRUB_MAX_UTF16_PER_UTF8 @@ -237,7 +237,7 @@ grub_install_register_efi (grub_device_t efidir_grub_dev, until we find same distributor or empty spot. */ boot_order = get_efi_variable (L"BootOrder", &boot_order_len); if (boot_order_len < -1) - grub_util_error ("%s", "unexpected EFI error"); + grub_util_error ("%s", _("unexpected EFI error")); if (boot_order_len > 0) { size_t i; @@ -312,7 +312,7 @@ grub_install_register_efi (grub_device_t efidir_grub_dev, } } if (!have_order_num) - grub_util_error ("%s", "Couldn't find free BootNNNN spot"); + grub_util_error ("%s", _("Couldn't find a free BootNNNN slot")); path8_len = grub_strlen (efifile_path); max_path_length = sizeof (*hddp) + sizeof (*filep) + (path8_len * GRUB_MAX_UTF16_PER_UTF8 + 1) * sizeof (grub_uint16_t) + sizeof (*endp); entry = xmalloc (6 + (distrib16_len + 1) * sizeof (grub_uint16_t) + max_path_length); @@ -413,12 +413,12 @@ void grub_install_register_ieee1275 (int is_prep, const char *install_device, int partno, const char *relpath) { - grub_util_error ("%s", "no IEEE1275 routines are available for your platform"); + grub_util_error ("%s", _("no IEEE1275 routines are available for your platform")); } void grub_install_sgi_setup (const char *install_device, const char *imgfile, const char *destname) { - grub_util_error ("%s", "no SGI routines are available for your platform"); + grub_util_error ("%s", _("no SGI routines are available for your platform")); } diff --git a/grub-core/term/xen/xen_kbd.c b/grub-core/term/xen/xen_kbd.c index 38a6ffd50..153386801 100644 --- a/grub-core/term/xen/xen_kbd.c +++ b/grub-core/term/xen/xen_kbd.c @@ -326,7 +326,7 @@ fetch_key (int *is_break) ret = mapping[keycode]; if (ret == 0) { - grub_printf ("unknown keycode = %lx\n", (unsigned long) keycode); + grub_dprintf ("xenkbd", "unknown keycode = %lx\n", (unsigned long) keycode); continue; } vkbd.kbdpage->in_cons++; diff --git a/po/exclude.pot b/po/exclude.pot index 4335a5240a98c26c03f4ce25e5308a0873236aa0..1606ad4d22f74214cefb238414bb3a718b4fd468 100644 GIT binary patch delta 1977 zcmZux-%s0C6xJn6VSxlF5L%$r1k%DvAP&ZMsLCi^x*^f60o0)>QffOkcuwqKJ2Ys0 z80#M}!IgHkhiQN&O?z4=?GGs0+xD`qd)fso_!`uFw%zSy+-$b{q7b#crlM(bP7m57&^UVH=VG*T3sNQzM;%fI89+ zU^F`T0=#w>GzM2L`as!w&~p~Vp?wV;w~^a9vZT-7X^KmFwiV=6Rgy>wEFa$O4J7oX)>9rwN$^h43- zZ-65#(9j=SPTzaMW*-+GA&vI$)ogF95&C@J3$~ns`#b>JCp*p{_kyjbKs-bC0xNHC zgT%SY&u`Y0>ogH%x12$rYyf5%QvZ89AnxREoYYFOoNtd;)q-qzi>!$7$H!gucq>nI z)PIT~O`jf^CPK%}t%g?{6}2cYE@Gd?X}Dh3e*Dg+;6|u(faKXRk7YzRY z;Cgfj0t2wz+jNQH84slDs%;i%*8TU?hO9NKsOpufq%1k3IbIgIYMX*&=RE-Yv}ZWs zy?AJ{LS7>8+assim{Tn#W=O}Xm8kM;o@El)ltjTO!Ihx_55}fRwFIUqrYwt=S8-pB zkt1t;%&55*c*yP=l0QcqeRBZXU`t)w6%TZda#eR~>!=~dlSFY@72&~`?zo~POYX*s5Jw6(9;(n(k~VbNh_+B zjm_f;^)RKVre)`gl71@=>FGYy@-Dd0G)4f_AljeAxA?;cAR1s<7VUoxI_p>t?tUM2 zu)zSAOu4}Tm*OF~)8R%h^EA2eDZ!@fWtlP*#gc9GauT$|r+hF}QZ30{ku)l^xXj-s zK^Hz9krtM$n4v$$UwL%}uk&eA*!z`IImJ+>jQbL7)zB%UVq*=;6m*#Vss}yW#rNC` z5k%_^r7YOX6R0T*Vs03?UWIFM?3iLqz?F}>-DH5K(6;EXQ- delta 11 Scmex0m!tVVd&3sS=KlaA#s%O2 diff --git a/tests/gettext_strings_test.in b/tests/gettext_strings_test.in index ba3f31f1b..5c305e75b 100644 --- a/tests/gettext_strings_test.in +++ b/tests/gettext_strings_test.in @@ -11,7 +11,7 @@ xgettext -f po/POTFILES.in -L C -o "$tdir/"skip3.pot -x po/grub.pot --keyword=vo cat po/POTFILES.in | xargs grep -hE -o "( | ){\"[a-z0-9\-]*\",[[:space:]]*('.'|[0-9]|-[0-9])," |sed "s,[[:space:]]*{\",,g;s,\"\,[[:space:]]*\('.'\|[0-9]\|-[0-9]\)\,,,g" | awk '{ print "msgid \"" $0 "\"\nmsgstr \"\"" ; }' > "$tdir/"opts.pot cat po/POTFILES.in | xargs grep -hE -o "[[:space:]]*\.name[[:space:]]*=[[:space:]]*\"[a-zA-Z0-9 ()]*\"" |sed "s,[[:space:]]*\.name[[:space:]]*=[[:space:]]*\",,g;s,\",,g" | awk '{ print "msgid \"" $0 "\"\nmsgstr \"\"" ; }' > "$tdir/"name.pot -out="$(cat po/POTFILES.in | grep -v '\(colors.c\|lsefisystab.c\|lsefimmap.c\|lssal.c\|hdparm.c\|sendkey.c\|lsacpi.c\|lspci.c\|usbtest.c\|legacy_parse.c\|/libgcrypt/\|hfs.c\|/efi\.c$\|gnulib\|tests/\|util/ieee1275/ofpath.c\|minilzo.c\|terminfo.c\|setpci.c\|bin2h.c\|cb_timestamps.c\|grub-pe2elf.c\|getroot_[a-z]*.c\|getroot.c\|arc/init.c\|color.c\|grub-mklayout.c\|gentrigtables.c\|lzodefs.h\|lsefi.c\|cbls.c\|/zfs\.h$\|grub-macho2img.c\|lvm.c\|efidisk.c\|grub-mkfont.c\|reiserfs.c\|LzmaEnc.c\)' | xgettext -f - -L C -o - -x po/grub.pot -x "$tdir/"skip.pot -x "$tdir/"skip2.pot -x "$tdir/"skip3.pot -x "$tdir/"opts.pot -x "$tdir/"name.pot -x po/exclude.pot -a --from-code=iso-8859-1)" +out="$(cat po/POTFILES.in | grep -v '\(colors.c\|lsefisystab.c\|lsefimmap.c\|lssal.c\|hdparm.c\|sendkey.c\|lsacpi.c\|lspci.c\|usbtest.c\|legacy_parse.c\|/libgcrypt/\|hfs.c\|/efi\.c$\|gnulib\|tests/\|util/ieee1275/ofpath.c\|minilzo.c\|terminfo.c\|setpci.c\|bin2h.c\|cb_timestamps.c\|grub-pe2elf.c\|getroot_[a-z]*.c\|getroot.c\|arc/init.c\|color.c\|grub-mklayout.c\|gentrigtables.c\|lzodefs.h\|lsefi.c\|cbls.c\|/zfs\.h$\|grub-macho2img.c\|syslinux_parse.c\|lvm.c\|efidisk.c\|grub-mkfont.c\|reiserfs.c\|LzmaEnc.c\)' | xgettext -f - -L C -o - -x po/grub.pot -x "$tdir/"skip.pot -x "$tdir/"skip2.pot -x "$tdir/"skip3.pot -x "$tdir/"opts.pot -x "$tdir/"name.pot -x po/exclude.pot -a --from-code=iso-8859-1)" rm -rf "$tdir" if [ x"$out" != x ]; then echo "$out" diff --git a/util/grub-file.c b/util/grub-file.c index 23cb0439c..7b7290133 100644 --- a/util/grub-file.c +++ b/util/grub-file.c @@ -77,7 +77,7 @@ main (int argc, char *argv[]) continue; } if (had_file) - grub_util_error ("multiple files specified"); + grub_util_error ("one argument expected"); argv2[i - 1] = canonicalize_file_name (argv[i]); if (!argv2[i - 1]) { diff --git a/util/grub-install-common.c b/util/grub-install-common.c index ea500cc5a..b34b8dcf2 100644 --- a/util/grub-install-common.c +++ b/util/grub-install-common.c @@ -114,7 +114,7 @@ grub_install_copy_file (const char *src, grub_util_fd_close (out); if (r < 0) - grub_util_error ("cannot copy `%s' to `%s': %s", + grub_util_error (_("cannot copy `%s' to `%s': %s"), src, dst, grub_util_fd_strerror ()); return 1; @@ -134,11 +134,11 @@ grub_install_compress_file (const char *in_name, grub_util_info ("compressing `%s' -> `%s'", in_name, out_name); ret = !compress_func (in_name, out_name); if (!ret && is_needed) - grub_util_warn ("can't compress `%s' to `%s'", in_name, out_name); + grub_util_warn (_("can't compress `%s' to `%s'"), in_name, out_name); } if (!ret && is_needed) - grub_util_error ("cannot copy `%s' to `%s': %s", + grub_util_error (_("cannot copy `%s' to `%s': %s"), in_name, out_name, grub_util_fd_strerror ()); return ret; @@ -199,7 +199,7 @@ clean_grub_dir (const char *di) { char *x = grub_util_path_concat (2, di, de->d_name); if (grub_util_unlink (x) < 0) - grub_util_error ("cannont delete `%s': %s", x, + grub_util_error (_("cannot delete `%s': %s"), x, grub_util_fd_strerror ()); free (x); } diff --git a/util/grub-install.c b/util/grub-install.c index 5deabe838..81be6fb5c 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -646,7 +646,7 @@ device_map_check_duplicates (const char *dev_map) for (i = 0; i + 1 < filled; i++) if (strcmp (d[i], d[i+1]) == 0) { - grub_util_error ("the drive %s is defined multiple times in the device map %s", + grub_util_error (_("the drive %s is defined multiple times in the device map %s"), d[i], dev_map); } @@ -1354,7 +1354,7 @@ main (int argc, char *argv[]) grub_install_mkdir_p (fldir); flf = grub_util_fopen (fl, "w"); if (!flf) - grub_util_error ("Can't create file: %s", strerror (errno)); + grub_util_error (_("Can't create file: %s"), strerror (errno)); fclose (flf); relfl = grub_make_system_path_relative_to_its_root (fl); fprintf (load_cfg_f, "search.file %s root ", @@ -1631,7 +1631,9 @@ main (int argc, char *argv[]) grub_install_copy_file (boot_img_src, boot_img, 1); grub_util_info ("%sgrub-bios-setup %s %s %s %s %s --directory='%s' --device-map='%s' '%s'", - install_bootsector ? "" : "NOT RUNNING: ", + /* TRANSLATORS: This is a prefix in the log to indicate that usually + a command would be executed but due to an option was skipped. */ + install_bootsector ? "" : _("NOT RUNNING: "), allow_floppy ? "--allow-floppy " : "", verbosity ? "--verbose " : "", force ? "--force " : "", @@ -1701,7 +1703,7 @@ main (int argc, char *argv[]) f = grub_util_fopen (mach_kernel, "r+"); if (!f) - grub_util_error ("Can't create file: %s", strerror (errno)); + grub_util_error (_("Can't create file: %s"), strerror (errno)); fclose (f); fill_core_services (core_services); @@ -1745,7 +1747,7 @@ main (int argc, char *argv[]) else { char *s = xasprintf ("dd if=/dev/zero of=%s", install_device); - grub_util_error ("the PReP partition is not empty. If you are sure you want to use it, run dd to clear it: `%s'", + grub_util_error (_("the PReP partition is not empty. If you are sure you want to use it, run dd to clear it: `%s'"), s); } grub_device_close (ins_dev); @@ -1801,7 +1803,7 @@ main (int argc, char *argv[]) f = grub_util_fopen (mach_kernel, "r+"); if (!f) - grub_util_error ("Can't create file: %s", strerror (errno)); + grub_util_error (_("Can't create file: %s"), strerror (errno)); fclose (f); fill_core_services(core_services); @@ -1837,7 +1839,7 @@ main (int argc, char *argv[]) /* Try to make this image bootable using the EFI Boot Manager, if available. */ if (!efi_distributor || efi_distributor[0] == '\0') - grub_util_error ("%s", "EFI distributor id isn't specified."); + grub_util_error ("%s", _("EFI distributor id isn't specified.")); efifile_path = xasprintf ("\\EFI\\%s\\%s", efi_distributor, efi_file); diff --git a/util/grub-mknetdir.c b/util/grub-mknetdir.c index 55019aa43..3b87e11ba 100644 --- a/util/grub-mknetdir.c +++ b/util/grub-mknetdir.c @@ -134,7 +134,7 @@ process_input_dir (const char *input_dir, enum grub_install_plat platform) prefix = xasprintf ("/%s", subdir); if (!targets[platform].mkimage_target) - grub_util_error ("unsupported platform %s\n", platsub); + grub_util_error (_("unsupported platform %s\n"), platsub); grub_cfg = grub_util_path_concat (2, grubdir, "grub.cfg"); cfg = grub_util_fopen (grub_cfg, "wb");