Root/
Source at commit 2462 created 9 years 8 months ago. By ifabio, Split out states generator from acpi_patcher (Credits to Clover Teams) | |
---|---|
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 | ␊ |
33 | Locale::Po4a::Guide - convert Guide XML documents from/to PO files␊ |
34 | ␊ |
35 | =head1 DESCRIPTION␊ |
36 | ␊ |
37 | The po4a (PO for anything) project goal is to ease translations (and more␊ |
38 | interestingly, the maintenance of translations) using gettext tools on␊ |
39 | areas where they were not expected like documentation.␊ |
40 | ␊ |
41 | Locale::Po4a::Guide is a module to help in the translation of the Gentoo␊ |
42 | Linux documentation in the Guide XML format into other [human] languages.␊ |
43 | ␊ |
44 | This format is documented here: http://www.gentoo.org/doc/en/xml-guide.xml␊ |
45 | ␊ |
46 | =head1 STATUS OF THIS MODULE␊ |
47 | ␊ |
48 | This module is fully functional, as it relies in the L<Locale::Po4a::Xml>␊ |
49 | module. This only defines the translatable tags and attributes.␊ |
50 | ␊ |
51 | The only known issue is that it doesn't include files with the <include␊ |
52 | href="..."> tag, but you can translate all those files alone, and it's usually␊ |
53 | better to have them separated.␊ |
54 | ␊ |
55 | =head1 SEE ALSO␊ |
56 | ␊ |
57 | L<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 | ␊ |
65 | Copyright (c) 2004 by Jordi Vilalta <jvprat@gmail.com>␊ |
66 | ␊ |
67 | This program is free software; you may redistribute it and/or modify it␊ |
68 | under the terms of GPL (see the COPYING file).␊ |
69 | ␊ |
70 | =cut␊ |
71 | ␊ |
72 | package Locale::Po4a::Guide;␊ |
73 | ␊ |
74 | use 5.006;␊ |
75 | use strict;␊ |
76 | use warnings;␊ |
77 | ␊ |
78 | use Locale::Po4a::Xml;␊ |
79 | ␊ |
80 | use vars qw(@ISA);␊ |
81 | @ISA = qw(Locale::Po4a::Xml);␊ |
82 | ␊ |
83 | sub initialize {␊ |
84 | ␉my $self = shift;␊ |
85 | ␉my %options = @_;␊ |
86 | ␊ |
87 | #TODO: <include href="..."> includes a file␊ |
88 | ␉$self->SUPER::initialize(%options);␊ |
89 | ␉$self->{options}{'_default_translated'}.='␊ |
90 | ␉␉w<abstract>␊ |
91 | ␉␉<author>␊ |
92 | ␉␉<b>␊ |
93 | ␉␉<brite>␊ |
94 | ␉␉<c>␊ |
95 | ␉␉<codenote>␊ |
96 | ␉␉<comment>␊ |
97 | ␉␉<const>␊ |
98 | ␉␉<date>␊ |
99 | ␉␉w<dd>␊ |
100 | ␉␉w<dt>␊ |
101 | ␉␉<e>␊ |
102 | ␉␉<i>␊ |
103 | ␉␉<ident>␊ |
104 | ␉␉w<impo>␊ |
105 | ␉␉<keyword>␊ |
106 | ␉␉w<li>␊ |
107 | ␉␉<mail>␊ |
108 | ␉␉w<note>␊ |
109 | ␉␉w<p>␊ |
110 | ␉␉<path>␊ |
111 | ␉␉W<pre>␊ |
112 | ␉␉<stmt>␊ |
113 | ␉␉<sub>␊ |
114 | ␉␉w<subtitle>␊ |
115 | ␉␉w<summary>␊ |
116 | ␉␉<sup>␊ |
117 | ␉␉w<th>␊ |
118 | ␉␉w<ti>␊ |
119 | ␉␉w<title>␊ |
120 | ␉␉<uri>␊ |
121 | ␉␉<var>␊ |
122 | ␉␉<version>␊ |
123 | ␉␉w<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 |