data/TWiki/TWikiI18NExtractDotPm.txt,v
changeset 0 414e01d06fd5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/data/TWiki/TWikiI18NExtractDotPm.txt,v	Sat Jan 26 15:50:53 2008 +0100
     1.3 @@ -0,0 +1,88 @@
     1.4 +head	1.2;
     1.5 +access;
     1.6 +symbols;
     1.7 +locks; strict;
     1.8 +comment	@# @;
     1.9 +
    1.10 +
    1.11 +1.2
    1.12 +date	2007.01.16.04.12.05;	author TWikiContributor;	state Exp;
    1.13 +branches;
    1.14 +next	1.1;
    1.15 +
    1.16 +1.1
    1.17 +date	2006.02.01.12.01.25;	author TWikiContributor;	state Exp;
    1.18 +branches;
    1.19 +next	;
    1.20 +
    1.21 +
    1.22 +desc
    1.23 +@new-topic
    1.24 +@
    1.25 +
    1.26 +
    1.27 +1.2
    1.28 +log
    1.29 +@buildrelease
    1.30 +@
    1.31 +text
    1.32 +@---+ Package =TWiki::I18N::Extract=
    1.33 +
    1.34 +Support translatable strings extraction from TWiki topics and templates.
    1.35 +Depends on Locale::Maketext::Extract (part of CPAN::Locale::Maketext::Lexicon).
    1.36 +
    1.37 +
    1.38 +%TOC%
    1.39 +
    1.40 +---++ ClassMethod *new* <tt>($session) -> $extract</tt>
    1.41 +
    1.42 +Constructor. Creates a fresh new Extract object. A $session object, instance of
    1.43 +the TWiki class, is optional: if it's available, it'll be used for printing
    1.44 +warnings.
    1.45 +
    1.46 +
    1.47 +
    1.48 +---++ ObjectMethod *extract* <tt>($file,$text)</tt>
    1.49 +
    1.50 +Extract the strings from =$text=,m using =$file= as the name of the current
    1.51 +file being read (for comments in PO file, for example). Overrides the base
    1.52 +class method but calls it so the base behavior is preserved.
    1.53 +
    1.54 +As in base class, extracted strings are just stored in the =$self='s internal
    1.55 +table for further use (e.g. creating/updating a PO file). Nothing is returned.
    1.56 +
    1.57 +
    1.58 +@
    1.59 +
    1.60 +
    1.61 +1.1
    1.62 +log
    1.63 +@buildrelease
    1.64 +@
    1.65 +text
    1.66 +@d17 1
    1.67 +a17 1
    1.68 +---++ ObjectMethod *extract* <tt>($msgid) -> $formated</tt>
    1.69 +d19 3
    1.70 +a21 4
    1.71 +This method overrides the one with same name in =Locale::Maketext::Extract=, as
    1.72 +a workaround for [[http://rt.cpan.org/Public/Bug/Display.html?id=14629][a bug]]
    1.73 +in the =Locale::Maketext::Lexicon= Perl package, and was not fixed up to the
    1.74 +0.53 release.
    1.75 +d23 2
    1.76 +a24 3
    1.77 +What it does is to call an alternative version of the _format function, which
    1.78 +avoids [[http://develop.twiki.org/~develop/cgi-bin/view/Bugs/Item1500][double-escaping]]
    1.79 +the extracted strings.
    1.80 +a25 4
    1.81 +This method was tested only under the circumstances of TWiki's needs, i.e.,
    1.82 +extracting strings from source and topics and generating a brand new POT file.
    1.83 +Merging with previous PO files is done with GNU gettext tools, so maybe if it's
    1.84 +used for merging it can 
    1.85 +a26 5
    1.86 +Once that bug is fixed, in future TWiki versions this method may be removed.
    1.87 +
    1.88 +
    1.89 +
    1.90 +!!!extract!!!
    1.91 +@