/* makenls - build AE national language support files. */ Signal On NoValue Signal On Error Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs' Call SysLoadFuncs Call SetLocal nv_rc = SetUpPaths() If nv_rc <> 0 Then Exit rc nv_build_dir = Value('NV_BUILD',,'OS2ENVIRONMENT') nv_rc = SysMkDir( nv_build_dir ) Parse Upper Arg which ae_build_dir_i18n = nv_build_dir||'\ae_i18n' nv_rc = SysMkDir( ae_build_dir_i18n ) /* copy text files */ 'copy Copying.txt' ae_build_dir_i18n 'copy readme.txt' ae_build_dir_i18n If which == '' | which == 'FR' Then 'copy lisezmoi.txt' ae_build_dir_i18n If which == '' | which == 'ES' Then 'copy readme_es.txt' ae_build_dir_i18n If which == '' | which == 'RU' Then 'copy readme_ru.txt' ae_build_dir_i18n /* copy language files */ Call SysFileTree '*.lng', 'sources.', 'FO' Do i = 1 to sources.0 nlsfile = Filespec('NAME', sources.i ) Parse Upper var nlsfile . '_' lng '.LNG' . If lng == '' | lng == 'EN' Then Iterate If which <> '' & lng <> which Then Iterate 'copy' nlsfile ae_build_dir_i18n End Drop sources. 'copy ae.ipf' ae_build_dir_i18n /* compile the ipf files */ Call SysFileTree '*.ipf', 'sources.', 'FO' Do i = 1 to sources.0 ipf = Filespec('NAME', sources.i ) Parse Upper var ipf prefix '_' lng '.IPF' . If lng == '' Then Do nlsfile = 'ae' lng = 'EN' End Else If lng == 'IT.BETA4' Then Iterate Else nlsfile = Translate( prefix'_'lng, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') If which <> '' & lng <> which Then Iterate If lng == 'RU' Then parms = '-D:007 -C:866' Else If lng == 'JA' Then parms = '-D:081 -C:932' Else If lng == 'ZH_TW' Then parms = '-D:088 -C:950' Else parms = '-D:001 -C:850' 'ipfc' ipf ae_build_dir_i18n'\'nlsfile'.hlp' parms End Call EndLocal Exit 0 /* -------------------------------------------------------------------------- * * SetUpPaths * * -------------------------------------------------------------------------- */ SetUpPaths: PROCEDURE EXPOSE g. g.!env_inc = Stream('..\env.inc', 'C', 'QUERY EXISTS') g.!nv_dev = GetVar('NV_DEV') If g.!nv_dev == '' Then Do Say '%NV_DEV% environment variable is not set.' Say 'Please set %NV_DEV% to the top-level path of the development tree.' Return 1 End '@SET NV_BUILD='g.!nv_dev'\build' Return 0 /* -------------------------------------------------------------------------- * * GetVar * * -------------------------------------------------------------------------- */ GetVar: Procedure Expose g. Parse Upper Arg env_var val = Value( env_var,, 'OS2ENVIRONMENT') If val == '' Then Do if g.!env_inc <> '' Then Do match.0 = 0 mstring = 'SET' env_var'=' Call SysFileSearch mstring, g.!env_inc, 'match.' If match.0 > 0 Then Do i = 1 to match.0 match.i = Translate( Strip( match.i )) If Left( match.i, Length( mstring )) == mstring Then Do Parse Var match.i '='val Leave End End End End Return val /* -------------------------------------------------------------------------- * * Condition Handlers * * -------------------------------------------------------------------------- */ NoValue: Say Call Lineout 'STDERR:', Right( sigl, 6 ) '+++' STRIP( SOURCELINE( sigl )) Call Lineout 'STDERR:', Right( sigl, 6 ) '+++ Non-initialized variable.' Say Exit sigl Error: Say Call Lineout 'STDERR:', '+++ Error:' Condition('D') Say Exit sigl