Bug#606494: grub2: localized start screen: german text is not displayed completely

2011-04-10 Thread Vladimir 'φ-coder/phcoder' Serbinenko
tag 606494 fixed-upstream
thanks

On 09.12.2010 20:16, Holger Wansing wrote:
> Package: grub2
>
>
> Yesterday, I noticed that grub2 has now the new functionality
> to display a localized start screen (the first screen, where
> you can select which OS to start. Under that list, there is a
> localized (here german) text about the keyboard functions).
>
> In german the text is truncated (maybe in other languages, too?)
> In the po file, the translation is complete.
>
> On the grub screen, I see:
> -
> Verwenden Sie die Tasten ▲ und ▼, um Einträge hervorzuheben und
> auszuwählen.
> Drücken Sie die Eingabetaste, um das ausgewählte Betriebssystem
> zu booten, »e« zum Bearbeiten der Befehle vor dem Booten oder
> -
>
>
> while the po file contains this:
> -
>  msgid "Use the %C and %C keys to select which entry is highlighted.\n"
>  msgstr ""
>  "Verwenden Sie die Tasten %C und %C, um Einträge hervorzuheben und "
>  "auszuwählen.\n"
>
>  msgid ""
>  "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.\n"
>  msgstr ""
>  "Drücken Sie die Eingabetaste, um das ausgewählte Betriebssystem zu booten, "
>  "»e« zum Bearbeiten der Befehle vor dem Booten oder »c« für eine "
>  "Befehlszeile. Mit ESC kehren Sie zum vorherigen Menü zurück.\n"
> -
>
> It seems the developer has oriented himself on the english
> version, and languages that need more characters for their translation
> are truncated.
>
> Please give the possibility to use some more place for the strings.
> Thanks
>
>
>
>
> As a short term solution, I could provide a patch to shorten the
> translation so that it fitts in the displayed lines.
> The original translator 
> Mario Blättermann 
> has already received that patch, and he has already implemented it, 
> but since that is on the Translation Project TP, it will need 
> more time to be implemented in the debian package over the official 
> way.
> Could the debian package maintainer change the translation according
> a patch provided by me? (to receive an ACK from the original translator
> would be no problem.)
>
>
>
> Greetings
> Holger
>


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko




signature.asc
Description: OpenPGP digital signature


Bug#606494: grub2: localized start screen: german text is not displayed completely

2011-03-29 Thread Vladimir 'φ-coder/phcoder' Serbinenko
tag 606494 patch
thanks
> In german the text is truncated (maybe in other languages, too?)
>   
Attached patch fixes the issue.

Hallo aus der Schweiz.

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko

=== modified file 'grub-core/normal/menu_entry.c'
--- grub-core/normal/menu_entry.c	2011-03-23 13:18:56 +
+++ grub-core/normal/menu_entry.c	2011-03-29 23:01:14 +
@@ -52,6 +52,8 @@
   int x;
   /* The Y coordinate.  */
   int y;
+  /* Number of entries.  */
+  int num_entries;
 };
 
 struct screen
@@ -188,7 +190,7 @@
   grub_term_gotoxy (term_screen->term, GRUB_TERM_LEFT_BORDER_X
 		+ grub_term_border_width (term_screen->term),
 		GRUB_TERM_TOP_BORDER_Y 
-		+ grub_term_num_entries (term_screen->term));
+		+ term_screen->num_entries);
 
   if (flag)
 grub_putcode (GRUB_UNICODE_DOWNARROW, term_screen->term);
@@ -209,13 +211,12 @@
   struct line *linep;
 
   /* Check if scrolling is necessary.  */
-  if (term_screen->y < 0 || term_screen->y
-  >= grub_term_num_entries (term_screen->term))
+  if (term_screen->y < 0 || term_screen->y >= term_screen->num_entries)
 {
   if (term_screen->y < 0)
 	term_screen->y = 0;
   else
-	term_screen->y = grub_term_num_entries (term_screen->term) - 1;
+	term_screen->y = term_screen->num_entries - 1;
 
   region_start = 0;
   region_column = 0;
@@ -251,7 +252,7 @@
 
 	  for (column = 0;
 	   column <= linep->len
-		 && y < grub_term_num_entries (term_screen->term);
+		 && y < term_screen->num_entries;
 	   column += grub_term_entry_width (term_screen->term), y++)
 	{
 	  if (y < 0)
@@ -272,7 +273,7 @@
 		print_line (linep, column, 0, y, term_screen);
 	}
 
-	  if (y == grub_term_num_entries (term_screen->term))
+	  if (y == term_screen->num_entries)
 	{
 	  if (column <= linep->len || i + 1 < screen->num_lines)
 		down_flag = 1;
@@ -282,11 +283,11 @@
 	  i++;
 
 	  if (mode == ALL_LINES && i == screen->num_lines)
-	for (; y < grub_term_num_entries (term_screen->term); y++)
+	for (; y < term_screen->num_entries; y++)
 	  print_empty_line (y, term_screen);
 
 	}
-  while (y < grub_term_num_entries (term_screen->term));
+  while (y < term_screen->num_entries);
 
   /* Draw up and down arrows.  */
   if (up)
@@ -1290,7 +1291,8 @@
   }
   /* Draw the screen.  */
   for (i = 0; i < screen->nterms; i++)
