1Notes on GCC's Native Language Support
2
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
7Not all of GCC's diagnostic messages have been internationalized. Programs
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.
13
14The GCC library should not contain any messages that need
15internationalization, because it operates below the internationalization
16library.
17
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.
28If the parameter name ends with `gmsgid', it is assumed to be a GCC
29diagnostics format string requiring translation, if it ends with
30`cmsgid', it is assumed to be a format string for `printf' family
31of functions, requiring a translation.
32For example, the `error' function's first parameter is named `gmsgid'.
33GCC's exgettext script uses this convention to determine which
34function parameter strings need to be translated.  The exgettext
35script also assumes that any occurrence of `%eMSGID}' on a source
36line, where MSGID does not contain `%' or `}', corresponds to a
37message MSGID that requires translation; this is needed to identify
38diagnostics in GCC spec strings.
39The `G_(GMSGID)' macro defined in intl.h can be used to mark GCC diagnostics
40format strings as requiring translation, but other than that it is a
41no-op at runtime.
42
43If you modify source files, you'll need at least version 0.14.15 of the
44GNU gettext package to propagate the modifications to the translation
45tables.
46
47After having built and installed these gettext tools, you have to
48configure GCC with --enable-maintainer-mode to get the master catalog
49rebuilt.
50
51
52Copyright (C) 1998-2018 Free Software Foundation, Inc.
53
54Copying and distribution of this file, with or without modification,
55are permitted in any medium without royalty provided the copyright
56notice and this notice are preserved.
57