home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / pascal / 7674 < prev    next >
Encoding:
Text File  |  1992-12-25  |  4.9 KB  |  109 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!spool.mu.edu!agate!ames!purdue!mentor.cc.purdue.edu!pf@bilbo.bio.purdue.edu
  3. From: pf@bilbo.bio.purdue.edu (Paul Furbacher)
  4. Subject: Re: User-interface's language
  5. Message-ID: <Bzt6yC.DDJ@mentor.cc.purdue.edu>
  6. Sender: news@mentor.cc.purdue.edu (USENET News)
  7. Organization: Purdue University
  8. References: <24DEC92.15463556.0031@music.mus.polymtl.ca>
  9. Distribution: comp.lang.pascal
  10. Date: Fri, 25 Dec 1992 09:42:11 GMT
  11. Lines: 96
  12.  
  13. In article <24DEC92.15463556.0031@music.mus.polymtl.ca>, CT80@music.mus.polymtl.ca (Steph) writes:
  14. > I suspect not many of you out there have this problem, but *I* do
  15. > and maybe you guys know of a way to fix it.  I live in Quebec, and
  16. > while the market here has a French potential, any program that
  17. > I make would have to be in English.  Problem is, there are always
  18. > the odd requests for the French equivalent of my software.  How
  19. > does one go about designing a code that can be ported, easily, to
  20. > any language?  I tried the following approach, on a BBS package
  21. > I wrote: put all the strings as constants.  While it seemed
  22. > feasible, I soon had to trash this idea because, on a 20,000+
  23. > project, you soon get lost with your naming scheme of
  24. > string-constants.
  25. > I don't really want to maintain two copies of the same software
  26. > at the same time, ...
  27.  
  28. And that's what the concept of "application interface 
  29. internationalization" is all about.  Because most on this group 
  30. program PeeCees, most haven't thought about this and few 
  31. have every paid any attention to the all but hidden exhortations
  32. which do exist in the DOS/Windows world to "internationalize".
  33.  
  34. How do you do it? On the Mac, from the earliest days, each
  35. file has the possibility of having two "forks": 
  36. one for "data" and the other for "resources".  
  37. Steve Jobs, upon forming NeXT, agreed to certain 
  38. restrictive terms with the bean counters and lawyers at 
  39. Apple (at least this is the legend as I've heard it). One
  40. was to not use the same "forked" file structure.  The other
  41. was to not create hardware with a monitor of fewer than
  42. a million pixels, hence the large NeXT monitors
  43. ever since the first cubes came out.  NeXTStep uses a Unix
  44. flavored file system but essentially there are "resource"
  45. files.  
  46.  
  47. What is a resource?  It is a code-independent collection of 
  48. interface elements and other items. The important
  49. concept is "code-independent".  In order to "internationalize"
  50. your application, everything the user sees of the app
  51. must be stored and read from resource files.  Say the user
  52. wants to open a file.  The "open file" dialog box elements
  53. are stored as resources -- the strings, buttons, help comments, 
  54. whatever is visible in the dialog box, even the description of
  55. the height, width, color, etc., of the box itself -- is held 
  56. in the resource.  At the appropriate moment, when requested,
  57. the application opens the resource file, reads the resource 
  58. descriptions, translates them into the appropriate structures or
  59. records, or better yet classes (C++) or object instances (Object
  60. Pascal), and goes about painting them onto the screen.
  61.  
  62. If you wish to have multiple versions of your app, you simply
  63. edit the resource files, *not* your code.  Nothing which the
  64. user sees should be embedded in your code.  Encapsulation 
  65. to the max.
  66.  
  67. For the Mac, since very early on, there's been a great 
  68. program from Apple called ResEdit.  Though it's not advised
  69. except for the most experienced user, one can alter the 
  70. resources of any Mac application, thereby customizing 
  71. the application for your own purposes.
  72.  
  73. Now, how do you do this in the DOS/Windows world?  Program in 
  74. Windows and use the resource editors/compilers which are 
  75. available. Examples are the Borland Resource WorkShop and the 
  76. WhiteWater (bought by someone recently) rival.  
  77.  
  78. In the DOS world, there's TurboVision (Pascal/C++).  There
  79. are several resource compiler/editors: SHAZAM is a shareware
  80. product (TV/Pascal only?), and the Blaise TurboVision 
  81. Development Toolkit is commercially available for both 
  82. TV/Pascal&C++.  (You don't need them if you follow the 
  83. examples provided with TurboVision, though the latter is
  84. a bit more laborious.  The Blaise product has some 
  85. limitations which become severe if your project is on
  86. the large side.  I'm not familiar enough with SHAZAM to
  87. comment on any of its possible limitations.  It seems 
  88. as though the latter is the product of a more imaginative,  
  89. perservering and responsive author.  Blaise has been 
  90. very slow to make improvements which are necessary to 
  91. render the product unfrustrating and productive for the 
  92. serious developer.) 
  93.  
  94. This all means that you'll have to upgrade your
  95. programming tools, given that you  currently own ones  
  96. which have not introduced the idea of internationalization
  97. to you in their manuals.
  98.  
  99. Good programming practice demands that the intelligent project
  100. managers design programs based on using resources.  Increasingly, 
  101. except for very narrow niche applications perhaps, 
  102. internationlization will be a prerequisite.
  103.  
  104. PF
  105.  
  106.  
  107.