]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/ABOUT-GCC-NLS
sh.c: Do not include algorithm.
[thirdparty/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.
4b794eaf
JJ
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'.
d70283ce
JL
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.
4b794eaf
JJ
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.
d70283ce 42
4b794eaf 43If you modify source files, you'll need at least version 0.14.15 of the
a71d3613
PT
44GNU gettext package to propagate the modifications to the translation
45tables.
842eb2a3 46
a71d3613
PT
47After having built and installed these gettext tools, you have to
48configure GCC with --enable-maintainer-mode to get the master catalog
49rebuilt.
ad41bd84
JM
50
51\f
23a5b65a 52Copyright (C) 1998-2014 Free Software Foundation, Inc.
ad41bd84
JM
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.