Menu

Language_Support

Language support in Lima VVA

Lima VVA was developed in the Norwegian language, but has since been translated to English. We are now in the process of adding support for Spanish, with support for more languages to follow, hopefully.



Language selection

Unlike many Windows programs that support multiple languages, there is no language-specific version of Lima VVA. While many programs ship language-specific installation packages, the Lima VVA installation package comes with all of the currently supported languages included.

Also note that there is no option to switch language within Lima VVA. The language shown will depend on the display language setting in the operating system. If you run Lima VVA on a Windows system set to English, Lima VVA will also display in English. If you run Lima VVA on Windows set to Norwegian, you get Norwegian in Lima VVA. And although Windows does not support Faroese as a display language, you can set the Windows regional settings to Faroese, which will enable Faroese in parts of Lima VVA (drawings and reports). If the active Windows display language is not supported by Lima VVA, English will be used as the default language.

Tip: For testing the various languages during development, it is a bit cumbersome to switch the Windows display language, since it requires you to log out and back in again. A convenient solution is to set up additional user accounts on your system, each configured to use a Windows display language you want to test. Then, from the main account, you can run Lima VVA as any of these users by using the command "Run as different user". One simple way to access this command is to hold down Shift while you open the context menu for the Lima VVA program file or shortcut, e.g. by right-clicking.


Resource files

To support multiple languages, Lima VVA uses Windows Resource Files. Any part of the program that may need to be translated to support another language is stored in these files, such as menus, accelerators (shortcut keys), dialog boxes and message strings. The resource files also define cursors, icons and bitmaps used by the program, although these resources are currently language neutral, and one set is hence reused for all languages.

If you want to work on Lima VVA language support, a basic understanding of resource files is beneficial. The Windows documentation linked above is a good starting point to learn more.


Resource file organisation

Unlike many programs that use resource files for language support, Lima VVA does not deploy separate installation packages or DLL files for each language supported. Instead, a single executable file includes the resources for all of the supported languages. When Lima VVA is built from the source code, all of the program's resource files, which contain resources in all languages supported, are compiled and baked into this single executable target file. Lima VVA is a small program, and the amount of data required for the language support is modest in modern terms. So keeping it all-in-one is perfectly fine and makes life simpler.

Each logical module in the Lima VVA source code — such as the vertical alignment — has its own resources stored in a separate resource file. For example, the module for the vertical alignment is defined in "Vertikalkurvatur.h" and "Vertikalkurvatur.cpp", and its resources are defined in "Vertikalkurvatur.rh" and "Vertikalkurvatur.rc". A file with the filename extension ".rh" is called a resource header file and contains symbolic names for the numeric identifiers of the resources in the corresponding resource file, which has the filename extension ".rc". For example, IDS_VK_Vertikalkurvatur is the name for string resource 4400, which is the string "Vertikalkurvatur" in Norwegian and "Vertical alignment" in English.

The resource file for a module includes all the translations to the supported languages. In the old days, each language often needed its own file due to character set issues (a file needed to be encoded in a character set that supported the language), but with the modern Unicode character set, a single file can support all the languages in the world. Lima VVA now uses the Unicode encoding UTF-16LE with BOM (code page 1200 in Windows) for all of its resource files.


Adding support for a new language

Adding support for another language involves two main tasks: (1) translation of terms, and (2) adding translated resources. You can contribute to the translation of Lima VVA into another language just by providing translations of the terms in our [Glossary]. However, to actually add the support for the language in Lima VVA, translated resources have to be added to the resource files. This task comprises a series of subtasks:

  1. Check out the latest version of the Lima VVA source code.
  2. Add copies of all the language-specific resources in all of the resource files.
  3. Translate the copied resources.
  4. Build Lima VVA and test that the translation is correct.
  5. Submit the changes to the source code repository.

The next sections go through these steps in more detail.


Checking out the Lima VVA source code

The Lima VVA project uses Subversion for source code version control. Using a Subversion client, such as the highly recommended TortoiseSVN, you can download any version of the source code into a working copy folder. For example, to check out a read-only working copy of the latest version of Lima VVA into the folder "C:\Lima VVA", use the following Subversion command:

svn checkout svn://svn.code.sf.net/p/lima-vva/code/trunk "C:\Lima VVA"

If you use TortoiseSVN, just create a new empty folder "Lima VVA", right-click it, and then select "SVN Checkout" from the context menu. Specify the "svn:" address as shown above, and press OK. TortoiseSVN will then download the Lima VVA source code into your folder.

After you have checked out a working copy, you can keep it up to date using the Subversion command "svn update" (in TortoiseSVN, right-click the folder, and select "SVN Update" from the context menu).

