Tech Mail

February 2016

News and Updates | Using JobIDs in your ezScript automation | New ezScript commands and options introduced in Catalyst 11
Checking Catalyst.exe's version in your automation

 

Dear Alchemy Technology User,


Hello from the Emerald isle (Ireland), my name is Cyril Vallin, I am the Product Support Manager at Alchemy Software Development.  This TechBytes quarterly Email is to share the experiences from our users so that we can all benefit and enhance our use of Alchemy technology. In Support we sometimes see similar topics being queried and I hope that sharing this knowledge will promote advancement amongst our users.

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
Product Support Manager @ Alchemy Software Development


 

News and Updates

Planning Catalyst 12


The development of Catalyst 12 has started!

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.

 

 
Using JobIDs in your ezScript automation

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.

Why use JobIDs

Using EzScript commands, a Catalyst user can automate tasks such as Creating a TTK projects, Leveraging translations and Extracting translated files any number of times for all the languages supported in his/her Localisation project.

Those ezScript commands are integrated within an automation script one after the other until all steps for all languages are completed.

Separating and grouping the ezScript commands for each language to run in parallel becomes the next logical step to improve the automation time.

However, running several ezScript processes in parallel can lead to potential problems when loading different User profile settings for each language. This is because each iteration of an ezScript command will run an instance of Catalyst on the machine sharing the same registry entry (which holds the User profile settings).

So for example, while running a Japanese Pseudo Translate command using ezScript, another command is issued in parallel to load a user profile setup for French pseudo translations. The result will be that French Pseudo translations will be applied in the project expecting in Japanese.

Using JobID, you can setup individual language flows initiated from a master batch or script. Each flow using a unique JobID with separate settings held in registry.

  Running ezScript in parallel will require several Catalyst licenses to be available. This is possible with using ANLM (Alchemy Network License Manager) which can distribute multiple licenses across your network.

 

The diagram at top right represents an automation script in which the master process triggers 3 sub processes in parallel, using 3 Catalyst licenses. Each sub process manages one language. It loads a separate User profile, creates a TTK project, Leverage from a TM and extracts the translated files.
With using JobIDs, although the 3 ezScript flows are run in parallel (i.e. simultaneously) there is no interference with each other. Each profile settings are kept independent.

If for example the JobIDs 171, 172 and 173 were used, the registry would look like the screenshot on the right once the JobIDs are started.

The entries are then discarded once the JobID is ended. Leaving the default settings (highlighted in light blue) untouched.

 

 

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.

Download

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.
Proj_Folder is the path to the folder you extracted this sample.

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:

  1. Making the TMs through Cleanup
  2. Making Language TTK files
  3. Setting the Target Language in the TTK
  4. Leveraging the TTK from the Cleaned Up AlchemyTM TM file
  5. PseudoTranslate the remainder of the TTK (new / modified strings)
  6. Validating the TTK files

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.
This will help to debug your command if something is not behaving as expected.

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.
If this option is not specified in the ezScript command or is invalid, the default log file (ezScriptBatchLog.txt in the Public location) is used.

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 
/XLIFFIMPORT 

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.
This solution was implemented in-house at Alchemy Software, using Microsoft Utility SigCheck: https://technet.microsoft.com/en-ie/sysinternals/bb897441.aspx

Using this utility you output the version number from the Catalyst.exe to a file and then read it back into a variable:
Download this sample here.

"%SigCheckEXE%" -n "%CatalystEXE%">BuildNumber.txt
SET /P BuildNumber=<BuildNumber.txt
DEL BuildNumber.txt

Remove the last 2 digits from the build number, as these never increment:

SET CatalystBuildNo=%BuildNumber:~0,-2%

Then depending on the value of that CatalystBuildNo, you can execute either the SP1 command line task or SP2:

REM Only execute if Greater or Equal >= to a specified Catalyst version
IF %CatalystBuildNo% GEQ 11.2.209 (
                GOTO SP2
) ELSE (
                GOTO SP1
)

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
Cyril Vallin