-grub_menu_init_page (0, 1, screen->terms[i].term);
+grub_menu_init_page (0, 1, &screen->terms[i].num_entries,
+			 screen->terms[i].term);
   update_screen_all (screen, 0, 0, 1, 1, ALL_LINES);
   for (i = 0; i < screen->nterms; i++)
 grub_term_setcursor (screen->terms[i].term, 1);

=== modified file 'grub-core/normal/menu_text.c'
--- grub-core/normal/menu_text.c	2010-08-18 23:07:50 +
+++ grub-core/normal/menu_text.c	2011-03-30 00:30:57 +
@@ -34,10 +34,19 @@
 struct menu_viewer_data
 {
   int first, offset;
+  /* The number of entries shown at a time.  */
+  int num_entries;
   grub_menu_t menu;
   struct grub_term_output *term;
 };
 
+static inline int
+grub_term_cursor_x (struct grub_term_output *term)
+{
+  return (GRUB_TERM_LEFT_BORDER_X + grub_term_border_width (term) 
+	  - GRUB_TERM_MARGIN - 1);
+}
+
 grub_ssize_t
 grub_getstringwidth (grub_uint32_t * str, const grub_uint32_t * last_position,
 		 struct grub_term_output *term)
@@ -53,30 +62,45 @@
   return width;
 }
 
-void
-grub_print_message_indented (const char *msg, int margin_left, int margin_right,
-			 struct grub_term_output *term)
+static int
+grub_print_message_indented_real (const char *msg, int margin_left,
+  int margin_right,
+  struct grub_term_output *term, int dry_run)
 {
   grub_uint32_t *unicode_msg;
   grub_uint32_t *last_position;
 
   int msg_len;
+  int ret = 0;
 
   msg_len = grub_utf8_to_ucs4_alloc (msg, &unicode_msg, &last_position);
 
   if (msg_len < 0)
 {
-  return;
+  return 0;
 }
 
-  grub_print_ucs4 (unicode_msg, last_position, margin_left, margin_right, term);
+  if (dry_run)
+ret = grub_ucs4_count_lines (unicode_msg, last_position, margin_left,
+ margin_right, term);
+  else
+grub_print_ucs4 (unicode_msg, last_position, margin_left,
+		 margin_right, term);
 
   grub_free (unicode_msg);
-}
-
+
+  return ret;
+}
+
+void
+grub_print_message_indented (const char *msg, int margin_left, int margin_right,
+			 struct grub_term_output *term)
+{
+  grub_print_message_indented_real (msg, margin_left, margin_right, term, 0);
+}
 
 static void
-draw_border (struct grub_term_output *term)
+draw_border (struct grub_term_output *term, int num_entries)
 {
   unsigned i;
 
@@ -88,7 +112,7 @@
 grub_putcode (GRUB_UNICODE_HLINE, term);
   grub_putcode (GRUB_UNICODE_CORNER_UR, term);
 
-  for (i = 0; i < (unsigned) grub_term_num_entries (term); i++)
+  for (i = 0; i < (unsigned) num_entries; i++)
 {
   grub_term_gotoxy (term, GRUB_TERM_MARGIN, GRUB_TERM_TOP_BORDER_Y + i + 1);
   grub_putcode (GRUB_UNICODE_VLINE, term);
@@ -

Bug#606494: grub2: localized start screen: german text is not displayed completely

2010-12-09 Thread Holger Wansing
Package: grub2


Yesterday, I noticed that grub2 has now the new functionality
to display a localized start screen (the first screen, where
you can select which OS to start. Under that list, there is a
localized (here german) text about the keyboard functions).

In german the text is truncated (maybe in other languages, too?)
In the po file, the translation is complete.

On the grub screen, I see:
-
Verwenden Sie die Tasten ▲ und ▼, um Einträge hervorzuheben und
auszuwählen.
Drücken Sie die Eingabetaste, um das ausgewählte Betriebssystem
zu booten, »e« zum Bearbeiten der Befehle vor dem Booten oder
-


while the po file contains this:
-
 msgid "Use the %C and %C keys to select which entry is highlighted.\n"
 msgstr ""
 "Verwenden Sie die Tasten %C und %C, um Einträge hervorzuheben und "
 "auszuwählen.\n"

 msgid ""
 "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.\n"
 msgstr ""
 "Drücken Sie die Eingabetaste, um das ausgewählte Betriebssystem zu booten, "
 "»e« zum Bearbeiten der Befehle vor dem Booten oder »c« für eine "
 "Befehlszeile. Mit ESC kehren Sie zum vorherigen Menü zurück.\n"
-

It seems the developer has oriented himself on the english
version, and languages that need more characters for their translation
are truncated.

Please give the possibility to use some more place for the strings.
Thanks




As a short term solution, I could provide a patch to shorten the
translation so that it fitts in the displayed lines.
The original translator 
Mario Blättermann 
has already received that patch, and he has already implemented it, 
but since that is on the Translation Project TP, it will need 
more time to be implemented in the debian package over the official 
way.
Could the debian package maintainer change the translation according
a patch provided by me? (to receive an ACK from the original translator
would be no problem.)



Greetings
Holger

-- 

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Created with Sylpheed 2.5.0
under DEBIAN GNU/LINUX 5.0.0 - L e n n y
Registered LinuxUser #311290 - http://counter.li.org/
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =





-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org