Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Trunk/package/bin/po4a/lib/Locale/Po4a/Guide.pm

1#!/usr/bin/perl
2
3# Po4a::Guide.pm
4#
5# extract and translate translatable strings from Guide XML documents.
6#
7# This code extracts plain text from tags and attributes on Guide XML
8# documents.
9#
10# Copyright (c) 2004 by Jordi Vilalta <jvprat@gmail.com>
11#
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License as published by
14# the Free Software Foundation; either version 2 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, write to the Free Software
24# Foundation, Inc.,
25# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26#
27########################################################################
28
29=encoding UTF-8
30
31=head1 NAME
32
33Locale::Po4a::Guide - convert Guide XML documents from/to PO files
34
35=head1 DESCRIPTION
36
37The po4a (PO for anything) project goal is to ease translations (and more
38interestingly, the maintenance of translations) using gettext tools on
39areas where they were not expected like documentation.
40
41Locale::Po4a::Guide is a module to help in the translation of the Gentoo
42Linux documentation in the Guide XML format into other [human] languages.
43
44This format is documented here: http://www.gentoo.org/doc/en/xml-guide.xml
45
46=head1 STATUS OF THIS MODULE
47
48This module is fully functional, as it relies in the L<Locale::Po4a::Xml>
49module. This only defines the translatable tags and attributes.
50
51The only known issue is that it doesn't include files with the <include
52href="..."> tag, but you can translate all those files alone, and it's usually
53better to have them separated.
54
55=head1 SEE ALSO
56
57L<Locale::Po4a::TransTractor(3pm)>, L<Locale::Po4a::Xml(3pm)>, L<po4a(7)|po4a.7>
58
59=head1 AUTHORS
60
61 Jordi Vilalta <jvprat@gmail.com>
62
63=head1 COPYRIGHT AND LICENSE
64
65Copyright (c) 2004 by Jordi Vilalta <jvprat@gmail.com>
66
67This program is free software; you may redistribute it and/or modify it
68under the terms of GPL (see the COPYING file).
69
70=cut
71
72package Locale::Po4a::Guide;
73
74use 5.006;
75use strict;
76use warnings;
77
78use Locale::Po4a::Xml;
79
80use vars qw(@ISA);
81@ISA = qw(Locale::Po4a::Xml);
82
83sub initialize {
84my $self = shift;
85my %options = @_;
86
87#TODO: <include href="..."> includes a file
88$self->SUPER::initialize(%options);
89$self->{options}{'_default_translated'}.='
90w<abstract>
91<author>
92<b>
93<brite>
94<c>
95<codenote>
96<comment>
97<const>
98<date>
99w<dd>
100w<dt>
101<e>
102<i>
103<ident>
104w<impo>
105<keyword>
106w<li>
107<mail>
108w<note>
109w<p>
110<path>
111W<pre>
112<stmt>
113<sub>
114w<subtitle>
115w<summary>
116<sup>
117w<th>
118w<ti>
119w<title>
120<uri>
121<var>
122<version>
123w<warn>';
124$self->{options}{'_default_attributes'}.='
125<author>title
126<figure>caption
127<figure>link
128<figure>short
129<guide>lang
130<guide>link
131<p>by
132<pre>caption';
133$self->{options}{'_default_inline'}.='
134<b>
135<brite>
136<c>
137<const>
138<e>
139<i>
140<ident>
141<img>
142<keyword>
143<mail>
144<path>
145<stmt>
146<sub>
147<sup>
148<uri>
149<var>';
150$self->treat_options;
151}
152

Archive Download this file

Revision: 1847