Registered developers can check out a working copy with permission to commit changes back to the source code repository. For example, to check out the latest version of Lima VVA into the folder "C:\Lima VVA", using HTTPS for authentication and write-access, the command will be:

svn checkout https://svn.code.sf.net/p/lima-vva/code/trunk "C:\Lima VVA"

If you want to register as a developer, contact us in the Discussion forum.


Adding and translating resources using Visual Studio resource editors

Lima VVA is developed using Microsoft Visual Studio. A free Community Edition is available. Visual Studio has built-in resource editors that are fairly easy to use.

For example, to add a copy of the Lima VVA main menu resource in Croatian:

  1. Open "Lima.sln" in Visual Studio.
  2. Open the Resource View (View | Resource View, or Ctrl+Shift+E).
  3. Expand the "Lima VVA" node (Enter, or double-click).
  4. Expand the "Lima.rc | Menu" subnodes.
  5. Select "IDM_LIMA [English]".
  6. Select "Insert copy" from the context menu (right-click, or Shift+F10).
  7. Select "Croatian" from the "Language" field in the dialog box ("Insert Resource Copy").
  8. Open the new resource "IDM_LIMA [Croatian]" (Enter, or double-click).

Now you can edit the menu graphically by navigating the menu and pressing F2 on a menu item to edit the text, as well as its other attributes by opening the Properties pane (select Properties from the context menu, or press Alt+Enter).

Copies of other resources can be made in a similar manner in the Resource View, and then translated interactively in the associated editors.

Note: Resource files are text files, so experts can also manually edit a resource file in a plain text editor, without the use of the resource editors. In particular, the resource file "verinfo.rc" is hand-coded, and you should not edit this file with the Visual Studio resource editor. It should be edited using a text editor (go to the Solution Explorer pane, select the resource file, and select "View Code" from the context menu).

Here are some screenshots showing the resource editors in action, while working on the Spanish translation. The first screenshot shows menu editing. The windows have been arranged so that the English version of the menu can be used as a reference while translating the Spanish version.

Lima VVA menus translation

This next screenshot shows string table editing. The English version of the string table is displayed as a reference, while translating the Spanish version.

Lima VVA strings translation

This next screenshot shows dialog editing. Again, the English version of the dialog box is used as a reference, while translating the Spanish version.

Lima VVA strings translation


Building Lima VVA and testing the translation

Currently, building Lima VVA is for experts only. Lima VVA has some dependencies, which require the set up of a few external libraries (Boost, OWLNext/Owlet, zlib). Instructions on how to set up these libraries, so that you can build Lima VVA yourself, will be provided in due course. Stay tuned!

In the meantime, simply submit your changes, and we'll build a new version for testing.


Submitting the changes

To upload the updated resource files containing your new translated resources, you need write-permission (developer privilege). If you are a registered developer, and you checked out the working copy with write-access (HTTPS protocol), you can submit your changes by using the Subversion command "svn commit" (in TortoiseSVN, right-click the working copy folder, and select "SVN Commit" from the context menu).

If you do not have developer permissions, then you can create a patch file with your changes and submit it in the discussion forum or in a comment to the relevant translation ticket. If you use TortoiseSVN, you can use the command "Create patch" from the context menu on the working copy folder.


Help system

The Lima VVA context-sensitive help system is based on Microsoft HTML Help. Within Lima VVA, you can press F1 to get relevant help on menu items, views and dialog boxes.

Currently, the help topics are only available in English and Norwegian, but Spanish translation is ongoing, with more translations to come, hopefully. You can contribute to this work by translating the individual help topics. The help topics are simple HTML files stored in the source code repository in the subfolder "Help (en)\html" (English translation). These files can be edited in a plain text editor, which only requires some basic knowledge of HTML. Visual Studio includes a powerful HTML editor that lets you edit the HTML files as plain text (with highlighting, code completion, formatting and IntelliSense assistance) or as WYSIWYG.

Note that the HTML files (*.htm) use the Unicode encoding UTF-8 with BOM (code page 65001 in Windows) to support all languages and work well with our tools. So, make sure that you do not change the encoding when you edit these files (usually, text editors will preserve the encoding when saving a file, making this a non-issue).

For more information on how to contribute, see [tickets:#2].

Here is a screenshot showing the use of the Visual Studio HTML editor to translate a Lima VVA help page. Several windows for the same help page in different languages are shown simultaneously as a reference during the translation work.

Lima VVA help translation


Related

Discussion: Alternative language?
Tickets: #2
Tickets: #3
Documentation: Glossary
Documentation: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.