User Tools

Site Tools


translations:translating_kalkules

Translating Kalkules

This article describes how you can translate Kalkules into your native language.

The good thing about translating Kalkules is that you do not have to know anything about programming. All you have to know is how to edit a text file.

How translations work

Each translation is represented as a single text file located in the language folder. This text file contains all the translated texts.

The language folder is located in your Kalkules folder (where you have installed or copied Kalkules). The general path is:

{Kalkules folder}/lang

For instance: If you have installed Kalkules in C:\Program Files\Kalkules (which is the default installation option), your language folder path is:

C:\Program Files\Kalkules\lang

Creating a new translation

Probably the best way to create a new translation is to take an existing translation file, and change the translated texts. For instance, lets say you want to create a German translation using the existing English translation. You can do that by following these steps:

  1. Open your language folder
  2. Find the file named english.txt
  3. Make a copy of that file and name it for instance deutsch.txt (the file name can be random, but it should represent the language of the translation)
  4. Open deutsch.txt in a text editor (such as NotePad, PSPad or NotePad ++). Now you should see something like this:

    [Info]
    FileVersion=0.2.0
    FileDate=2011-10-03
    Program=Kalkules 1.6 - 1.8
    LanguageName=English
    LanguageIsoCode=en
    Encoding=CP1250
    
    [Author]
    name=Jardo
    email=support@kalkules.com
    url=http://www.kalkules.com/
    
    [Addresses]
    ManualFile=manual\en\manual.html
    ConstantFile=const\const-en.dat
    LibraryPath=lib\en
    UnitFile=units\en\units.xml
    DocumentationPage=http://wiki.kalkules.com/
    DownloadPage=http://www.kalkules.com/index.php?page=download
    HomePage=http://www.kalkules.com/
    
    [Common]
    Calculate=Calculate
    Close=Close
    InputError=Input error
    IncorrectValue=Value entered incorrectly.
    CalculationError=An error occurred during the calculation.
    Ok=Ok
    Apply=Apply
    Cancel=Cancel
    SelectAll=Select all
    Cut=Cut
    Copy=Copy
    ...

    Notice that the file is divided in several sections. Each section starts with its name surrounded by brackets ( [Info], [Author], [Addresses], …), and contains pairs of keys and values separated by =. The general pattern is:

    [Section 1]
    key1=value1
    key2=value2
    
    [Section 2]
    key1=value1
    key2=value2

    When translating, you only need to change the values. Remember that if you change a name of some section or a key, the translation file will not work properly.

  5. Start translating the texts. This is done by editing the values in all sections:

    Section [Info]

    This section contains general information about the translation:

    • FileVersion: version of the translation file, just leave it unchanged for now
    • FileDate: the date indicating when the file was changed (in iso format: yyyy-mm-dd). You should update its value everytime you change something in the translation file. For now, write the current date.
    • Program: indicates which program and which version does the translation work with. Just leave it unchanged.
    • LanguageName: is used to identify the language. This name will be displayed in the list of languages when selecting the programs language. When translating into German, you can put in Deutsch.
    • LanguageIsoCode: the two-character iso code of your language. Language iso codes can be found here. The iso code for German language is de.
    • Encoding: this item represents the encoding of the translation file. If you are not sure which encoding are you using, leave the value blank.


    After editing, your Info section could look like this:

    [Info]
    FileVersion=0.2.0
    FileDate=2012-06-27
    Program=Kalkules 1.6 - 1.8
    LanguageName=Deutsch
    LanguageIsoCode=de
    Encoding=CP1250
    Section [Author]

    Information about the author of the translation:

    • name: enter your name or nickname
    • email: your email address, which can be used for user feedback. If you don't want to publish your email, just leave it blank.
    • url: url of your website or blog. If you don't have any, just leave it blank.
    Section [Addresses]

    This sections contains information about various file paths and web addresses. This information should be changed in case you translate the program manual, constant file, library files, etc. The default values point to the English versions of the files. For now you can leave them unchanged.

    Section [Common]

    Now we can finally start to translate the texts. The Common section contains texts, which are common for several Kalkules forms or tools. All we have to do now, is change the text values to German. Remember to only change the texts on the ride side of the = sign. In our example, the Common section could look like this:

    [Common]
    Calculate=Berechne
    Close=Schließe
    InputError=Eingabefehler
    IncorrectValue=Eingegebener Wert ist nicht korrekt
    CalculationError=Während der Berechnung ist ein Fehler aufgetreten
    Ok=Ok
    Apply=Anwenden
    Cancel=Abbrechen
    ...

    If you do not know how to translate some texts, leave them untranslated. Never leave any text values blank. Doing so would only make the program features imposible to use.

    Other sections

    The other sections in the translation file contain all the programs texts divided into parts by their usage. You can translate them the same way as the Common section.

  6. Test your translation. Start (or restart) Kalkules and select Preferences/Language… from the main menu. In the language list on the diplayed window, you should be able to see your new language (the name you entered as languageName in the Info section). Select your new language and press Ok. Now you should look through all the program windows and check if all the texts are translated correctly. While on it, you should also chcek the texts for misspellings and grammar errors.

    If you experience any trouble with the translated texts, see the troubleshooting page.

  7. When you are satisfied with the resulting translation, you can submit your translation file via the contact form or send it to support(at)kalkules.com, so it can be included in the official distribution. Thank you for your contribution.

See also

translations/translating_kalkules.txt · Last modified: 2013/02/23 22:17 by admin