data/TWiki/TWikiI18NExtractDotPm.txt,v
changeset 0 414e01d06fd5
equal deleted inserted replaced
-1:000000000000 0:414e01d06fd5
       
     1 head	1.2;
       
     2 access;
       
     3 symbols;
       
     4 locks; strict;
       
     5 comment	@# @;
       
     6 
       
     7 
       
     8 1.2
       
     9 date	2007.01.16.04.12.05;	author TWikiContributor;	state Exp;
       
    10 branches;
       
    11 next	1.1;
       
    12 
       
    13 1.1
       
    14 date	2006.02.01.12.01.25;	author TWikiContributor;	state Exp;
       
    15 branches;
       
    16 next	;
       
    17 
       
    18 
       
    19 desc
       
    20 @new-topic
       
    21 @
       
    22 
       
    23 
       
    24 1.2
       
    25 log
       
    26 @buildrelease
       
    27 @
       
    28 text
       
    29 @---+ Package =TWiki::I18N::Extract=
       
    30 
       
    31 Support translatable strings extraction from TWiki topics and templates.
       
    32 Depends on Locale::Maketext::Extract (part of CPAN::Locale::Maketext::Lexicon).
       
    33 
       
    34 
       
    35 %TOC%
       
    36 
       
    37 ---++ ClassMethod *new* <tt>($session) -> $extract</tt>
       
    38 
       
    39 Constructor. Creates a fresh new Extract object. A $session object, instance of
       
    40 the TWiki class, is optional: if it's available, it'll be used for printing
       
    41 warnings.
       
    42 
       
    43 
       
    44 
       
    45 ---++ ObjectMethod *extract* <tt>($file,$text)</tt>
       
    46 
       
    47 Extract the strings from =$text=,m using =$file= as the name of the current
       
    48 file being read (for comments in PO file, for example). Overrides the base
       
    49 class method but calls it so the base behavior is preserved.
       
    50 
       
    51 As in base class, extracted strings are just stored in the =$self='s internal
       
    52 table for further use (e.g. creating/updating a PO file). Nothing is returned.
       
    53 
       
    54 
       
    55 @
       
    56 
       
    57 
       
    58 1.1
       
    59 log
       
    60 @buildrelease
       
    61 @
       
    62 text
       
    63 @d17 1
       
    64 a17 1
       
    65 ---++ ObjectMethod *extract* <tt>($msgid) -> $formated</tt>
       
    66 d19 3
       
    67 a21 4
       
    68 This method overrides the one with same name in =Locale::Maketext::Extract=, as
       
    69 a workaround for [[http://rt.cpan.org/Public/Bug/Display.html?id=14629][a bug]]
       
    70 in the =Locale::Maketext::Lexicon= Perl package, and was not fixed up to the
       
    71 0.53 release.
       
    72 d23 2
       
    73 a24 3
       
    74 What it does is to call an alternative version of the _format function, which
       
    75 avoids [[http://develop.twiki.org/~develop/cgi-bin/view/Bugs/Item1500][double-escaping]]
       
    76 the extracted strings.
       
    77 a25 4
       
    78 This method was tested only under the circumstances of TWiki's needs, i.e.,
       
    79 extracting strings from source and topics and generating a brand new POT file.
       
    80 Merging with previous PO files is done with GNU gettext tools, so maybe if it's
       
    81 used for merging it can 
       
    82 a26 5
       
    83 Once that bug is fixed, in future TWiki versions this method may be removed.
       
    84 
       
    85 
       
    86 
       
    87 !!!extract!!!
       
    88 @