Skip to contentSkip to conversation

gettext: commands/hdparm.c

DISCUSSION Carles Pina i Estany 4 participants 4 messages Dec 6, 2009 – Dec 9, 2009

lore
Share & tools
lore
#0 lore raw

Hello,

commands/hdparm.c has some grub_printf's:
grub_printf ("Model: \"%.40s\"\n", le16_to_char (tmp, &idw[27], 40));
grub_printf ("Firmware: \"%.8s\"\n", le16_to_char (tmp, &idw[23], 8));
grub_printf ("Serial: \"%.20s\"\n", le16_to_char (tmp, &idw[10], 20));

To have a proper alignment it needs to code something (dynamic "tab").

I could change it to:
grub_printf (_("Model:\t\"%.40s\"\n"), le16_to_char (tmp, &idw[27], 40)); grub_printf (_("Firmware:\t\"%.8s\"\n"), le16_to_char (tmp, &idw[23], 8)); grub_printf (_("Serial:\t\"%.20s\"\n"), le16_to_char (tmp, &idw[10], 20));

Or just don't translate Model/Firmware/Serial (leave like it's now)

Or do the dynamic coding that maybe it's not needed...

Thoughts?

Signature · 2 lines
Carles Pina i Estany
	http://pinux.info
#1 lore raw
Quoted 10 lines · Carles Pina i Estany
  grub_printf ("Model:    \"%.40s\"\n", le16_to_char (tmp, &idw[27], 40));
  grub_printf ("Firmware: \"%.8s\"\n",  le16_to_char (tmp, &idw[23], 8));
  grub_printf ("Serial:   \"%.20s\"\n", le16_to_char (tmp, &idw[10], 20));

To have a proper alignment it needs to code something (dynamic "tab").

I could change it to:
grub_printf (_("Model:\t\"%.40s\"\n"), le16_to_char (tmp, &idw[27], 40)); grub_printf (_("Firmware:\t\"%.8s\"\n"), le16_to_char (tmp, &idw[23], 8)); grub_printf (_("Serial:\t\"%.20s\"\n"), le16_to_char (tmp, &idw[10], 20));

It's not unusual to see stuff like this, but again, a small percent of translators will actually try to figure out if the string is correctly aligned or how many \t's they need to use (by manually calculating how the string will look, by reading the source code, or using qemu).

If the alignment is just a cosmetic enhancement, dropping it could be a reasonable option.

Quoted 1 line

Or just don't translate Model/Firmware/Serial (leave like it's now)

I think it should be translated.

Signature · 3 lines
Jordi Mallach Pérez  --  Debian developer     http://www.debian.org/
[email protected]     [email protected]     http://www.sindominio.net/
GnuPG public key information available at http://oskuro.net/
#2 lore raw
Quoted 14 lines · Jordi Mallach
Quoted 7 lines · Carles Pina i Estany

grub_printf ("Model:    \"%.40s\"\n", le16_to_char (tmp, &idw[27], 40)); grub_printf ("Firmware: \"%.8s\"\n",  le16_to_char (tmp, &idw[23], 8)); grub_printf ("Serial:   \"%.20s\"\n", le16_to_char (tmp, &idw[10], 20));
To have a proper alignment it needs to code something (dynamic "tab").

Quoted 5 lines

I could change it to:
grub_printf (_("Model:\t\"%.40s\"\n"), le16_to_char (tmp, &idw[27], 40)); grub_printf (_("Firmware:\t\"%.8s\"\n"),  le16_to_char (tmp, &idw[23], 8)); grub_printf (_("Serial:\t\"%.20s\"\n"), le16_to_char (tmp, &idw[10], 20));

Quoted 8 lines

It's not unusual to see stuff like this, but again, a small percent of translators will actually try to figure out if the string is correctly aligned or how many \t's they need to use (by manually calculating how the string will look, by reading the source code, or using qemu).

If the alignment is just a cosmetic enhancement, dropping it could be a reasonable option.

Yes, it is only cosmetic - feel free to drop it.

Signature · 2 lines
Regards,
Christian Franke
#3 lore raw
In reply to Carles Pina i Estany
Quoted 15 lines · Carles Pina i Estany

Hello,

commands/hdparm.c has some grub_printf's:
 grub_printf ("Model:    \"%.40s\"\n", le16_to_char (tmp, &idw[27], 40)); grub_printf ("Firmware: \"%.8s\"\n",  le16_to_char (tmp, &idw[23], 8)); grub_printf ("Serial:   \"%.20s\"\n", le16_to_char (tmp, &idw[10], 20));

To have a proper alignment it needs to code something (dynamic "tab").

I could change it to:
 grub_printf (_("Model:\t\"%.40s\"\n"), le16_to_char (tmp, &idw[27], 40)); grub_printf (_("Firmware:\t\"%.8s\"\n"),  le16_to_char (tmp, &idw[23], 8)); grub_printf (_("Serial:\t\"%.20s\"\n"), le16_to_char (tmp, &idw[10], 20));

Quoted 5 lines

Or just don't translate Model/Firmware/Serial (leave like it's now)

Or do the dynamic coding that maybe it's not needed...

Thoughts?

How about using the string width specifier to control padding?

grub_printf ("%20s \"%.40s\"\n", _("Model:"), le16_to_char (tmp, &idw[27], 40));

Quoted 11 lines

--
Carles Pina i Estany
       http://pinux.info

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel