ALT Linux Bugzilla
– Attachment 16295 Details for
Bug 45208
Строка в бутменю "Для запуска системы выберите пункт меню и нажмите Enter" всегда на русском языке (UEFI)
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Патч, осуществляющий перевод всех строк
0001-Enable-run-time-translation-of-theme-labels.patch (text/plain), 3.29 KB, created by
Корытов Иван
on 2024-06-20 10:50:02 MSK
(
hide
)
Description:
Патч, осуществляющий перевод всех строк
Filename:
MIME Type:
Creator:
Корытов Иван
Created:
2024-06-20 10:50:02 MSK
Size:
3.29 KB
patch
obsolete
>From 580762b60c104631b9208dd79d9246c0d0414511 Mon Sep 17 00:00:00 2001 >From: Martin Whitaker <fsf@martin-whitaker.me.uk> >Date: Fri, 8 Dec 2017 22:44:35 +0000 >Subject: [PATCH] Enable run-time translation of theme labels. > >The existing behaviour is to only translate the template labels when >the theme configuration file is first read and to never translate >ordinary labels. This modifies the behaviour to translate all labels >whenever the labels are displayed (provided the gettext module is >loaded and the $lang variable is set). > >diff --git a/grub-core/gfxmenu/gui_label.c b/grub-core/gfxmenu/gui_label.c >index a4c817891..d7035e8ec 100644 >--- a/grub-core/gfxmenu/gui_label.c >+++ b/grub-core/gfxmenu/gui_label.c >@@ -84,6 +84,7 @@ static void > label_paint (void *vself, const grub_video_rect_t *region) > { > grub_gui_label_t self = vself; >+ char * translated_text = _(self->text); > > if (! self->visible) > return; >@@ -97,10 +98,10 @@ label_paint (void *vself, const grub_video_rect_t *region) > left_x = 0; > else if (self->align == align_center) > left_x = (self->bounds.width >- - grub_font_get_string_width (self->font, self->text)) / 2; >+ - grub_font_get_string_width (self->font, translated_text)) / 2; > else if (self->align == align_right) > left_x = (self->bounds.width >- - grub_font_get_string_width (self->font, self->text)); >+ - grub_font_get_string_width (self->font, translated_text)); > else > return; /* Invalid alignment. */ > >@@ -109,7 +110,7 @@ label_paint (void *vself, const grub_video_rect_t *region) > > grub_video_rect_t vpsave; > grub_gui_set_viewport (&self->bounds, &vpsave); >- grub_font_draw_string (self->text, >+ grub_font_draw_string (translated_text, > self->font, > grub_video_map_rgba_color (self->color), > left_x, >@@ -149,7 +150,7 @@ static void > label_get_minimal_size (void *vself, unsigned *width, unsigned *height) > { > grub_gui_label_t self = vself; >- *width = grub_font_get_string_width (self->font, self->text); >+ *width = grub_font_get_string_width (self->font, _(self->text)); > *height = (grub_font_get_ascent (self->font) > + grub_font_get_descent (self->font)); > } >@@ -183,15 +184,15 @@ label_set_property (void *vself, const char *name, const char *value) > else > { > if (grub_strcmp (value, "@KEYMAP_LONG@") == 0) >- value = _("Press enter to boot the selected OS, " >+ value = "Press enter to boot the selected OS, " > "`e' to edit the commands before booting " >- "or `c' for a command-line. ESC to return previous menu."); >+ "or `c' for a command-line. ESC to return previous menu."; > else if (grub_strcmp (value, "@KEYMAP_MIDDLE@") == 0) >- value = _("Press enter to boot the selected OS, " >+ value = "Press enter to boot the selected OS, " > "`e' to edit the commands before booting " >- "or `c' for a command-line."); >+ "or `c' for a command-line."; > else if (grub_strcmp (value, "@KEYMAP_SHORT@") == 0) >- value = _("enter: boot, `e': options, `c': cmd-line"); >+ value = "enter: boot, `e': options, `c': cmd-line"; > /* FIXME: Add more templates here if needed. */ > self->template = grub_strdup (value); > self->text = grub_xasprintf (value, self->value); >-- >2.13.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 45208
:
12461
| 16295 |
16296