Debian Codegraph @

doc/howto/Translations.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>ProFTPD: Translations</title>
5 </head>
6
7 <body bgcolor=white>
8
9 <hr>
10 <center><h2><b>ProFTPD: Translations</b></h2></center>
11 <hr>
12
13 <p>
14 <b>Translations</b><br>
15 ProFTPD has support for translating the messages sent to clients in the
16 FTP responses. To enable use of these translations in your
17 <code>proftpd</code>, you must compile proftpd using the <code>--enable-nls</code> configure option. This causes the <a href="../modules/mod_lang.html"><code>mod_lang</code></a> module to be compiled into your <code>proftpd</code>.
18
19 <p>
20 ProFTPD uses the <a href="http://www.gnu.org/software/gettext/manual/gettext.html"><code>gettext</code></a> code package for translation support.
21
22 <p>
23 <b>Adding a New Translation</b><br>
24 To add a new language translation to <code>proftpd</code>, first check to see
25 if the language in question already has a translation. ProFTPD's translations
26 are kept, in the source distribution, under the <code>locale/</code> directory,
27 <i>e.g.</i>:
28 <pre>
29 $ ls /path/to/proftpd-<i>version</i>/locale/*.po
30 </pre>
31
32 <p>
33 To create a new translation, you first initialize a <code>.po</code> file
34 for your translation using the template PO file (<code>proftpd.pot</code>):
35 <pre>
36 $ cd proftpd-<i>version</i>/locale/
37 $ msginit -i proftpd.pot -o <i>lang</i>.po -l <i>lang</i>
38 </pre>
39 Then you simply use an editor to edit the generated <code><i>lang</i>.po</code>
40 file, adding in the translated versions of the English messages. There are
41 some good editors out there which greatly aid in editing <code>.po</code>
42 files:
43 <ul>
44 <li><a href="http://code.google.com/p/poeditor/">POEditor</a>
45 <li><a href="http://kbabel.kde.org/">KBabel</a>
46 </ul>
47
48 <p>
49 <b>Testing a Translation</b><br>
50 Once you think your <code>.po</code> file is ready, you should run some
51 quick checks to make sure. First, compare your <code>.po</code> file against
52 the template <code>.pot</code> file to see if you translated all of the
53 messages in the template. This is accomplished using the <code>msgcmp</code>
54 command:
55 <pre>
56 $ cd proftpd-<i>version</i>/locale/
57 $ msgcmp <i>lang</i>.po proftpd.pot
58 </pre>
59
60 <p>
61 Finally, compile your <code>.po</code> file into the machine-specific
62 <code>.mo</code> file; this is what the <code>gettext</code> library uses
63 in the running code:
64 <pre>
65 $ msgfmt --check-format <i>lang</i>.po -o <i>lang</i>.mo
66 </pre>
67 The <code>--check-format</code> option checks that your <code>.po</code> is
68 properly formatted, and can be compiled without errors.
69
70 <p>
71 <b>Submitting Translations</b><br>
72 Once your <code>.po</code> file has been tested and looks ready, simply
73 open a feature request at:
74 <pre>
75 <a href="http://bugs.proftpd.org/">http://bugs.proftpd.org/</a>
76 </pre>
77 to request that the new translation be added to ProFTPD. Upload your
78 <code>.po</code> file as an attachment to the opened feature request.
79
80 <p>
81 <b>Keeping Translations Updated</b><br>
82 Note that as ProFTPD is developed, new messages may be added to the template
83 <code>.pot</code> file, or existing messages may be changed slightly.
84 It is important to keep ProFTPD's translations up-to-date. You can help
85 by periodically checking the existing translations:
86 <pre>
87 $ cd proftpd-<i>version</i>/locale/
88 $ make check
89 </pre>
90 If you see that a language translation is out of date and you can help,
91 simply update the <code>.po</code> file that language, and open a bug request
92 and attach the diff, or send the diff to the ProFTPD developers mailing list.
93
94 <p>
95 <hr>
96 <font size=2><b><i>
97 &copy; Copyright 2017 The ProFTPD Project<br>
98 All Rights Reserved<br>
99 </i></b></font>
100 <hr>
101
102 </body>
103 </html>