]> gcc.gnu.org Git - gcc.git/blame - gcc/ABOUT-GCC-NLS
* mangle.c (get_identifier_nocopy): Add cast.
[gcc.git] / gcc / ABOUT-GCC-NLS
CommitLineData
d70283ce
JL
1Notes on GCC's Native Language Support
2
d70283ce
JL
3By and large, only diagnostic messages have been internationalized.
4Some work remains in other areas; for example, GCC does not yet allow
5non-ASCII letters in identifiers.
6
842eb2a3 7Not all of GCC's diagnostic messages have been internationalized. Programs
bfb53001
ZW
8like `genattr' (in fact all gen* programs) are not internationalized, as
9their users are GCC maintainers who typically need to be able to read
10English anyway; internationalizing them would thus entail needless work for
11the human translators. Messages used for debugging, such as used in dumped
12tables, should also not be translated.
d70283ce
JL
13
14The GCC library should not contain any messages that need
842eb2a3
PT
15internationalization, because it operates below the internationalization
16library.
d70283ce 17
d70283ce
JL
18Unlike some other GNU programs, the GCC sources contain few instances
19of explicit translation calls like _("string"). Instead, the
20diagnostic printing routines automatically translate their arguments.
21For example, GCC source code should not contain calls like `error
22(_("unterminated comment"))'; it should contain calls like `error
23("unterminated comment")' instead, as it is the `error' function's
24responsibility to translate the message before the user sees it.
25
26By convention, any function parameter in the GCC sources whose name
27ends in `msgid' is expected to be a message requiring translation.
28For example, the `error' function's first parameter is named `msgid'.
29GCC's exgettext script uses this convention to determine which
30function parameter strings need to be translated. The exgettext
31script also assumes that any occurrence of `%eMSGID}' on a source
32line, where MSGID does not contain `%' or `}', corresponds to a
33message MSGID that requires translation; this is needed to identify
34diagnostics in GCC spec strings.
35
146ef880 36If you modify source files, you'll need at least version 0.10.37 of the
a71d3613
PT
37GNU gettext package to propagate the modifications to the translation
38tables.
842eb2a3 39
a71d3613
PT
40After having built and installed these gettext tools, you have to
41configure GCC with --enable-maintainer-mode to get the master catalog
42rebuilt.
This page took 0.831877 seconds and 5 git commands to generate.