![]() ![]() |
|||||||||
![]() |
|||||||||
Dear Alchemy Technology User, | |||||||||
![]() |
In this edition of Techbytes, I concentrate on developing your automation using ezScript, Catalyst's script. We'll look at everything new in Catalyst 11 and an advanced automation sample using JodID to work with different settings for each language managed. Remember all the previous released articles are available on our website, in the Support section. Use your Support Centre login to access all the past articles along with other resources available to our premium support members. As always, don't hesitate to let me know if there is any topic you would like covered in this TechBytes newsletter. Cyril Vallin |
||||||||
Planning Catalyst 12
I welcome your feedback on features you really would love to see in your favourite localisation tool. I will be liaising with the development team when discussing the best feature enhancements to include in this next version of Catalyst. LocWorld Alchemy Software will be attending LocWorld in our own city, Dublin (Ireland). I will certainly be attending our booth and I hope to meet many of you there. LocWorld31 in Dublin will be on the 8th -10th of June 2016.
With managing many different languages in your localisation project, it will become necessary to allow for different settings to apply for some individual languages. Or you may want to run several ezScript commands at the same time while using multiple licenses distributed by an Alchemy Network License Manager (ANLM). With issuing a JobID, a user can load a Catalyst user profile ( Catalyst settings) applicable only for any ezScript command using that jobID.
Sample scripts with JobIDs This sample ezScript automation, using batch files, is designed to give you a basis to work from or explore the concept of using JobIDs. It manages 3 languages each running with indidividual settings. Once downloaded, unzip the contents. First set the Catalyst paths in ./ezScript/SETPaths.bat for the script to run. CatalystEXE is the path to the Catalyst installation folder.
The script can then be ran, calling either RunAll_start.bat or RunAll_Call.bat in a command prompt window. Both scripts will run the 01_FrenchJobIDs.bat, 02_ItalianJobIDs.bat and 03_JapaneseJobIDs.bat files, performing the following steps:
Using RunAll_Call.bat the script runs each of the 3 languages batch files one after the other, waiting for the previous to finish before starting the next. This model should be used if only one license file is available to run one instance of the Catalyst program. The RunALL_Start.bat, using the DOS 'Start' command launches each of the 3 language batch files at the same time, launching 3 separate instances of the Catalyst program using 3 licenses (which need to be distributed by an ANLM server). As you can imagine, running the scripts in parallel the completion time can be expected to be around 50% faster. I invite you to explore and test this sample to see how automation can be implemented with Catalyst. You will also find some of the new ezScript commands and options added in Catalyst 11 which enhance the functionality, such as the /write or ezLogFile: options.
Important update to JobIDs With the release of Catalyst 11 SP2, it is now possible to use text as a JobID. Any prior build only accepts digits as JobID.
|
|||||||||
New ezScript commands and options introduced in Catalyst 11 Many updates have been added to ezScript in Catalyst 11 (up to SP2 release). I felt it would be worth highlighting those new options because you may find it useful to improve your existing process. Write the ezScript command to the log file Probably the most important update as it affects all ezScripts commands. Particularly useful when developing your automation as it makes it easier to debug individual commands within the log. /write The command line which has been processed by Catalyst will be written into the ezScript batch log file. Example: Catalyst /M John TTKName:"C:/projectA/Master.ttk" FileListFile:"C:/projectA/Filelist.txt" /write
Specify log file Equally important to the /write switch, this option is particularly useful if using JobID to manage different settings for different languages. ezLogFile: Define where to write or append the log file with the results of each Catalyst ezScript command. Example: Catalyst /M John TTKName:"C:/projectA/Master.ttk" FileListFile:"C:/projectA/Filelist.txt" ezLogFile:"C:/projectA/log/ezLogFile.txt" /write
Use language codes instead of full name While creating a TTK project or changing the project's languages, you may use the language code instead of spelling out the entire language name (which is case sensitive). For example, instead of using the language name "Serbian (Cyrillic, Serbia and Montenegro (Former))" in this exact syntax, you could use the language code sr-Cyrl-CS. Catalyst /M John TTKName:"C:\projectA\created.ttk" "C:\ProjectA\demo.dll" SourceLang:"en-US" TargetLang:"sr-Cyrl-CS" ezLogFile:"C:\ProjectA\log.txt" The list of languages can be found in the ezScript reference (FILE > Help > ezScript reference) under the Language Codes page. They are case sensitive.
Find and Replace Find and replace text in your TTK projects using the search settings saved to your profile. For example, you can set the search to use Regular expression by saving the search settings to a profile (.ini file) which you load before your search. /FIND Example: Catalyst /C "C:\Profiles\Find_regex.ini" /load ezlogfile:"C:\ProjectA\Find_Replace.log" Catalyst /FIND TTKName:"C:\ProjectA\created.ttk" Find:"([A-Za-z])" Replace:"\1\\'\2" ezlogfile:"C:\ProjectA\Find_Replace.log" /write
Revert Objects Reverting in Catalyst enables the user to revert Translations, Coordinates or Metadata (Locks, memos, etc...). Using the settings from the profile, you may revert in the same way with ezScript. /Revert Example: Catalyst /C "C:\Profiles\revertoptions.ini" /LOAD ezlogfile:"C:\ProjectA\Find_Replace.log" Catalyst /Revert TTKName:"C:\ProjectA\created.ttk" ezlogfile:"C:\ProjectA\Find_Replace.log" /write
Change dialog font for all dialogs A new switch was added to the change dialog font ezScript command to allow changing the font for ALL dialogs found within the TTK project. /all Example: Catalyst /F TTKName:"C:\ProjectA\created_JA.ttk" /All FontName:"Segoe UI" 9
TM Penalty setting added to Leverage and Analysis Experts With Catalyst 11 was introduced the ability to apply a penalty to any TM. When a single TM is referenced in the command, a penalty can be applied with a value between 1 and 100 (in percent) using the following switch. Penalty: Example: Catalyst /L John "C:\ProjectA\TM.ttk" "C:\ProjectA\created.ttk" Penalty:5 ezlogfile:"C:\ProjectA\Find_Replace.log" /write
Layout Manager This Expert available in the Developer/Pro edition can now be applied via ezScript. It uses the last settings used in the interface (i.e. settings in registry) /Layout Example: Catalyst /Layout "C:\ProjectA\created.ttk"
Import/Export to XLIFF Also a new feature available in Catalyst 11 Developer/Pro, your project can be exported to an XLIFF file. And imported back. /XLIFFEXPORT Example: Catalyst /XLIFFEXPORT TTKName:"C:\ProjectA\created.ttk" "C:\ProjectA\XLIFF\out\created.xlf" ezlogfile:"C:\ProjectA\Find_Replace.log" /write Catalyst /XLIFFIMPORT TTKName:"C:\ProjectA\created.ttk" "C:\ProjectA\XLIFF\In\created.xlf" ezlogfile:"C:\ProjectA\Find_Replace.log" /write
Machine Translation available in Leverage Expert The ezScript Leverage command has been updated to include the option to specify an MT as source. Example using Google Translate as the MT source: Catalyst /L John "GenericMT:GoogleTranslate://;;False" "C:\ProjectA\created.ttk" ezlogfile:"C:\ProjectA\Find_Replace.log" /write
Object Types added to profile export The settings found in the Object types of the Leverage, Pseudo translate, Validate, Update and Analysis Experts are exported in the user profile (.ini). This addition enables any of those Experts on ezScript to be restricted to specific objects types. For example, you may untick the "version" object type in your profile in order to avoid the .NET version block found in .NET assemblies from getting Pseudo Translated using that Expert. Since translating this version block in .NET assemblies would result in breaking the assembly.
|
|||||||||
Checking Catalyst.exe's version in your automation Some of you extensively using ezScript in your build automation have asked if it was possible to run different ezScript commands depending on the version of Catalyst installed on the machine. For example, between Catalyst 11 Sp1 and Sp2 releases, the language name for “Chinese (Simplified, PRC)” was changed to “Chinese (Simplified, People's Republic of China)” to reflect the changes made by Microsoft to their language list. Using batch files for setting up automation, we can check the version number of the installed Catalyst.exe and perform a different task dependant on the returned value. Using this utility you output the version number from the Catalyst.exe to a file and then read it back into a variable:
Remove the last 2 digits from the build number, as these never increment:
Then depending on the value of that CatalystBuildNo, you can execute either the SP1 command line task or SP2:
In our example with the update Chinese language name, we are able to set the target language to “Chinese (Simplified, PRC)” for SP1 or “Chinese (Simplified, People's Republic of China)” for SP2.
|
|||||||||
Conclusion
Thanks for taking the time to read this instalment of TechBytes. It has been fun to write and I hope you found some if not all of it beneficial. We always welcome new article ideas, so if there is a feature you feel works really well and is worth mentioning, or indeed if clarification on a particular topic would help you, please let me know so together we can make TechBytes as useful as possible for everyone. My best wishes |
|||||||||