<< Click to Display Table of Contents > 

SAMLight Manual > How to > Customize Program / Language > Customize Language > Translation per XML > Creating a new translation

Creating a new translation
Previous pageReturn to chapter overviewNext page

To create a new translation, the steps you need to do are:

1. Define the resource file.

2. Export a list of strings which can be translated. Do the translation.

3. Import the list with the translated strings into SAMLight.

 

1. Define the resource file:
With every SAMLight version, you get a few resource setting files, which are stored in the directory <SCAPS>\system\ and are named as sc_resource_sc_LANGUAGE. To start translating SAMLight into your language using XML tables, look for a file named sc_resource_sc_default.sam in the system directory and rename it, for example putting in the language you are translating instead of "default". The name of your file may look like sc_resource_sc_mylanguage. This step is important, because every SAMLight update overwrites all standard resource files including the default file, which will be continuously updated by SCAPS with all new functionality. However, your renamed resource file will not be changed.

resource_dialog3

Figure 490: Resource Editor

1.Close all SAM based applications, check it in the task manager.

2.Start sc_setup.exe from folder <SCAPS>\tools\.

3.Click on the menu Resource.

4.Select Unicode and don't choose ,Available languages' (It doesn't matter which available language you choose).

5.Enter the name of your new resource file e.g. ,mylanguage'.

6.Click ,New language'. This creates a new file in folder <SCAPS>\system, e.g.,\sc_resource_sc_mylanguage_uc.sam'.

7.Close sc_setup.exe.

 

 

2. Export a list of strings which can be translated.

Start SAMLight with the command line parameter -export_language (or /export_language) which will generate a file named e.g.,sc_resource_sc_mylanguage_uc.xml' in the folder <SCAPS>\reportfiles, then close SAMLight. This XML file contains all the strings that are available for the translation. It is strongly recommended to backup this resource-XML file. Then, you can edit the "Translated" and "Visibility" columns using any .xml file redactor (for example Microsoft Excel). Do not change any other columns!

Initial Export

By default you will get an .xml file with English strings with an empty translation column. After having filled the translation column, if you want to get an .xml file again with an empty translation column, start SAMLight with two command line parameters: -export_language -initial_export. After the translation is done, go to step 3.

3. Import the list with the translated strings into SAMLight.

After you are done with the translation, save the changes of the sc_resource_sc_mylanguage_uc.xml in the <SAM>\reportfiles repository (don´t forget to make a backup) and start SAMLight with the command line parameter -import_language. SAMLight then ends itself immediately. Start SAMLight again WITHOUT the command line parameter. You will find your newly added translated strings in SAMLight!

 

note

The order of strings in your translation file is important. If you copy the "translated"-column somewhere else and paste it back, make sure that you are pasting in the same XML file version as you have used for copying. The reason behind it is, that if new strings are added to the translation, they will be sorted according to the dialog-IDs and not added at the end of the XML-file. So if you use the newest XML file, but paste the "translated"-column from the older one, all translated names may be shifted.