Qt linguist
In the UI snapshot above, the MessageEditor context is selected. i.e., if the numbers are equal, all the translatable strings in the context have translations. The number to the left of the slash is the number of those strings that currently have translations. The number to the right of the slash is the number of translatable strings in the context. Each entry in the Items column is a pair of numbers separated by a slash ("/"). To the right of the Context column is the Items column. This usually means the context itself no longer exists in the application. None of the translated strings still appears in the context.At least one string in the context has not been translated or is not marked as translated.All strings in the context have been translated or marked as translated, but at least one translation failed the validation tests.All strings in the context have been translated, and all the translations passed the validation tests.This column uses the following list of icons to summarize the current translation state for each context: To the left of the Context column is a column labeled. There can also be an, which contains strings that aren't in a subclass of QObject. There can also be a context for QObject itself, which contains strings passed to the static function QObject::tr(). Each context is the name of a subclass of QObject. The column labeled Context lists the context names in alphabetical order. It lists the contexts in which strings to be translated appear. The context window normally appears on the left side of the main window. The translation area is always visible, but the dockable subwindows can be activated or deactivated in the View|Views menu, and dragged around by their title bars and dropped in the translation area or even outside the main window. The subwindows are: Context, Sources and Forms, Strings, Phrases and guesses, and Warnings (hidden in the UI snapshot). This Qt Linguist main window is divided into dockable subwindows arranged around a central translation area.
Qt linguist code#
If the source code window is not visible, click the Sources and Forms tab at the bottom of the main window.Īt the end of the session choose File|Save from the menu bar and then File|Exit to quit. If the warnings window is not visible, click the Warnings tab at the bottom of the main window.įinally, if the source code for the contexts is accessible, the source code window shows the context where the current string is used. Validation test failures are shown in the warnings window. Qt Linguist can automatically check whether your translation strings pass a list of validation tests. To select a guess, double click it in the phrases and guesses window or use the keyboard shortcut shown to the right of the guess. The current strings translation is also shown here. These translation "guesses" have been read from phrase books ( Phrases|Open Phrase Book.). The phrases and guesses window shows possible translations for the current string. If the phrases and guesses window is not visible, click the Phrases and guesses tab at the bottom of the main window. Translation options are shown in the phrases and guesses window. Then select the next context and continue. Repeat this process until all strings in the string list are marked with or.
To accept the translation, either press the green tick mark button on the toolbar, or click the icon to the left of the selected source string in the string list. Click in the text entry widget below the copied string and type your translation for that string. Selecting one of the strings copies that string as the Source text in the translation area. Selecting a context loads the translatable strings found in that context into the string list. With a translation file loaded, select a context from the context list on the left. The context list is normally shown on the left, and the source code, string list, and either the phrases and guesses, or the warnings are shown above and below the translations area. The Qt Linguist main window is divided into several, dockable subwindows arranged around a central translation area.
Qt linguist how to#
If you do not have a TS file, see the release manager manual to learn how to generate one. Once Qt Linguist has started, choose File|Open from the menu bar and select a translation source (TS file) to load. Run Qt Linguist from the taskbar menu, or by double clicking the desktop icon, or by entering the command linguist at the command line. Qt Linguist is a tool for adding translations to Qt applications. Contents The One Minute Guide to Using Qt Linguist