Appendix 3 - How to translate the Crystal Master
|Previous | Direct link to this topic|
This appendix describes how to translate Crystal Report document masters from Boyum IT.
You will need to have the Crystal Report Designer installed. Furthermore you need to turn on Multilanguage support for your database in order to test your translations.
How to translate
All translation of Crystal Masters is done in Crystal Report Formulas, so there is no requirement for external translation files or databases. This will give a sample on how to make the translation.
First locate the crystal report to translate and open it in the Crystal Report Designer:
As mentioned, all translation are done via formulas (No text are manually entered in the design surface) so let us focus on the Formulas fields in the document.
Before we translate lets, quickly look at how the language to use is determined. If you look at the end of the Formulas list there is a Formula called “X_Language” and this is the one that controls the language.
Let’s have a look at the formula.
The formula work on SAP internal Id’s of languages, 1, 3, 5, 8 etc… And translate it into the more human friendly name “HE”, “EN”, “PL” etc. We use a switch case to determine this and this also select the default language which in this case is English.
Translation the Title_ formula fields
Now we know enough to translate so let’s look at a few translation examples:
We start off with a simple sample of translating the Title_Date… The translations already contains one or more translation. In our sample here we already support English, Danish, Norwegian, German, Spanish and Finnish and for this sample we wish to support Dutch (NL).
Here is the formula without the new translation. We uses a switch to base on the X_Language to set the right translation. That means that if Language is ‘DK’ then it result ‘Bogføringsdato’, while if the Language is ‘FI’ then we get ‘Tositepvm’… If the current language is not represented it will default to the default language English.
Now let’s add Dutch as an example. From the X_Language we know that Dutch have code ‘NL’ so adding is quite simple:
This formula is now translated is and we can move on to the next.
Not all formulas are quite as simple as this as it depends on BP type, document etc. In such cases there a multiple nested Switches but the process is the same. Here is a sample of Title_BP.
And here is it after Dutch is added:
The most advanced sample is the Title of the document. It is a long formula but the approach is as simple as the two above
Should you have any question regarding translations then please contact email@example.com