[Po4a-devel]Canonizing tabs

Jordi Vilalta jvprat@wanadoo.es
Mon, 21 Mar 2005 15:56:37 +0100 (CET)


Hi,

today, while testing the Docbook module on new documents, I've seen that 
some docbook documents are indented with tabs. I've noticed that the 
canonizing function doesn't handle tabs, and such msgids look like this:

"line1\t\t\tline2\t\t\tline3..."

It's so annoying to translate. Can we also canonize tabs to spaces or 
would it break something?

This simple patch works for me:

--- lib/Locale/Po4a/Po.pm       27 Feb 2005 22:53:53 -0000      1.37
+++ lib/Locale/Po4a/Po.pm       21 Mar 2005 14:53:19 -0000
@@ -1065,6 +1065,7 @@
      $text =~ s/^ *//s;
      # if ($text eq "\n"), it messed up the first string (header)
      $text =~ s/\n/  /gm if ($text ne "\n");
+    $text =~ s/\t/  /gm;
      $text =~ s/([.)])  +/$1  /gm;
      $text =~ s/([^.)])  */$1 /gm;
      $text =~ s/ *$//s;

Regards,

Jordi Vilalta