home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / LIBC / LIBC-4.6 / LIBC-4 / libc-linux / nls / linux / README.editing < prev    next >
Encoding:
Text File  |  1993-11-24  |  2.6 KB  |  69 lines

  1. Message cataloging in the C library has some difficulties but may be
  2. overcome by forcing ordering in the message files.
  3.  
  4. In general the message files (.m) are position independent as long as the
  5. keywords are unique when the sources are compiled. However static structures
  6. or arrays of error messages, (sys_errlist[] and sys_siglist[] are just a few
  7. that pop to mind), pose difficulties as the message are not available until
  8. execution and then only numerically (errnum or signum). Therefore these
  9. message files should NOT be re-ordered.
  10.  
  11. If you do not have translation for the corresponding messages in the .m
  12. files the please leave them alone.
  13.  
  14. Any of the message catalogs may be left out. See the `German' directory and
  15. the `Makefile' for "make german". I was only given the standard `errlist'.
  16. The message catalog retrival routines will return the default english
  17. message if the corresponding translated message cannot be found.
  18.  
  19. Lets look at the format of the message file and what you need to edit.
  20. Example: English/h-error.m
  21.  
  22.     $set 5 #HerrorList
  23.     $ #1 Original Message:(Unknown host)
  24.     # Unknown host
  25.     $ #2 Original Message:(Host name lookup failure)
  26.     # Host name lookup failure
  27.     ,     ,    ,
  28.     ,    ,    ,
  29.     ,    ,    ,
  30.  
  31.  
  32. First:    Anything with a $ at the begining of the line should not be touched.
  33.  
  34. Ok. Now the first line: (DO NOT EDIT)
  35.     The `set' word must exist in all message files.
  36.     The second field number MUST be unique per application.
  37.     The third field (minus the #) is prepended to all messages id's and
  38. +---->  the word "Set" is appended to this to identify the set as a #define
  39. |    instead. Obviously it can be accessed via the number in the second
  40. |    field if you prefer.
  41. |
  42. |   The second line: (DO NOT EDIT)
  43. |    Don't touch the $.
  44. |    The second field is the unique id for this message and is concatenated
  45. |    with the third field of the `set' line above. So the #define in this
  46. |    case becomes `HerrorList1'. You may access this message in your program
  47. |    with the following.    |
  48. |                              +------------------------+
  49. |                                                       |
  50. +-----------------------------------------+             |
  51.                                           |             |
  52.         catgets(catalog_fd, HerrorListSet, HerrorList1, "my message")
  53.  
  54.     The third and subsequent fields are ignored and is put there for your
  55.     reference only. It is not included in the compiled catalog.
  56.  
  57.     The third line: (EDIT ME)
  58.     Edit this line to your own language.
  59.     DO NOT REMOVE THE hash (#) at the begining of the line.
  60.  
  61.  
  62. Subseuqent lines as just the same as the latter two above.
  63.  
  64. Any problems ??
  65. Contact me.
  66.  
  67. Mitch
  68. (m.dsouza@mrc-apu.cam.ac.uk)
  69.