This post provides guidelines for configuration, system sizing and capacity planning when deploying Caché 2015 and later on a VMware ESXi 5.5 and later environment.
CLM is a tool for localization/internationalization/adding multi-language support to a project based on InterSystems Caché.
Imagine that you have a ready project where all the content is in Russian, and you need to add an English localization to it. You wrap all your strings into resources, translate them into English and call the necessary resource for Russian or English when necessary. Nothing tricky, if you think about it. But what if there are lots of strings and there are mistakes in Russian (or English)? What if you need to localize in more than one language – say, ten? This is exactly the kind of project where you should use CLM. It will help you localize the entire content of your project into the necessary language and retain the possibility to correct entries.
CLM allows you to do the following:
Add a new localization.
Delete a localization.
Export a localization.
Import a localization.
View two tables at a time.
Conveniently switch between spaces.
Check spelling.
Let’s “look under the hood” now
Caché has a standard approach to implementing I11N using the $$$TEXT macros:
$$$TEXT("Text", "Domain", "Language")
where:
Text — the text to be used for localization in the future.
Domain — modules in your applications.
Language — the language of "Text".
If you use $$$TEXT in COS code, data is added to the ^CacheMsg global during class compilation. And this is the global that CLM works with.
In ^CacheMsg, everything is identical to $$$TEXT, you just add "ID" as the text hash.
^CacheMsg("Domain", "Language", "ID") = "Text"
If you are using CSP, then the use of $$$TEXT in CSP will look as follows:
<csp:text id="14218931" domain="HOLEFOODS">Date Of Sale</csp:text>
Installation
First of all, you need to download the Installed class from GitHub and import it to any convenient space in Caché. I will use the USER space. Once done, open the terminal and switch to the USER space. To start the installation, enter the following command in the terminal:
USER> do ##class(CLM.Installer).setup()
Installation process:
You can make sure the application is installed correctly by following this link: http://localhost:57772/csp/clm/index.csp (localhost:57772 — the path to your server).
Settings
CLM uses Yandex to perform the translation. You will now need to obtain a Yandex API key to let it work. It's free, but needs registration.
Let’s now deal with spellchecking. CLM uses Caché Native Access for SpellCheck implementation. CNA was written for calling external functions from dynamic libraries, such as .dll or .so. SpellCheck works with the Hunspell library and needs two files for spellchecking. The first file is a dictionary containing words, the second one contains affixes and defines the meaning of special marks (flags) in the dictionary.
How words are checked:
All words are packed from CLM and sent to Hunspell via CNA, where CNA converts them into a language that Hunspell understands. Hunspell checks every word, finds the root form and all possible variations, and returns the result. But where do we get all these dictionaries and libraries?
The entire configuration process boils down to entering the paths to everything you got before. Open CLM in a browser. There is a “Set Paths” button in the upper right corner. Click it and you’ll see the next window. Use it to enter the required paths.