/[packages]/updates/6/grub2/current/SOURCES/grub2-2.02-mga-translate-theme-label.patch
ViewVC logotype

Contents of /updates/6/grub2/current/SOURCES/grub2-2.02-mga-translate-theme-label.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1243329 - (show annotations) (download)
Thu Jul 12 23:53:42 2018 UTC (10 days, 2 hours ago) by barjac
File size: 2578 byte(s)
- Updates to current Cauldron patch status before 6.1 release:
- patch to fix Mga#23268
- (mageia 6: cant boot installation medium (neither usb nor dvd) on direkt-tek DTLAPY116-2)
- Patched to fix Mga#22918
- (grub2-mkrescue still searches /boot/grub for config)
- Enable translation of labels in the theme configuration file.
- Copy grub.mo rather than link
- Fixes Mga#22182 (grub.mo dangling link)
1 --- a/grub-core/gfxmenu/gui_label.c 2015-05-21 16:50:29.000000000 +0100
2 +++ b/grub-core/gfxmenu/gui_label.c 2017-12-06 21:47:53.139473526 +0000
3 @@ -84,6 +84,7 @@
4 label_paint (void *vself, const grub_video_rect_t *region)
5 {
6 grub_gui_label_t self = vself;
7 + char * translated_text = _(self->text);
8
9 if (! self->visible)
10 return;
11 @@ -97,10 +98,10 @@
12 left_x = 0;
13 else if (self->align == align_center)
14 left_x = (self->bounds.width
15 - - grub_font_get_string_width (self->font, self->text)) / 2;
16 + - grub_font_get_string_width (self->font, translated_text)) / 2;
17 else if (self->align == align_right)
18 left_x = (self->bounds.width
19 - - grub_font_get_string_width (self->font, self->text));
20 + - grub_font_get_string_width (self->font, translated_text));
21 else
22 return; /* Invalid alignment. */
23
24 @@ -109,7 +110,7 @@
25
26 grub_video_rect_t vpsave;
27 grub_gui_set_viewport (&self->bounds, &vpsave);
28 - grub_font_draw_string (self->text,
29 + grub_font_draw_string (translated_text,
30 self->font,
31 grub_video_map_rgba_color (self->color),
32 left_x,
33 @@ -149,7 +150,7 @@
34 label_get_minimal_size (void *vself, unsigned *width, unsigned *height)
35 {
36 grub_gui_label_t self = vself;
37 - *width = grub_font_get_string_width (self->font, self->text);
38 + *width = grub_font_get_string_width (self->font, _(self->text));
39 *height = (grub_font_get_ascent (self->font)
40 + grub_font_get_descent (self->font));
41 }
42 @@ -183,15 +184,15 @@
43 else
44 {
45 if (grub_strcmp (value, "@KEYMAP_LONG@") == 0)
46 - value = _("Press enter to boot the selected OS, "
47 + value = "Press enter to boot the selected OS, "
48 "`e' to edit the commands before booting "
49 - "or `c' for a command-line. ESC to return previous menu.");
50 + "or `c' for a command-line. ESC to return previous menu.";
51 else if (grub_strcmp (value, "@KEYMAP_MIDDLE@") == 0)
52 - value = _("Press enter to boot the selected OS, "
53 + value = "Press enter to boot the selected OS, "
54 "`e' to edit the commands before booting "
55 - "or `c' for a command-line.");
56 + "or `c' for a command-line.";
57 else if (grub_strcmp (value, "@KEYMAP_SHORT@") == 0)
58 - value = _("enter: boot, `e': options, `c': cmd-line");
59 + value = "enter: boot, `e': options, `c': cmd-line";
60 /* FIXME: Add more templates here if needed. */
61 self->template = grub_strdup (value);
62 self->text = grub_xasprintf (value, self->value);

  ViewVC Help
Powered by ViewVC 1.1.26