home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1991: Code Warrior / bincue / Code Warrior.bin / Tools & Apps (Moof!) / Localization Tools / MPW Localization Tool / Localization / Menu_Commands < prev    next >
Encoding:
Text File  |  1990-08-23  |  4.0 KB  |  128 lines  |  [TEXT/MPS ]

  1. #    © Apple Computer, 1985-1990
  2. #
  3. #    For use with localization.
  4. #   Written by Cindy Roberts & Martin Gannholm
  5. #   June 6th--(Cindy)-fixed misc bugs & added script based system compatibility
  6. #   June 22--(Cindy)-added Extract Resources menu item
  7. #    July 15--(Cindy)-changed UserStartup (removed stuff about Temp; deleted MPW:Localization:temp
  8. #    July 21--(Cindy)-added the ability to make a final file from any text file
  9. #    July 21--(Cindy)-added the ability to find the next string in a text file by selecting a menu item command
  10. #    July 21--(Cindy)-added support for insc resources
  11. #    July 28--(Martin)--added support for CNTL.
  12. #    --also removed "strip" command & used MPW 2.0 enhancements to automatize
  13. #    August 18--(Cindy)-changed Select Next String 'cause it didn't always choose the next one;
  14. #    now I'm not sure if it chooses the last one
  15. #
  16. #    March, 88--(Cindy)-added the ability to Rez and ReRez PREC resouces
  17. #    March 21--(Cindy & Martin)-merged Make Final Installer Script into Make Final File
  18. #                    -added a search for the next menu
  19. #                    -added support for CTY# resource
  20. #                    -added command to RezDet all files on a disk
  21. #
  22. #   March 25--(Cindy)-added support for signature, MSTR, and MST# resources
  23. #
  24. #    1/29/90      ddm    Reformatted for ease of reading.
  25. #    2/1/90      ddm    Between 1/29 and 2/1 I have made major changes to the Compare Files
  26. #                    menu item.  Status messages are sent to the worksheet when starting
  27. #                    and finishing.  Output is now carefully directed rather than being 
  28. #                    strewn about in any window that happens to be open.
  29. #    2/14/90      ddm    Added the “About the Localize menu...” item to the Localize menu.
  30. #
  31. #
  32. ##
  33. ##
  34. ##
  35. ##
  36. set temp "{exit}"
  37. set exit 0
  38. DeleteMenu "Project"        # ddm- delete the Project menu in MPW 3.0+ to make room for the 
  39. set exit {temp}                # ddm- Localize menu on small screens
  40. unset temp
  41. #
  42. #
  43. #
  44. #
  45. addmenu ∂
  46.     "Localize" ∂
  47.         "Extract Resources/1" ∂
  48.             'set newUS `GetFileName -m "Select a file"`;∂
  49.              Export newUS;∂
  50.              extract'
  51. #
  52. #
  53. ### ddm- Note:    The menu item name “Compare Files” is a misnomer.  This command generates
  54. ###    ddm-         a rez text format file ({filename}.r) for all 3 files, compares the results, 
  55. ###    ddm-         and changes the {NewUS}.r file to reflect localized text found while  
  56. ###    ddm-         comparing the {oldUS}.r and {oldLOC}.r files.
  57. #
  58. #
  59. addmenu ∂
  60.     "Localize" ∂
  61.         "Compare Files/2" ∂
  62.             '∂
  63.             if `exists -f "{localization}Errors"`;∂
  64.                 delete -y "{localization}Errors";∂
  65.             end;∂
  66.             begin;∂
  67.                  open "{worksheet}";∂
  68.                  echo  >> "{worksheet}";∂
  69.                  echo "Starting “Compare Files” -- " `date` >> "{worksheet}";∂
  70.                  set oldUS `GetFileName -m "Select the previous US file."`;∂
  71.                  Export oldUS;∂
  72.                  set newUS `GetFileName -m "Select the current US file."`;∂
  73.                  Export newUS;∂
  74.                  set oldLOC `GetFileName -m "Select your last localized file."`;∂
  75.                  Export oldLOC;∂
  76.                  loccomparefiles;∂
  77.                  echo "Completing “Compare Files” -- " `date` >> "{worksheet}"; ∂
  78.             end ≥ "{localization}Errors";∂
  79.             if `exists -f "{localization}Errors"`;∂
  80.                 open "{localization}Errors";∂
  81.             end;∂
  82.             ;'
  83. #
  84. #
  85. addmenu ∂
  86.     "Localize" ∂
  87.         "Make Final File/3" ∂
  88.             'set txtfile `GetFileName -m "Select your new translations"`;∂
  89.              set newUS `GetFileName -m "Select your program file"`; ∂
  90.              rez "{localization}newtypes.r" "{txtfile}" -t "rEzƒ" -o "{txtfile}".o;∂
  91.              duplicate "{newUS}" "{newUS}_trans";∂
  92.              target "{localization}merge_it";∂
  93.              find •;∂
  94.              find /∂ ∂"/Δ:Δ/∂"/;∂
  95.              replace § "{newUS}";∂
  96.              find /∂ ∂"/Δ:Δ/∂"/;∂
  97.              replace § "{txtfile}.o";∂
  98.              close -y;∂
  99.              rez "{localization}merge_it" -append -o "{newUS}_trans";∂
  100.              beep 1c,4;beep 1e,4;beep 1f,4;beep 1g,25;∂
  101.              alert "That should be it, folks!"'
  102. #
  103. #
  104. addmenu ∂
  105.     "Localize" ∂
  106.         "Select Next String/4" ∂
  107.             'find Δ/[ ∂t∂n]∂"≈∂"/!2:Δ/∂"[ ∂t∂n]*[;},∂/][ ∂t∂n;,]+[∂/}rn]/ "{active}"'
  108. #
  109. #
  110. addmenu ∂
  111.     "Localize" ∂
  112.         "Select Next Menu/5" ∂
  113.             'find Δ/∂/∂n∂t∂t∂"/!5:/∂",[∂ ∂n][A-Z]/Δ¡4 "{active}"'
  114. #
  115. #
  116. addmenu ∂
  117.     "Localize" ∂
  118.         "Check Quality/6" ∂
  119.             'RezDeting'
  120. #
  121. #
  122. addmenu ∂
  123.     "Localize" ∂
  124.         "Extract Messages/7" ∂
  125.             'set Rfile `GetFileName -m "Select a resource file"`;∂
  126.              Export Rfile;∂
  127.              messages'
  128.