English:

The Free and Open Productivity Suite
New: Apache OpenOffice 4.1.0 released!

Understanding the lng files



Some content of the scp projects has to be translated in the supported languages. This is important for localized directory names, or text output of some basic scripts. This translation happens with the help of the so called lng files, which are automatically included into the translation process. These files must have the same names as the scp files, in which the translated string is needed, but its extensions are .lng. One example shows this simple behaviour:

Module gid_Module_Prg_Calc_Bin
MOD_NAME_DESC ( MODULE_PRG_CALC_BIN );
ParentID = gid_Module_Prg_Calc;
Default = YES;
Minimal = YES;
Files = (gid_File_Exe_Scalc,gid_File_Lib_Calc,gid_File_Lib_Sc,gid_File_Res_Sc);
End

As you can see, this is the definition of a module block. In the user defined installation, there is a user interface for selecting the modules. This cotains a name and a description of each module. And of course these have to be localized. In the module definition you see the line:

MOD_NAME_DESC ( MODULE_PRG_CALC_BIN );

MOD_NAME_DESC is a macro defined in macros.inc. There you find:

#define MOD_NAME_DESC(id) \
ALL_LANG(Name,STR_NAME_##id); \
ALL_LANG(Description,STR_DESC_##id)

Therefore this can be resolved to the two macros:

ALL_LANG(Name,STR_NAME_ MODULE_PRG_CALC_BIN )
ALL_LANG(Description,STR_DESC_ MODULE_PRG_CALC_BIN )


And ALL_LANG is also defined in macros.inc, but this is not important yet. Important are the two strings STR_NAME_ MODULE_PRG_CALC_BIN and STR_DESC_ MODULE_PRG_CALC_BIN, which exist in the scp file, in which the module gid_Module_Prg_Calc_Bin is defined. For this file xyz.scp there has to be also a files xyz.lng. The filenames have to be identical, without the extensions. Therefore in the lng file, we find the following two entries:

[STR_NAME_MODULE_PRG_CALC_BIN]
49 = "Programmodul"
01 = "Program Module"
07 = "Ïðîãðàììíûé ìîäóëü"
55 = "Programmodul"
37 = "Módulo del programa"
03 = "Módulo do programa"
30 = "ËåéôïõñãéêÞ ìïíÜäá ðñïãñÜììáôïò"
31 = "Programma module"
33 = "Module"
34 = "Módulo del programa"
35 = "Ohjelmamoduuli"
39 = "Modulo programma"
45 = "Programmodul"
46 = "Programmodul"
48 = "Modu³ programu"
81 = "ÌßÛ¸Þ×ÑÓ¼Þ­°Ù"
82 = "ÇÁ·Î±×·¥ ¸ðµâ"
86 = "³ÌÐòÄ£¿é"
88 = "µ{¦¡¼Ò¶ô"
90 = "Program modülü"
96 = "æÍÏÉ ÈÑäÇãÌ äãØíÉ"

[STR_DESC_MODULE_PRG_CALC_BIN]
49 = "Die Anwendung %PRODUCTNAME Calc"
01 = "The application %PRODUCTNAME Calc"
07 = "Ïðèëîæåíèå %PRODUCTNAME Calc"
55 = "Die Anwendung %PRODUCTNAME Calc"
37 = "La aplicación %PRODUCTNAME Calc"
03 = "A aplicação %PRODUCTNAME Calc"
30 = "Ç åöáñìïãÞ %PRODUCTNAME Calc"
31 = "De applicatie %PRODUCTNAME Calc"
33 = "L'application %PRODUCTNAME Calc"
34 = "La aplicación %PRODUCTNAME Calc"
35 = "Sovellus %PRODUCTNAME Calc"
39 = "L'applicazione %PRODUCTNAME Calc"
45 = "Applikationen %PRODUCTNAME Calc"
46 = "Tillämpningen %PRODUCTNAME Calc"
48 = "Zastosowanie %PRODUCTNAME Calc"
81 = "%PRODUCTNAME Calc ±Ìßع°¼®Ý"
82 = "%PRODUCTNAME Calc ÀÀ¿ëÇÁ·Î±×·¥"
86 = "%PRODUCTNAME Calc Ó¦ÓóÌÐò"
88 = "À³¥Îµ{¦¡ %PRODUCTNAME Calc"
90 = "%PRODUCTNAME Calc uygulamasý"
96 = "ÇáÊØÈíÞ %PRODUCTNAME Calc"

The names and descriptions are translated in any supported language. Therefore the scp linker will create a module definition, which looks like:

Module gid_Module_Prg_Calc_Bin
ParentID = gid_Module_Prg_Calc;
Minimal = YES;
Default = YES;
Files = (gid_File_Exe_Scalc, gid_File_Lib_Calc, gid_File_Lib_Sc, gid_File_Res_Sc);
ConfigurationItems = ( gid_Configurationitem_Soffice_Apps_Scalc5);
FolderItems = (gid_Folderitem_Scalc);
Name (03) = "Módulo do programa";
Description (03) = "A aplicação %PRODUCTNAME Calc";
Name (07) = "Ïðîãðàììíûé ìîäóëü";
Description (07) = "Ïðèëîæåíèå %PRODUCTNAME Calc";
Name (30) = "ËåéôïõñãéêÞ ìïíÜäá ðñïãñÜììáôïò";
Description (30) = "Ç åöáñìïãÞ %PRODUCTNAME Calc";
Name (31) = "Programma module";
Description (31) = "De applicatie %PRODUCTNAME Calc";
Name (33) = "Module";
Description (33) = "L'application %PRODUCTNAME Calc";
Name (34) = "Módulo del programa";
Description (34) = "La aplicación %PRODUCTNAME Calc";
Name (35) = "Ohjelmamoduuli";
Description (35) = "Sovellus %PRODUCTNAME Calc";
Name (37) = "Módulo del programa";
Description (37) = "La aplicación %PRODUCTNAME Calc";
Name (39) = "Modulo programma";
Description (39) = "L'applicazione %PRODUCTNAME Calc";
Name (45) = "Programmodul";
Description (45) = "Applikationen %PRODUCTNAME Calc";
Name (46) = "Programmodul";
Description (46) = "Tillämpningen %PRODUCTNAME Calc";
Name (48) = "Modu³ programu";
Description (48) = "Zastosowanie %PRODUCTNAME Calc";
Name (49) = "Programmodul";
Description (49) = "Die Anwendung %PRODUCTNAME Calc";
Name (81) = "ÌßÛ¸Þ×ÑÓ¼Þ­°Ù";
Description (81) = "%PRODUCTNAME Calc ±Ìßع°¼®Ý";
Name (82) = "ÇÁ·Î±×·¥ ¸ðµâ";
Description (82) = "%PRODUCTNAME Calc ÀÀ¿ëÇÁ·Î±×·¥";
Name (86) = "³ÌÐòÄ£¿é";
Description (86) = "%PRODUCTNAME Calc Ó¦ÓóÌÐò";
Name (88) = "µ{¦¡¼Ò¶ô";
Description (88) = "À³¥Îµ{¦¡ %PRODUCTNAME Calc";
Name (90) = "Program modülü";
Description (90) = "%PRODUCTNAME Calc uygulamasý";
Name (96) = "æÍÏÉ ÈÑäÇãÌ äãØíÉ";
Description (96) = "ÇáÊØÈíÞ %PRODUCTNAME Calc";
Name (99) = "STR_NAME_MODULE_PRG_CALC_BIN";
Description (99) = "STR_DESC_MODULE_PRG_CALC_BIN";
Name (01) = "Program Module";
Description (01) = "The application %PRODUCTNAME Calc";
End

You see, that most of the module definition is translation stuff. Finally it is the scpzip that creates installation sets for special languages. Therefore the final result for an english installation set looks like:

Module gid_Module_Prg_Calc_Bin
ParentID = gid_Module_Prg_Calc;
Name = "Program Module";
Description = "The application %PRODUCTNAME Calc";
Minimal = YES;
Default = YES;
Files = (gid_File_Exe_Scalc, gid_File_Lib_Calc, gid_File_Lib_Sc, gid_File_Res_Sc);
End

This module definition you can finally find in the setup script in the installation set next to the setup.



Apache Software Foundation

Copyright & License | Privacy | Website Feedback | Contact Us | Donate | Thanks

Apache, the Apache feather logo, and OpenOffice are trademarks of The Apache Software Foundation. OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.