home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.20 / text0087.txt < prev    next >
Encoding:
Internet Message Format  |  1990-08-02  |  3.1 KB

  1. From:  guy@auspex.uucp (Guy Harris)
  2.  
  3. >Both examples you supplied were simply ways to look up strings to output in
  4. >a database keyed on locale and an internal program string; they differ only
  5. >in minor ways.  Does either proposal address any of the *hard* issues?  For
  6. >instance, different languages have different pluralization rules; how do
  7. >you internationalize a program that automatically pluralizes when necessary
  8. >(I hate programs that say things like "1 files deleted")?  Or what about
  9. >differing word order; how would you internationalize
  10. >
  11. >    printf("the %s %s", adjective, noun);
  12. >
  13. >so that it would look right in a language where adjectives follow nouns?
  14.  
  15. The latter can addressed by a scheme like the X/Open NLS scheme, in
  16. which "printf" arguments can be decorated by specifiers that say which
  17. of the N arguments to "*printf" following the format string should be
  18. used; the "the %s %s" would have to replace "%s %s" with "%$2s %$1s".
  19.  
  20. HOWEVER:
  21.  
  22. This does *NOT* do anything about the pluralization rules.  It *also*
  23. does nothing about the fact that the correct translation of "the" could
  24. depend on the noun in question; i.e., is it "la" or "le" in French?
  25.  
  26. I think that, for reasons such as these, the only solution to the
  27. problem of trying to find a Magic Bullet so that you can trivially
  28. internationalize the message-printing code of applications by throwing a
  29. simple-minded wrapper around "printf" (whether the #define approach, or
  30. replacing the format string with "getmsg(the format string)", or
  31. whatever) is to have software that is sufficiently knowledgable about
  32. *all* human languages supported that it knows the gender of all nouns
  33. you'll use in your messages, and knows the right articles for those
  34. genders (for all cases the language has), and knows how to pluralize
  35. arbitrary words.
  36.  
  37. In fact, I'm not even sure *that's* sufficient; I only know about some
  38. Indo-European languages, and other languages may throw in problems I
  39. haven't even considered.
  40.  
  41. In other words, I don't think there's a solution to the problem of "oh
  42. dear, how are we going to get all our applications modified to put out
  43. grammatically-correct messages in different languages without having to
  44. examine all the code that generates messages and possibly rewrite some
  45. of that code" other than teaching the system a fair bit about lots of
  46. human languages.  I don't think you can even come up with an approach
  47. that's close enough to a solution to be interesting.  I'm afraid you're
  48. just going to have to fall back on things such as:
  49.  
  50.     having "1 frob" and "%d frobs" be *two* separate messages in the
  51.     message catalog;
  52.  
  53.     having "the chair" and "the table" either be two separate
  54.     messages, rather than having "the %s" and foreign-language
  55.     versions of same, or having the message be "%s %s" and have the
  56.     database tie the noun and the article together (watch out for
  57.     Russian, though, they don't *use* articles...);
  58.  
  59. etc..
  60.  
  61. Yeah, this may mean human intervention, rather than being able to
  62. internationalize your messages by running just running a few programs
  63. over the code; nobody ever said that life was fair.  Might as well bite
  64. the bullet.... 
  65.  
  66. Volume-Number: Volume 20, Number 86
  67.  
  68.