readme
1PGP Foreign Language Tools
2--------------------------
3
4The "langtool" directory contains tools for manipulating foreign
5language translations for PGP's prompts and error messages. The
6makefile is for Unix; the tools don't build cleanly under MS-DOS,
7although a little hacking should fix that.
8
9One problem is that the code assumes getopt() is in the standard
10library, which it usually isn't with MS-DOS compilers, but you can
11steal getopt.c from the PGP source to fix that one.
12
13In any case, the programs are:
14
15pickpstr - this takes a list of filenames on the command line,
16searches them for LANG("...") constructs, and emits the "..." strings
17on standard output. This is used to extract the strings to be
18translated from the PGP source. The strings are found by searching
19for the 6-character LANG(" sequence. Any spaces cause the string to
20be missed. (the name comes from PSTR(), the macro that was replaced
21by LANG().)
22
23killdups - this copies the outout of pickpstr from stdin to stdout,
24stripping out duplicates.
25
26charconv - this converts between ISO Latin-1 and IBM PC code page 850
27character sets.
28
29langtool - this is the big one, that merges various translation
30files, reporting which translations are missing, and so on. It can
31extract a translation, merge translations, or check translation files
32for errors.
33
34
35The following notes were written by Branko Lankester for PGP 2.3a.
36
37---------------------------------------------------------------------
38
39 PGP language tools.
40
41
42This is set of tools to maintain the PGP language files, with these
43tools you can find new messages in the PGP source code and add them to
44your language file. You can also merge multiple languages into one file
45and extract languages from a merged file.
46
47
48Two programs are needed to extract the PSTR messages from the PGP source
49code: "pickpstr" and "killdups", the batch file extract.bat will run
50these programs on the PGP source files in the right order (the order is
51important if you want to use diff to find differences). You must run
52extract.bat in the pgp src directory, this will create the file
53"pstrmsgs". I have included this file with these tools.
54
55
56To create an up-to-date language file with one or more translations you
57must use the "langtool" program with the merge (-m) option:
58
59langtool -m -o newfile.txt pstrmsgs language.txt
60
61language.txt is the old language file with your translations. If there
62is more than one language in this file you must specify the language
63identifier after the filename. The output file "newfile.txt" will
64contain all messages from "pstrmsgs" and the translations from
65"language.txt", new messages that are not present in language.txt will
66have the line:
67
68No translation
69
70instead of the translated message, so you can use the "find" command of
71your editor to find the untranslated messages by searching for this string.
72
73
74If you want to combine several languages into one file you can also
75use "langtool" with the -m option:
76
77langtool -m -o language.txt lang1.txt lang2.txt
78
79This will add the language in lang2.txt to the combined language file
80"lang1.txt", the merged output will be in "language.txt". If you
81want to add another language, run the same command again, but use the
82output file from the last command (language.txt) as first inputfile:
83
84langtool -m -o outfile.txt language.txt lang3.txt
85
86"langtool -m" will use all translations from the first inputfile, and
87one translation from the second input file. If the second file contains
88more than one language, you can specify the language you want after the
89last filename.
90
91
92You can also use langtool to extract one or more languages from a
93combined language file:
94
95langtool -x -o es-nl.txt language.txt es nl
96
97will extract the languages with identifiers "es" and "nl" from
98language.txt to the file "es-nl.txt"
99
100
101If you want to run a simple check on a language file (the same check
102that is done when pgp creates an index file), you can use the -c option:
103
104langtool -c language.txt
105
106This will print the number of messages, and the number of translations.
107
108
109A language file for distribution should be in the PGP internal character
110set: latin-1, for Russian it should be in KOI8. This means that if your
111system doesn't use a latin-1 or KOI8 character set you will have to
112convert the language file to this internal format before you add it to
113the distribution. You can use the "charconv" program to do this:
114
115charconv int language.in >language.txt
116
117will convert from cp850 to the latin-1 internal format. To convert from
118internal to external, use "charconv ext file_name". For conversion
119between Russian character sets you need a different program. Harry Bush
120has sent me such a program, I assume the Russian translators already
121have this program, but if someone needs it, I can send it to you.
122
123
124Branko
125