ABOUT-GCC-NLS 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Notes on GCC's Native Language Support
  2. By and large, only diagnostic messages have been internationalized.
  3. Some work remains in other areas; for example, GCC does not yet allow
  4. non-ASCII letters in identifiers.
  5. Not all of GCC's diagnostic messages have been internationalized. Programs
  6. like `genattr' (in fact all gen* programs) are not internationalized, as
  7. their users are GCC maintainers who typically need to be able to read
  8. English anyway; internationalizing them would thus entail needless work for
  9. the human translators. Messages used for debugging, such as used in dumped
  10. tables, should also not be translated.
  11. The GCC library should not contain any messages that need
  12. internationalization, because it operates below the internationalization
  13. library.
  14. Unlike some other GNU programs, the GCC sources contain few instances
  15. of explicit translation calls like _("string"). Instead, the
  16. diagnostic printing routines automatically translate their arguments.
  17. For example, GCC source code should not contain calls like `error
  18. (_("unterminated comment"))'; it should contain calls like `error
  19. ("unterminated comment")' instead, as it is the `error' function's
  20. responsibility to translate the message before the user sees it.
  21. By convention, any function parameter in the GCC sources whose name
  22. ends in `msgid' is expected to be a message requiring translation.
  23. If the parameter name ends with `gmsgid', it is assumed to be a GCC
  24. diagnostics format string requiring translation, if it ends with
  25. `cmsgid', it is assumed to be a format string for `printf' family
  26. of functions, requiring a translation.
  27. For example, the `error' function's first parameter is named `gmsgid'.
  28. GCC's exgettext script uses this convention to determine which
  29. function parameter strings need to be translated. The exgettext
  30. script also assumes that any occurrence of `%eMSGID}' on a source
  31. line, where MSGID does not contain `%' or `}', corresponds to a
  32. message MSGID that requires translation; this is needed to identify
  33. diagnostics in GCC spec strings.
  34. The `G_(GMSGID)' macro defined in intl.h can be used to mark GCC diagnostics
  35. format strings as requiring translation, but other than that it is a
  36. no-op at runtime.
  37. If you modify source files, you'll need at least version 0.14.15 of the
  38. GNU gettext package to propagate the modifications to the translation
  39. tables.
  40. After having built and installed these gettext tools, you have to
  41. configure GCC with --enable-maintainer-mode to get the master catalog
  42. rebuilt.
  43. Copyright (C) 1998-2015 Free Software Foundation, Inc.
  44. Copying and distribution of this file, with or without modification,
  45. are permitted in any medium without royalty provided the copyright
  46. notice and this notice are preserved.