Skip to content

Translating

sunderme edited this page May 5, 2018 · 3 revisions

The translation of TXS is based on Qt's translation framework. There are two ways of editing translations:

  • the web service transifex
  • the program QtLinguist

Using transiflex

Probably the easiest way of translating TeXstudio is online editing the TeXstudio project on transifex.

Using QtLinguist

The translation of TXS is based on Qt's translation framework. For more details see: http://doc.qt.io/qt-5/qtlinguist-index.html

Basically, what you want to do, is editing the .ts file of your language with QtLinguist. It's fine if you just update that file.

On a broader scope, a little bit more has to be done to update the inputs in the .ts file from the code and to finally create the translated data files (.qm) which the application will use later on. The complete translation process is described in the following sections.

Full process of updating translations

  1. Call texstudio --update-translations and copy the generated additionaltranslations.cpp to your source folder. This may be omitted, because changes to TXS that need this step are rare. See Additional Translations for details.
  2. Call lupdate: This extracts translatable strings from the sources to a .ts file (or updates an existing one).
  3. Edit translations in .ts file using QtLinguist.
  4. Call lrelease: This compiles .ts files to .qm files.
  5. Provide the .ts and .qm file (either create a pull request or send them to us via email).

Additional Translations

lupdate only looks for translations in source files. However there are other strings that need to be translated (e.g. from uiconfig.xml, color names, qnfa format names). Calling texstudio --update-translations in a debug build of TXS generates a file additionaltranslations.cpp that defines these strings, so they can be integrated in the translation process. Note: When you use shadow building, the file is generated in the build folder. You have to manually copy it to your source folder.

Easily Translating Corrected Strings

There have been lots of string changes recently, which only unify the capitalization or correct typos. By design of the Qt translation mechanism this creates a new string to translate, even though the translation might not be changed. It's helpful to sort the strings in QtLingust alphabetically (just click on the column head). That way, the old and new version will appear next to each other and you can copy the translation from the old string to the new one.