[Po4a-commits] "po4a/lib/Locale/Po4a Man.pm,1.103,1.104"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Fri Sep 2 20:36:17 UTC 2005


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv23984/lib/Locale/Po4a

Modified Files:
	Man.pm 
Log Message:
Add the untranslated, noarg, translate_joined and translate_each options.


Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- Man.pm	2 Sep 2005 20:05:52 -0000	1.103
+++ Man.pm	2 Sep 2005 20:36:15 -0000	1.104
@@ -107,7 +107,7 @@
 
 These are this module's particular options:
 
-=over 4
+=over
 
 =item B<debug>
 
@@ -130,6 +130,36 @@
 contained in one of these section. Otherwise, B<verbatim_groff_code>
 should be preferred.
 
+=item B<untranslated>
+
+=item B<noarg>
+
+=item B<translate_joined>
+
+=item B<translate_each>
+
+These options permit to specify the behavior of a new macro (defined with
+a .de request), or of a macro not supported by po4a.
+They take in argument a coma separated list of macros.
+For example:
+
+ -o noarg=FO,OB,AR -o translate_joined=BA,ZQ,UX
+
+Note: if a macro is not supported by po4a and if you consider that it is a
+standard roff macro, you should submit it to the po4a development team.
+
+B<untranslated> indicates that this macro (at its arguments) don't have to
+be translated.
+
+B<noarg> is like B<untranslated>, except that po4a will verify that no
+argument is added to this macro.
+
+B<translate_joined> indicates that po4a must propose to translate the
+arguments of the macro.
+
+With B<translate_each>, the arguments will also be proposed for the
+translation, except that each one will be translated separately.
+
 =back
 
 =head1 AUTHORING MAN PAGES COMPLIANT WITH PO4A::MAN
@@ -335,6 +365,11 @@
     $self->{options}{'verbose'}='';
     $self->{options}{'translate_groff_code'}='';
     $self->{options}{'verbatim_groff_code'}='';
+    $self->{options}{'untranslated'}='';
+    $self->{options}{'noarg'}='';
+    $self->{options}{'translate_joined'}='';
+    $self->{options}{'translate_each'}='';
+
 
     # reset the debug options
     %debug = ();
@@ -364,6 +399,28 @@
     } else {
         $verbatim_groff_code = 0;
     }
+
+    if (defined $options{'untranslated'}) {
+        foreach (split(/,/, $options{'untranslated'})) {
+            $macro{$_} = \&untranslated;
+        }
+    }
+    if (defined $options{'noarg'}) {
+        foreach (split(/,/, $options{'noarg'})) {
+            $macro{$_} = \&noarg;
+        }
+    }
+    if (defined $options{'translate_joined'}) {
+        foreach (split(/,/, $options{'translate_joined'})) {
+            $macro{$_} = \&translate_joined;
+        }
+    }
+    if (defined $options{'translate_each'}) {
+        foreach (split(/,/, $options{'translate_each'})) {
+            $macro{$_} = \&translate_each;
+        }
+    }
+
 }
 
 my @comments = ();




More information about the Po4a-commits mailing list