Skip to content

Translating

Stefan Löffler edited this page Aug 15, 2025 · 6 revisions

TeXworks uses the standard Qt mechanisms to support translating the user interface into other languages than the default (built-in) English. In addition, there are a few extra strings used outside the user interface, e.g., for representing TeXworks in the operating system and in various app stores.

There are two ways to contribute to the translation of the user interface detailed below. The additional strings are documented at the end of this page.

The recommended way: Weblate

Weblate provides an easy-to-use web-interface for translating the TeXworks user interface.

The expert way: source code

To translate the user interface from the source code, it is recommended to install the Qt linguist tools from a current version of Qt.

In brief, to provide a translation for a particular language, you need to

  • use the lupdate tool to create/uptdate .ts files for TeXworks itself and the QtPDF library; .ts files are XML files containing all the text strings from the user interface;
  • use Linguist to edit these files, adding the translation for each string (this could also be done with a simple text editor, but using Linguist is recommended)
  • use Linguist or lrelease to compile the .ts files into .qm files that can be loaded at runtime; and
  • put the .qm files into the TeXworks translations folder.
  • consider sharing the updated .ts files, e.g., by creating a pull request, creating an issue, or posting to the mailing list.

A little more detail

Translation files are named with a two-letter language code such as "de" (German), "fr" (French), etc., following the conventions for locale names. A country code can be added where there are variations between different languages (e.g., "en_US" versus "en_GB"), but in most cases it should not be necessary to make such distinctions.

In the TeXworks source code, translations live in several directories:

  • trans contains the translations belonging to the core of TeXworks
  • modules/QtPDF/trans contains the translations belonging to QtPDF, the library responsible for handling .pdf files
  • several other special locations described below

In the following, we will describe how to deal with the TeXworks core translations. Translating other parts should work analogously.

To create a new .ts file for a particular language, run lupdate on the TeXworks_trans.pro file (in the trans directory), and specify the .ts file to be created. We'll use German as an example:

    cd trans
    lupdate TeXworks_trans.pro -ts TeXworks_de.ts

The same command is used to update the .ts file when there are changes in the TeXworks source. (Alternatively, you can run make UpdateTranslations if you built TeXworks from source.) This allows you to keep all your existing translation work, and just add or modify strings for any changed parts of the user interface.

Use Qt Linguist to edit the .ts file, adding translations. Note that Linguist can show the source code where the string is used, which may be helpful in understanding the context if it is not immediately clear. It also "remembers" your translations, so that if the same string occurs again, it can suggest the same translation.

Finally, use the File/Release command within Linguist to generate a compiled .qm file (or use the lrelease command-line tool). Note that you can do this at any stage; if you have not translated all the strings, the original English will be used for those that are missing. So you can try out your work before finishing it all.

For your translation to be loaded by TeXworks, you need to put the .qm file in the translations folder (in the TeXworks resources folder, alongside others such as templates and completion files); then re-start the TeXworks application.

Once you are satisfied with your work we'd be happy to include it in TeXworks. You can create a pull request on GitHub, link the .ts file to a new issue, or send it to the mailing list to let us know of your contribution.

Additional translatable strings

In addition to the main .ts files, there are a number of other files that include translatable strings. These are used mostly for the integration with the operating system, e.g. in installers, as well as app stores and can be found in the following files:

  • texworks.appdata.xml: an XML file used on *nix systems. It includes a translatable <summary> and <description>
  • texworks.desktop: also used on *nix systems. It includes a translatable GenericName and Comment (which should match the <summary> in texworks.appdata.xml)
  • win32/texworks-setup-script.iss: source file for the Windows setup. It includes a translatable CreateFileAssoc field

The format of these files varies, but should be obvious by looking at the already translated strings.

Clone this wiki locally