home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / i18nv104.zip / SAMPLE / WORLD / READ.ME < prev    next >
Text File  |  1996-02-13  |  7KB  |  169 lines

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