home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / i18nv102.zip / SAMPLE / WORLD / READ.ME < prev    next >
Text File  |  1995-09-19  |  7KB  |  172 lines

  1.  
  2. ===============================================================================
  3.                   Internationalization (I18N) For OS/2                 
  4. ===============================================================================
  5.  
  6.                 Copyright IBM Corporation -- 1993, 1994, 1995
  7.  
  8. DISCLAIMER: This I18N package has been made available solely to gauge OS/2
  9. developer interest in the industry standard XPG4 internationalization 
  10. programming model. This does not mean that IBM will introduce a product based
  11. on the contents of this package. This package is not a full implementation of 
  12. the X/Open XPG4 specification and does not make any claims of XPG4 branding. 
  13. It implements only the portions of the XPG4 specification which deal with 
  14. internationalization.
  15.  
  16. X/Open is a trademark of the X/Open Company Limited.
  17.  
  18. ===============================================================================
  19.  
  20.  
  21. /************************/
  22. /***     Contents     ***/
  23. /************************/
  24.  
  25. 1.  Overview
  26. 2.  How to run the sample program
  27. 3.  How to compile the sample program
  28. 4.  Files in this directory
  29. 5.  How to add a new locale to the WORLD demo
  30. 6.  Notes
  31.  
  32. 1.  Overview
  33. ============
  34.  
  35. This directory contains the "world" program.  world is a simple PM application
  36. which uses some of the I18N functions.  It also demonstrates many of the
  37. techniques one can use to internationalize PM programs, including message
  38. catalogs, an icon per locale (where the icon can be changed outside of the
  39. executable program), internationalized dialogs (centered, with no hard-coded
  40. buttons), and more.
  41.  
  42. The program shows a map of the world, and some cities for which there are
  43. locales defined.  Clicking on the box next to a city shows a dialog box
  44. with culturally formatted information, and a list of strings which can be
  45. collated in a cultural manner.  Pressing the "collate" button will cause the
  46. strings in the list box to be sorted.
  47.  
  48. WORLD can also display its messages (static text) in different languages.
  49. Selecting a locale from the "Messages" menu will cause the static text
  50. (such as titles, menus, and buttons) to be converted over to the language
  51. of that locale.  In addition, the minimized icon will change to the flag
  52. of the new locale.  Selecting the "Show icons" option in the options menu
  53. will toggle between text and flag bitmaps in the "Messages" menu.
  54.  
  55. WORLD is extensively commented, and can be used as a template of an
  56. interationalized PM program.
  57.  
  58.  
  59. 2.  How to run the sample program
  60. =================================
  61.  
  62. The following steps show how the program can be run.
  63.  
  64.      1) Run the \i18n\bin\new_vars command file (or have the environment
  65.         variables already set).
  66.  
  67.      2) Execute the world.exe program.
  68.  
  69.           Ex:   world
  70.  
  71.  
  72. 3.  How to compile the sample program
  73. =====================================
  74.  
  75. NOTE: The sample program is already compiled for you.  If you want to see the
  76.  behavior of the program, you can just run it.  The following instructions
  77.  are needed only if you want to modify the program and recompile it.
  78.  
  79. To compile the sample application:
  80.  
  81.      1) Make sure that the CSET/2 compiler and OS/2 toolkit are installed
  82.         correctly on your system.
  83.  
  84.      2) cd to the directory which contains the info source files.
  85.  
  86.      3) Type "build" at the command prompt.
  87.  
  88.  
  89. 4.  Files in this directory
  90. ===========================
  91.  
  92. File            Purpose
  93. ------------------------------------------------------------------------------
  94. world.c         Source code for the world sample program.
  95. world.h         Include file for the program.
  96. localpth.h      Include file for the locale path dialog.
  97. about.h         Include file for the about dialog.
  98.  
  99. wrld.msg        English language version of the message catalog.
  100.  
  101. world.rc        Resource file for the program.
  102. about.dlg       Dialog definition for the about dialog box.
  103. localpth.dlg    Dialog definition for the locale path dialog box.
  104. world.dlg       Dialog definitions for the world program.
  105.  
  106. world.def       Definition file needed for compiling the program.
  107. world.mak       Make file used to compile the sample.
  108. world.exe       Compiled version of the world sample.
  109.  
  110. texas.ico       Texas flag icon for the about dialog box.
  111. *.bmp           Bitmaps of the locale flags used in the menu.
  112.  
  113. build.cmd       A command file which will compile and link the sample program.
  114. read.me         This file.
  115.  
  116. In addition, there are message catalogs and icon files for each locale already
  117. written for you.  They are located in the directories: \i18n\messages\xxyyzzzz
  118. where "xxyyzzzz" is a locale name.
  119.  
  120. In each of these directories, the file: "wrld.cat" is the message catalog,
  121. and the file: "world.ico" is the minimized icon to use for that locale.  Users
  122. can use the ICONEDIT program to change the icons for any of the locales.
  123.  
  124.  
  125. 5.  How to add a new locale to the WORLD demo
  126. =============================================
  127.  
  128. The following are the steps to follow to add a new locale to the WORLD demo
  129. program:
  130.  
  131.      1) Add a new city on the world bitmap (WORLD.BMP) with a program such as
  132.         PC Paintbrush (ICONEDIT cannot hold the bitmap for WORLD).
  133.      2) Add the following to world.h:
  134.         A) Add a new define for the locale menu item (look for MENU_LANGS_LANG0)
  135.         B) Add a new define for the locale bitmap (look for BITMAP_LANG0).
  136.         C) Increase the NUM_LOCALES by 1.
  137.         D) Add a new #define for the locale (look for LOCALE_EN_US).
  138.         E) Add to the end of the "locale_names" array.
  139.         F) Add to the array of dialog locations ("locale_locs").
  140.         G) Add to the array of hit test locations ("locale_hit_locs").  This may
  141.             take some experimenting (with clicking the mouse) to see where the
  142.             proper rectangle hit location is.
  143.      3) Add a .bmp file for the flag of the locale to the WORLD directory.
  144.      4) Add a .ico file for the flag (called world.ico) in a locale directory
  145.          (ex: \i18n\messages\enus437\world.ico).
  146.      5) Add the following to world.rc:
  147.         A) Add a BITMAP statement for the bitmap added in #3 above (with the
  148.             same name as in #2B above).
  149.         B) Add a new menu item to the MENU_LANGS menu.
  150.      6) Add the following to world.c:
  151.         A) Add a new case to the switch statement for the new menu item
  152.             (look for "case MENU_LANGS_LANG1").
  153.      7) Add the following to world.mak:
  154.         A) Add a dependency for the world.res file for the new bitmap file
  155.             (look for usa.bmp).
  156.      8) Add the following to each existing message catalog:
  157.         A) A string for the locale name (look for MEN_LANGS_LANG0).
  158.         B) A country name (look for 3020 - which is United States).
  159.      9) Add a translated message catalog for the new locale to the proper
  160.          locale directory (such as \i18n\messages\xxxxxxxx\wrld.cat), where
  161.          xxxxxxxx is the new locale name.
  162.  
  163.  
  164. 6.  Notes
  165. =========
  166.  
  167. 1. Some of the locales (jajp, araa) use code sets which are not natively
  168.    supported on most versions of OS/2.  Thus, the messages may not be displayed
  169.    correctly on the screen for those locales (because OS/2 cannot render the
  170.    proper arabic or kanjii characters).  If WORLD is run on a machine which
  171.    *does* support those code pages, the messages will display correctly.
  172.