Message files: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | back to contents [[FPC internals]] | |
| 2 | 2 | ||
| 3 | 3 | ## Basics | |
| 4 | 4 | ||
| 5 | 5 | The compiler uses the files in fpc/compiler/msg to output translated error message. The default one, errore.msg, is compiled into the compiler, so it will work without any message file available. | |
| 6 | 6 | ||
| 7 | 7 | To add a new message, find the appropriate section (parser_, scan_ etc.) in errore.msg and add the new message at the end of this section with a new succeeding message id. Then rebuild the built-in message tables with | |
| 8 | 8 | ||
| 9 | - | ||
| 9 | + | ```text | |
| 10 | + | cd fpc/compiler; make msg | |
| 11 | + | ``` | |
| 10 | 12 | ||
| 11 | 13 | and commit the resulting msg*.inc files as well as the changed errore.msg file. The translators are responsible to add the new messages to the translated files. | |
| 12 | 14 | ||
| 13 | 15 | ## Translating | |
| 14 | 16 | ||
| 15 | 17 | In order to get a starting point for updating the message files of other languages, one can use the program msgdif from fpc/compiler/utils. It compares two message files and outputs problems as well as a file new.msg, which you can take as a starting point for an update. | |
| 16 | 18 | ||
| 17 | 19 | Example: | |
| 18 | 20 | ||
| 19 | - | ||
| 21 | + | ```text | |
| 22 | + | msgdif errore.msg errorr.msg | |
| 23 | + | ``` | |
| 20 | 24 | ||
| 21 | 25 | --- | |
| 22 | 26 | *From the Free Pascal wiki, page "Message files", as it stood on 2020-12-28 after a change by E-ric, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 23 | 27 | Category: FPC internals |
