Soluling home   Document home

Output Files

Output Files

A source is a file or database you add to the Soluling project to localize it. Another name of the source is the original file or original database. Soluling reads the sources and extracts items to be translated. Once extracted, the items become visible in the project, and they can be translated. An opposite operation from reading is writing, where Soluling creates localized sources. Soluling never writes localized items back to the original files except in the case of database localization. Instead, it creates copies of the original file into output directories. Each output file is similar to the original, except the translated items have been replaced with the localized values.

Localized files

A simplest way to localize is just to create localized files, one for each language. Let's have an example. We have a simple XML file, Simple.xml:

<?xml version="1.0"?>
<simple>
  <product>Skim milk</product>
  <price>1.15</price>
</simple>

It contains one string, "Skim milk", that should be localized. If you add the above file into the Soluling project, it by default extracts "Skim milk" and as a result, you will have one row in the project. If you add the Finnish language into the project, enter Finnish translation "Rasvaton maito", and finally click Home | Build to create the localized file, Soluling will create the following output file.

<?xml version="1.0"?>
<simple>
  <product>Rasvaton maito</product>
  <price>1.15</price>
</simple>

This is the Finnish version of Simple.xml. It will be created into a fi subdirectory. If the original file is C:\MyFiles\Simple.xml then by default, the Finnish output file will be C:\MyFiles\fi\Simple.xml. You can change the output directory and file name by using the Output sheet of the source dialog.

All sources except server databases support localized files, and in fact, if the original file does not contain multiple languages, then the default output file will be localized files. Most sources only support localized files, so you can not make Soluling create anything else by localized files. However, some sources support multilingual and/or language files.

Multilingual file

Some file formats can store the same item in several languages. Such a file is a multilingual file. A multilingual Simple.xml would look like this.

<?xml version="1.0"?>
<simple>
  <product>Skim milk</product>
  <product xml:lang="fi">Rasvaton maito</product>
  <product xml:lang="de">Magermilch</product>
  <product xml:lang="ja">無脂肪</product>
  <price>1.15</price>
</simple>

As you can see, the product element has been replicated in three languages: Finnish, German, and Japanese. The language version of each product element has a language id included into xml:lang attribute. The following list contains the file formats that can store items in several languages:

Delphi Selected resources such as form and string resources are written multiple times. Once in each language.
Visual C++ Selected resources such as dialogs, menus, and string resources are written multiple times. Once in each language.
XML Localized elements are multiplied for each target language.
TMX Localized elements are multiplied for each target language.
XLIFF  
Databases Either localized rows are added, localized fields are populated, or localized tables are populated.

If you open the Output sheet of these sources, then you can choose what kind of output files are created.

The above image shows a source where the localized file is turned on, but multilingual are turned off. You can turn either of them on or even both on. If both are on then, Soluling will create localized files and one multilingual file as output files. The multilingual file will be created into the all subdirectory.

Languages files

A language file is similar to a localized file, except it does not contain all original files. A resource file contains only resources and in most often, only those resources that differ from the original resources. Resource files are used with some applications. For example, Windows applications can use resource-only DLLs that contain localized resources. The application is deployed with the original executable (EXE) and a selected number of amount files (DLL).The following table contains the file formats that can store items in several languages:

.NET Language files are DLL assembly files, and they are often called satellite assembly files.
Delphi Language files are DLL files, and they are often called resource DLL files.
Visual C++ Language files are DLL files, and they are often called resource DLL files.

If you open the Output sheet of these sources, then you can choose what kind of output files are created.

Do not confuse language files with resource files used by almost all application platforms. A resource file is a file you create and edit when writing your software. For example, .RC is a resource source file of a Windows application. .DFM is a resource source file of a Delphi application. .strings is a resource source file of an XCode project. A language file is a compiled file that contains several possible localized resource files.

Embedded file

Using language files gives you extra flexibility when localizing applications. For example, you can set the initial language where your application appears, and you can even change the language on runtime (Delphi, C++Builder). However, you now have several files to deploy. If you still want to have just a single file deployed, use the embedded files options. It first creates the language files and then embeds them as a custom resource inside your application file. When the application starts for the first time Soluling code in the application extracts the resource DLL data as resource DLL files.

Delphi Soluling embeds the resource DLLs inside your application, and you can use TNtBase.ExtractFiles to extract the resource DLL files.
Visual C++ Soluling embeds the resource DLLs inside your application, but you have to write your code to extract the resource DLL files.

If you open the Output sheet of these sources, then you can choose what kind of output files are created.

When building, Soluling first creates the resource DLL files into the output directory, copies the original application file to the same output directory, and finally adds all resource DLL files inside the application file as a custom SOLULING resource. When applications start for the first time, the Soluling code in your application extracts the resource DLL files and saves them on the disk. This makes it possible to make a single file deployment.