summaryrefslogtreecommitdiff
BranchCommit messageAuthorAge
_cleanMerge branch 'master' into _cleanJonas Smedegaard15 years
_daMerge branch 'master' into _daJonas Smedegaard15 years
_multilangMerge branch 'nb' into _multilangJonas Smedegaard15 years
_nbMerge branch 'master' into _nbJonas Smedegaard15 years
_scsMerge branch 'master' into _scsJonas Smedegaard15 years
allinoneExtend plugin meta to support foaf.Jonas Smedegaard15 years
allinone-daMerge branch 'wian' into allinone-daJonas Smedegaard15 years
allinone-multilangMerge branch '_multilang' into allinone-multilangJonas Smedegaard15 years
allinone-nbMerge branch 'wian' into allinone-nbJonas Smedegaard15 years
cleanMerge branch '_clean' into cleanJonas Smedegaard15 years
daMerge branch '_da' into daJonas Smedegaard15 years
masterFix preserve forced newline in po4a Text module.Jonas Smedegaard15 years
multilangMerge branch '_multilang' into multilangJonas Smedegaard15 years
nbMerge branch '_nb' into nbJonas Smedegaard15 years
noneditMerge branch 'master' into noneditJonas Smedegaard15 years
po4aSync with po4a 0.36.1.Jonas Smedegaard16 years
scsMerge branch '_scs' into scsJonas Smedegaard15 years
wianMerge branch 'master' into wianJonas Smedegaard15 years
 
class="hl kwa">use Locale::Po4a::TransTractor;
  • use Locale::Po4a::Common;
  • =head1 OPTIONS ACCEPTED BY THIS MODULE
  • These are this module's particular options:
  • =over
  • =item B<nobullets>
  • Deactivate detection of bullets.
  • By default, when a bullet is detected, the bullet paragraph is not considered
  • as a verbatim paragraph (with the no-wrap flag in the PO file), but the module
  • rewrap this paragraph in the generated PO file and in the translation.
  • =cut
  • my $bullets = 1;
  • =item B<tabs>=I<mode>
  • Specify how tabulations shall be handled. The I<mode> can be any of:
  • =over
  • =item B<split>
  • Lines with tabulations introduce breaks in the current paragraph.
  • =item B<verbatim>
  • Paragraph containing tabulations will not be re-wrapped.
  • =back
  • By default, tabulations are considered as spaces.
  • =cut
  • my $tabs = "";
  • =item B<breaks>=I<regex>
  • A regular expression matching lines which introduce breaks.
  • The regular expression will be anchored so that the whole line must match.
  • =cut
  • my $breaks;
  • =item B<debianchangelog>
  • Handle the header and footer of
  • released versions, which only contain non translatable informations.
  • =cut
  • my $debianchangelog = 0;
  • =item B<fortunes>
  • Handle the fortunes format, which separate fortunes with a line which
  • consists in '%' or '%%', and use '%%' as the beginning of a comment.
  • =cut
  • my $fortunes = 0;
  • =item B<markdown>
  • Handle some special markup in Markdown-formatted texts.
  • =cut
  • my $markdown = 0;
  • =item B<asciidoc>
  • Handle documents in the asciidoc format.
  • =cut
  • my $asciidoc = 0;
  • =back
  • =cut
  • sub initialize {
  • my $self = shift;
  • my %options = @_;
  • $self->{options}{'asciidoc'} = 1;
  • $self->{options}{'breaks'} = 1;
  • $self->{options}{'debianchangelog'} = 1;
  • $self->{options}{'debug'} = 1;
  • $self->{options}{'fortunes'} = 1;
  • $self->{options}{'markdown'} = 1;
  • $self->{options}{'nobullets'} = 1;
  • $self->{options}{'tabs'} = 1;
  • $self->{options}{'verbose'} = 1;
  • foreach my $opt (keys %options) {
  • die wrap_mod("po4a::text",
  • dgettext("po4a", "Unknown option: %s"), $opt)
  • unless exists $self->{options}{$opt};
  • $self->{options}{$opt} = $options{$opt};
  • }
  • if (defined $options{'nobullets'}) {
  • $bullets = 0;
  • }
  • if (defined $options{'tabs'}) {
  • $tabs = $options{'tabs'};
  • }
  • if (defined $options{'breaks'}) {
  • $breaks = $options{'breaks'};
  • }
  • if (defined $options{'debianchangelog'}) {