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