localize.bat 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. @echo off
  2. rem
  3. rem Licensed Materials - Property of IBM
  4. rem IBM Cognos Products: localizationkit
  5. rem © Copyright IBM Corp. 2005, 2020
  6. rem US Government Users Restricted Rights - Use, duplication or disclosure restricted
  7. rem by GSA ADP Schedule Contract with IBM Corp.
  8. rem
  9. rem ---------------------------------------------------------------------------
  10. rem Script (Windows) to invoke jre and launch localization kit.
  11. rem
  12. rem J_HOME is the location of the Java RE installation
  13. rem J_OPTS are the Java options to be passed into the JAVA VM (optional)
  14. rem ---------------------------------------------------------------------------
  15. rem ----- Save Environment Variables That May Change --------------------------
  16. set _CLASSPATH=%CLASSPATH%
  17. set _CP=%CP%
  18. rem ------------------- Set JRE Home -----------------------------------------
  19. if "%JAVA_HOME%" == "" set JAVA_HOME=..\jre
  20. if exist %JAVA_HOME%\bin\java.exe goto okJRE
  21. echo Could not find jre in your environment.
  22. echo This environment variable JAVA_HOME is needed to run this program
  23. echo Hint:Please use Progra~1 instead of "Program Files" in your JAVA_HOME path
  24. goto cleanup
  25. :okJRE
  26. set J_HOME=%JAVA_HOME%
  27. set J_OPTS=-Xmx768m
  28. rem ----- Prepare Appropriate Java Execution Commands -------------------------
  29. set _RUNJAVA=%J_HOME%\bin\java
  30. rem ----------- Set Up The Runtime Classpath ----------------------------------------
  31. rem set CP for general processing
  32. set CP=.;localizationkit.jar;localizationkitExt.jar;dom4j-2.1.1.jar;jaxen-1.1.1.jar;jdxslt.jar
  33. rem ----- Execute The Requested Command ---------------------------------------
  34. if "%1" == "sync" goto lockit_sync
  35. if "%1" == "validate" goto lockit_validate
  36. if "%1" == "generate" goto lockit_generate
  37. if "%1" == "clean" goto lockit_clean
  38. if "%1" == "genbrandldkspec" goto lockit_genbrandldkspec
  39. echo Unknown command parameter is specified
  40. echo Usage: localize command
  41. echo Where command could be one of the following
  42. echo genbrandldkspec
  43. echo generate a brand_ldkspec.xml file to identify brandable resources only
  44. echo sync
  45. echo synchronzize XML message files
  46. echo validate
  47. echo validate XML message files
  48. echo generate
  49. echo generate target message files
  50. echo clean
  51. echo remove translate attribute from message files in synchronization directory
  52. goto cleanup
  53. :lockit_sync
  54. :lockit_validate
  55. :lockit_clean
  56. :lockit_genbrandldkspec
  57. set CLASSPATH=%CP%
  58. %_RUNJAVA% %J_OPTS% com.cognos.localizationkit.CCLMsgLocalizer %1
  59. goto cleanup
  60. :lockit_generate
  61. echo Generating is called
  62. set CLASSPATH=%CP%
  63. %_RUNJAVA% %J_OPTS% com.cognos.localizationkit.CCLMsgLocalizer %1
  64. goto cleanup
  65. rem ----- Restore Environment Variables ---------------------------------------
  66. :cleanup
  67. set CLASSPATH=%_CLASSPATH%
  68. set _CLASSPATH=
  69. set CP=%_CP%
  70. set _RUNJAVA=
  71. set J_HOME=
  72. :finish
  73. pause