Translate DFF

From Digital Forensics Framework

Jump to: navigation, search

DFF number supported languages grows everyday, as of September 2011 we support English, Spanish, German, Dutch, Italian, Chinese and French.

To check for latest languages support please have a look to the CMakeLists.txt file in ui/gui/i18n. You can view the file on the Web-repository, at the line starting with set(DFF_SUPPORTED_LANGUAGES .

As issue #84 says, the translation system has been renovated. Most of the GUI strings are now translation-aware in DFF, but low-level ones can not be translated, especially messages and attributes created by low level modules (as file system attributes for example).

How to add a new language or update an existing one

The simplest way without using all the build chain is explained here.

Update an existing language

In case you just want to update an existing translation file, you have to fetch the .ts file corresponding to the existing language and not the Dff_en.ts. For example, if you wish to update the Spanish translation you will have to fetch the Dff_es.ts file.

Add a new language

Translation contributor can fetch latest Dff_en.ts file, in the next stable version (1.2.0) branch:

This file has to be renamed and modified according to the target language, following ISO 639-1 two letters code. Bellow is an example for the French language. Once done, please send it to the development mailing list.

Example with French language

As just explained above, we downloaded Dff_en.ts.

First all all, we rename it to Dff_fr.ts because the two letters code for French is fr, as we can see on the ISO website.

After that, two solutions are available for translation :

  • Manually edit each line in the .ts file
  • Use Qt Linguist tool part of the Qt SDK. This is the easiest way.

Manual translation

At the top of the file, replace

<!DOCTYPE TS><TS version="1.1">


<!DOCTYPE TS><TS version="1.1" language="XX">

Where XX is the two letter code found above, fr for this example.

Then, every line containing

<translation type="unfinished"></translation>

should be modified to

<translation>Translated text</translation>

(remove type="unfinished" and add the translated text inside ><).

Now you can send your translation file to the development mailing list.

Graphical translation

Qt Linguist provides a way to quickly translate software, for example by guessing you if text looks like something you already translated or showing you the graphical context of what you are about to translate

Without all the build chain and sources of DFF you wont be able to graphically view what need to be translated, but Qt Linguist is the fastest way to translate a .ts file.

First of all, the target language have to be set:

  • launch Qt linguist
  • open your freshly renames .ts file, Dff_fr.ts for example
  • linguist should guess you for the target language ; set it from the list in front of Language in the section Target Language
    • if linguist doesn't guess you, set it using menu: Edit-> Translation File Settings...
  • now you have to translate every source text
    • for example <Alt><Enter> is an useful keyboard shortcut !

Once done, please save your .ts file and send it to the development mailing list.

How to add and test a new language

This requires all the build chain of DFF.

Translation contributors have to fetch latest sources and build dff.

Guidelines to add and test a new language is explained here.

  • first of all you have to find the two letters abbreviation for your language on the ISO website (en for English, fr for French, and so on).
  • add those two letters xx it to DFF_SUPPORTED_LANGUAGES variable in ui/gui/i18n/CMakeLists.txt, please keep the list of supported languages sorted alphabetically
  • add .ts file name made of the two letters at the end of the ui/gui/i18n/ file
  • run cmake
  • modify new Dff_xx.ts file in ui/gui/i18n made of translatable strings, either manually or using Qt Linguist
  • run make
  • run dff with --language=xx switch to use your new language, or go to Edit->Preferences->Language to hot-change it

Be careful ; each source file containing translatable strings or .ui widget design file must be added to ui/gui/i18n/ This file should be maintained up to date.

Related issues and references