9 date 2007.01.16.04.12.05; author TWikiContributor; state Exp;
14 date 2006.02.01.12.01.25; author TWikiContributor; state Exp;
29 @---+ Package =TWiki::I18N::Extract=
31 Support translatable strings extraction from TWiki topics and templates.
32 Depends on Locale::Maketext::Extract (part of CPAN::Locale::Maketext::Lexicon).
37 ---++ ClassMethod *new* <tt>($session) -> $extract</tt>
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
45 ---++ ObjectMethod *extract* <tt>($file,$text)</tt>
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.
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.
65 ---++ ObjectMethod *extract* <tt>($msgid) -> $formated</tt>
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
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.
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
83 Once that bug is fixed, in future TWiki versions this method may be removed.