Message files: Difference between revisions
(using msgdif) |
mNo edit summary |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Message files}} | |||
back to contents [[FPC internals]] | |||
== Basics == | == Basics == | ||
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. | 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. | ||
Line 14: | Line 18: | ||
Example: | Example: | ||
msgdif errore.msg errorr.msg | msgdif errore.msg errorr.msg | ||
[[Category:FPC internals]] |
Latest revision as of 13:11, 28 December 2020
│
English (en) │
русский (ru) │
back to contents FPC internals
Basics
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.
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
cd fpc/compiler; make msg
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.
Translating
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.
Example:
msgdif errore.msg errorr.msg