4b794eaf73
gcc/po/ * exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. Because of xgettext bug, invoke xgettext once with --language=c, once with --language=GCC-source and then merge together. Fail if xgettext is not 0.14.5 or later. gcc/ * intl.h (G_): New macro. * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid instead of msgid for argument name. * tree-ssa.c (warn_uninit): Likewise. * c-parser.c (c_parser_error): Likewise. * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. * config/darwin-c.c (BAD): Likewise. * config/c4x/c4x-c.c (BAD): Likewise. * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. * c-common.c (c_parse_error): Likewise. * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, warning0, pedwarn, error, sorry, fatal_error, internal_error): Likewise. (fnotice): Use cmsgid instead of msgid for argument name. * gcov.c (fnotice): Likewise. * protoize.c (notice): Likewise. * final.c (output_operand_lossage): Likewise. * gcc.c (fatal, notice): Likewise. (error): Use gmsgid instead of msgid for argument name. * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead of msgid for argument name. (error): Use gmsgid instead of msgid for argument name. * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() instead of N_(). * c-typeck.c (readonly_error, convert_for_assignment): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new conventions for marking translations. * doc/install.texi: Mention gettext 0.14.5 or later requirement. gcc/cp/ * error.c (locate_error): Use gmsgid instead of msgid for argument name. (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. gcc/java/ * jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of msgid for argument name. * gjavah.c (error): Likewise. * java-tree.h (parse_error_context): Likewise. * parse.y (parse_error_context, parse_warning_context, issue_warning_error_from_context): Likewise. From-SVN: r100676
50 lines
2.4 KiB
Plaintext
50 lines
2.4 KiB
Plaintext
Notes on GCC's Native Language Support
|
|
|
|
By and large, only diagnostic messages have been internationalized.
|
|
Some work remains in other areas; for example, GCC does not yet allow
|
|
non-ASCII letters in identifiers.
|
|
|
|
Not all of GCC's diagnostic messages have been internationalized. Programs
|
|
like `genattr' (in fact all gen* programs) are not internationalized, as
|
|
their users are GCC maintainers who typically need to be able to read
|
|
English anyway; internationalizing them would thus entail needless work for
|
|
the human translators. Messages used for debugging, such as used in dumped
|
|
tables, should also not be translated.
|
|
|
|
The GCC library should not contain any messages that need
|
|
internationalization, because it operates below the internationalization
|
|
library.
|
|
|
|
Unlike some other GNU programs, the GCC sources contain few instances
|
|
of explicit translation calls like _("string"). Instead, the
|
|
diagnostic printing routines automatically translate their arguments.
|
|
For example, GCC source code should not contain calls like `error
|
|
(_("unterminated comment"))'; it should contain calls like `error
|
|
("unterminated comment")' instead, as it is the `error' function's
|
|
responsibility to translate the message before the user sees it.
|
|
|
|
By convention, any function parameter in the GCC sources whose name
|
|
ends in `msgid' is expected to be a message requiring translation.
|
|
If the parameter name ends with `gmsgid', it is assumed to be a GCC
|
|
diagnostics format string requiring translation, if it ends with
|
|
`cmsgid', it is assumed to be a format string for `printf' family
|
|
of functions, requiring a translation.
|
|
For example, the `error' function's first parameter is named `gmsgid'.
|
|
GCC's exgettext script uses this convention to determine which
|
|
function parameter strings need to be translated. The exgettext
|
|
script also assumes that any occurrence of `%eMSGID}' on a source
|
|
line, where MSGID does not contain `%' or `}', corresponds to a
|
|
message MSGID that requires translation; this is needed to identify
|
|
diagnostics in GCC spec strings.
|
|
The `G_(GMSGID)' macro defined in intl.h can be used to mark GCC diagnostics
|
|
format strings as requiring translation, but other than that it is a
|
|
no-op at runtime.
|
|
|
|
If you modify source files, you'll need at least version 0.14.15 of the
|
|
GNU gettext package to propagate the modifications to the translation
|
|
tables.
|
|
|
|
After having built and installed these gettext tools, you have to
|
|
configure GCC with --enable-maintainer-mode to get the master catalog
|
|
rebuilt.
|